---
descriptions:
  organization_membership:
    self: >-
      The corresponding [organization
      membership](/reference/authkit/organization-membership) object.
    object: Distinguishes the organization membership object.
    id: The unique ID of the organization membership.
    user_id: 'The ID of the [user](/reference/authkit/user).'
    organization_id: >-
      The ID of the [organization](/reference/organization) which the user
      belongs to.
    organization_name: >-
      The name of the [organization](/reference/organization) which the user
      belongs to.
    role:
      slug: The unique role identifier
    roles: The list of roles assigned to the user within the organization.
    custom_attributes: >-
      An object containing IdP-sourced attributes from the linked [Directory
      User](/reference/directory-sync/directory-user) or [SSO
      Profile](/reference/sso/profile). Directory User attributes take
      precedence when both are linked.
    directory_managed: >-
      Whether the organization membership is managed by a directory sync
      connection.
    status: >-
      The status of the organization membership. One of `active`, `inactive`, or
      `pending`.
    created_at: The timestamp when the organization membership was created.
    updated_at: The timestamp when the organization membership was last updated.
reference:
  curl:
    - url: /reference/authkit/organization-membership
      key: organization_membership
      id: organization_membership
      title: organization_membership
      properties:
        - key: object
          type: '"organization_membership"'
          description: (organization_membership.object)
        - key: id
          type: string
          description: (organization_membership.id)
        - key: userId
          type: string
          description: (organization_membership.user_id)
        - key: organizationId
          type: string
          description: (organization_membership.organization_id)
        - key: organizationName
          type: string
          description: (organization_membership.organization_name)
        - key: role
          type: object
          description: (organization_membership.role)
          properties:
            - key: slug
              type: string
              description: (organization_membership.role.slug)
        - key: roles
          type: array
          description: (organization_membership.roles)
          properties:
            - key: slug
              type: string
              description: (organization_membership.role.slug)
        - key: customAttributes
          type: object
          description: (organization_membership.custom_attributes)
        - key: directoryManaged
          type: boolean
          description: (organization_membership.directory_managed)
        - key: status
          type: '"active" | "inactive" | "pending"'
          description: (organization_membership.status)
        - key: createdAt
          type: string
          description: (organization_membership.created_at)
        - key: updatedAt
          type: string
          description: (organization_membership.updated_at)
  js:
    - url: /reference/authkit/organization-membership
      key: OrganizationMembership
      id: organization_membership
      title: interface OrganizationMembership
      properties:
        - key: object
          type: '"organization_membership"'
          description: (organization_membership.object)
        - key: id
          type: string
          description: (organization_membership.id)
        - key: userId
          type: string
          description: (organization_membership.user_id)
        - key: organizationId
          type: string
          description: (organization_membership.organization_id)
        - key: organizationName
          type: string
          description: (organization_membership.organization_name)
        - key: role
          type: object
          description: (organization_membership.role)
          properties:
            - key: slug
              type: string
              description: (organization_membership.role.slug)
        - key: roles
          type: array
          description: (organization_membership.roles)
          properties:
            - key: slug
              type: string
              description: (organization_membership.role.slug)
        - key: customAttributes
          type: object
          description: (organization_membership.custom_attributes)
        - key: directoryManaged
          type: boolean
          description: (organization_membership.directory_managed)
        - key: status
          type: '"active" | "inactive" | "pending"'
          description: (organization_membership.status)
        - key: createdAt
          type: string
          description: (organization_membership.created_at)
        - key: updatedAt
          type: string
          description: (organization_membership.updated_at)
  go:
    - url: /reference/authkit/organization-membership
      key: OrganizationMembership
      id: organization_membership
      title: usermanagement.OrganizationMembership
      properties:
        - key: ID
          type: string
          description: (organization_membership.id)
        - key: UserID
          type: string
          description: (organization_membership.user_id)
        - key: OrganizationID
          type: string
          description: (organization_membership.organization_id)
        - key: OrganizationName
          type: string
          description: (organization_membership.organization_name)
        - key: Role
          type: RoleResponse
          description: (organization_membership.role)
          properties:
            - key: Slug
              type: string
              description: (organization_membership.role.slug)
        - key: CustomAttributes
          type: 'map[string]interface{}'
          description: (organization_membership.custom_attributes)
        - key: DirectoryManaged
          type: bool
          description: (organization_membership.directory_managed)
        - key: Status
          type: '"active" | "inactive" | "pending"'
          description: (organization_membership.status)
        - key: CreatedAt
          type: string
          description: (organization_membership.created_at)
        - key: UpdatedAt
          type: string
          description: (organization_membership.updated_at)
  php:
    - url: /reference/authkit/organization-membership
      key: OrganizationMembership
      id: organization_membership
      title: WorkOS\Resource\OrganizationMembership
      properties:
        - key: object
          type: '"organization_membership"'
          description: (organization_membership.object)
        - key: id
          type: string
          description: (organization_membership.id)
        - key: userId
          type: string
          description: (organization_membership.user_id)
        - key: organizationId
          type: string
          description: (organization_membership.organization_id)
        - key: organizationName
          type: string
          description: (organization_membership.organization_name)
        - key: role
          type: object
          description: (organization_membership.role)
          properties:
            - key: slug
              type: string
              description: (organization_membership.role.slug)
        - key: customAttributes
          type: object
          description: (organization_membership.custom_attributes)
        - key: directoryManaged
          type: boolean
          description: (organization_membership.directory_managed)
        - key: status
          type: '"active" | "inactive" | "pending"'
          description: (organization_membership.status)
        - key: createdAt
          type: string
          description: (organization_membership.created_at)
        - key: updatedAt
          type: string
          description: (organization_membership.updated_at)
  python:
    - url: /reference/authkit/organization-membership
      key: OrganizationMembership
      id: organization_membership
      title: OrganizationMembership
      properties:
        - key: id
          type: str
          description: (organization_membership.id)
        - key: user_id
          type: str
          description: (organization_membership.user_id)
        - key: organization_id
          type: str
          description: (organization_membership.organization_id)
        - key: organization_name
          type: str
          description: (organization_membership.organization_name)
        - key: role
          type: OrganizationMembershipRole
          description: (organization_membership.role)
          properties:
            - key: slug
              type: str
              description: (organization_membership.role.slug)
        - key: roles
          type: 'List[OrganizationMembershipRole]'
          description: (organization_membership.roles)
          properties:
            - key: slug
              type: str
              description: (organization_membership.role.slug)
        - key: custom_attributes
          type: 'Dict[str, Any]'
          description: (organization_membership.custom_attributes)
        - key: directory_managed
          type: bool
          description: (organization_membership.directory_managed)
        - key: status
          type: '"active" | "inactive" | "pending"'
          description: (organization_membership.status)
        - key: created_at
          type: str
          description: (organization_membership.created_at)
        - key: updated_at
          type: str
          description: (organization_membership.updated_at)
  ruby:
    - url: /reference/authkit/organization-membership
      key: OrganizationMembership
      id: organization_membership
      title: class OrganizationMembership
      properties:
        - key: id
          type: String
          description: (organization_membership.id)
        - key: user_id
          type: String
          description: (organization_membership.user_id)
        - key: organization_id
          type: String
          description: (organization_membership.organization_id)
        - key: organization_name
          type: String
          description: (organization_membership.organization_name)
        - key: role
          type: object
          description: (organization_membership.role)
          properties:
            - key: slug
              type: String
              description: (organization_membership.role.slug)
        - key: custom_attributes
          type: Hash
          description: (organization_membership.custom_attributes)
        - key: directory_managed
          type: Boolean
          description: (organization_membership.directory_managed)
        - key: status
          type: String
          description: (organization_membership.status)
        - key: created_at
          type: String
          description: (organization_membership.created_at)
        - key: updated_at
          type: String
          description: (organization_membership.updated_at)
  java:
    - url: /reference/authkit/organization-membership
      key: OrganizationMembership
      id: organization_membership
      title: class OrganizationMembership
      properties:
        - key: id
          type: String
          description: (organization_membership.id)
        - key: userId
          type: String
          description: (organization_membership.user_id)
        - key: organizationId
          type: String
          description: (organization_membership.organization_id)
        - key: organizationName
          type: String
          description: (organization_membership.organization_name)
        - key: role
          type: OrganizationMembershipRole
          optional: true
          description: (organization_membership.role)
          properties:
            - key: slug
              type: String
              description: (organization_membership.role.slug)
        - key: customAttributes
          type: 'Map<String, Object>'
          description: (organization_membership.custom_attributes)
        - key: directoryManaged
          type: Boolean
          description: (organization_membership.directory_managed)
        - key: status
          type: OrganizationMembershipStatusEnumType
          description: (organization_membership.status)
        - key: createdAt
          type: String
          description: (organization_membership.created_at)
        - key: updatedAt
          type: String
          description: (organization_membership.updated_at)
originalPath: >-
  .tmp-workos-clone/packages/docs/content/reference/authkit/organization-membership/index.mdx
---

# Organization membership

An organization membership is a top-level resource that represents a [user](/reference/authkit/user)’s relationship with an [organization](/reference/organization). A user may be a member of zero, one, or many organizations.

See the [events reference](/events/organization-membership) documentation for the organization membership events.

<CodeBlock
  title="Example organization membership"
  referenceId="organization_membership"
  file="organization-membership"
/>
