<!-- llms.txt: https://workos.com/llms.txt -->

# Organization membership

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

See the [events reference](https://workos.com/docs/events/organization-membership) documentation for the organization membership events.

## Create an organization membership

Creates a new `active` organization membership for the given organization and user.

Calling this API with an organization and user that match an `inactive` organization membership will activate the membership with the specified role(s).

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request POST \
  --url "https://api.workos.com/user_management/organization_memberships" \
  --header "Authorization: Bearer sk_example_123456789" \
  --header "Content-Type: application/json" \
  -d @- <<'BODY'
    {
        "user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
        "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5",
        "role_slug": "admin"
    }
BODY
```

```js language="js" title="Request" tab="1"
import { WorkOS } from '@workos-inc/node';

const workos = new WorkOS('sk_example_123456789');

const organizationMembership =
  await workos.userManagement.createOrganizationMembership({
    organizationId: 'org_01E4ZCR3C56J083X43JQXF3JK5',
    userId: 'user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E',
    roleSlug: 'admin',
  });
```

```rb language="ruby" title="Request" tab="1"
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.organization_membership.create_organization_membership(
  user_id: "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
  organization_id: "org_01E4ZCR3C56J083X43JQXF3JK5"
)
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.organization_membership.create_organization_membership(
    user_id="user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
    organization_id="org_01E4ZCR3C56J083X43JQXF3JK5",
)
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

	"github.com/workos/workos-go/v10"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.OrganizationMembership().Create(context.Background(), &workos.OrganizationMembershipCreateParams{
		UserID:         "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
		OrganizationID: "org_01E4ZCR3C56J083X43JQXF3JK5",
	})
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->organizationMembership()
    ->createOrganizationMembership(
        userId: "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
        organizationId: "org_01E4ZCR3C56J083X43JQXF3JK5",
    );
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;
import com.workos.organizationmembership.OrganizationMembershipApi.CreateOrganizationMembershipOptions;

WorkOS workos = new WorkOS("sk_example_123456789");

CreateOrganizationMembershipOptions options =
    CreateOrganizationMembershipOptions.builder()
        .userId("user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E")
        .organizationId("org_01E4ZCR3C56J083X43JQXF3JK5")
        .build();

workos.organizationMembership.createOrganizationMembership(options);
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.OrganizationMembership.CreateAsync(new OrganizationMembershipCreateOptions {
    UserId = "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
    OrganizationId = "org_01E4ZCR3C56J083X43JQXF3JK5",
});
```

```rust language="rust" title="Request" tab="1"
use workos::Client;
use workos::organization_membership::CreateOrganizationMembershipParams;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .organization_membership()
        .create_organization_membership(
            CreateOrganizationMembershipParams {
                user_id: "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E".into(),
                organization_id: "org_01E4ZCR3C56J083X43JQXF3JK5".into(),
                ..Default::default()
            }
        )
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "organization_membership",
  "id": "om_01HXYZ123456789ABCDEFGHIJ",
  "user_id": "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E",
  "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5",
  "status": "active",
  "directory_managed": false,
  "organization_name": "Acme Corp",
  "custom_attributes": {
    "department": "Engineering",
    "title": "Developer Experience Engineer",
    "location": "Brooklyn"
  },
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z",
  "role": {
    "slug": "admin"
  },
  "roles": [
    {
      "slug": "admin"
    }
  ],
  "user": {
    "object": "user",
    "id": "user_01E4ZCR3C56J083X43JQXF3JK5",
    "first_name": "Marcelina",
    "last_name": "Davis",
    "name": "Marcelina Davis",
    "profile_picture_url": "https://workoscdn.com/images/v1/123abc",
    "email": "marcelina.davis@example.com",
    "email_verified": true,
    "external_id": "f1ffa2b2-c20b-4d39-be5c-212726e11222",
    "metadata": {
      "timezone": "America/New_York"
    },
    "last_sign_in_at": "2025-06-25T19:07:33.155Z",
    "locale": "en-US",
    "created_at": "2026-01-15T12:00:00.000Z",
    "updated_at": "2026-01-15T12:00:00.000Z"
  }
}
```

:::

## Deactivate an organization membership

Deactivates an `active` organization membership. Emits an [organization\_membership.updated](https://workos.com/docs/events/organization-membership) event upon successful deactivation.

- Deactivating an `inactive` membership is a no-op and does not emit an event.
- Deactivating a `pending` membership returns an error. This membership should be [deleted](https://workos.com/docs/reference/authkit/organization-membership/delete) instead.

See the [membership management documentation](https://workos.com/docs/authkit/users-organizations/organizations/membership-management) for additional details.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request PUT \
  --url "https://api.workos.com/user_management/organization_memberships/om_01HXYZ123456789ABCDEFGHIJ/deactivate" \
  --header "Authorization: Bearer sk_example_123456789"
```

```js language="js" title="Request" tab="1"
import { WorkOS } from '@workos-inc/node';

const workos = new WorkOS('sk_example_123456789');

const organizationMembership =
  await workos.userManagement.deactivateOrganizationMembership(
    'om_01E4ZCR3C56J083X43JQXF3JK5',
  );
```

```rb language="ruby" title="Request" tab="1"
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.organization_membership.deactivate_organization_membership(id: "om_01HXYZ123456789ABCDEFGHIJ")
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.organization_membership.deactivate_organization_membership(
    id_="om_01HXYZ123456789ABCDEFGHIJ"
)
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

	"github.com/workos/workos-go/v10"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.OrganizationMembership().Deactivate(context.Background(), "om_01HXYZ123456789ABCDEFGHIJ")
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->organizationMembership()
    ->deactivateOrganizationMembership(id: "om_01HXYZ123456789ABCDEFGHIJ");
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.organizationMembership.deactivateOrganizationMembership(
    "om_01HXYZ123456789ABCDEFGHIJ");
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.OrganizationMembership.DeactivateAsync("om_01HXYZ123456789ABCDEFGHIJ");
```

```rust language="rust" title="Request" tab="1"
use workos::Client;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .organization_membership()
        .deactivate_organization_membership("om_01HXYZ123456789ABCDEFGHIJ")
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "organization_membership",
  "id": "om_01HXYZ123456789ABCDEFGHIJ",
  "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5",
  "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT",
  "status": "inactive",
  "directory_managed": false,
  "organization_name": "Acme Corp",
  "custom_attributes": {
    "department": "Engineering",
    "title": "Developer Experience Engineer",
    "location": "Brooklyn"
  },
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z",
  "role": {
    "slug": "admin"
  },
  "roles": [
    {
      "slug": "admin"
    }
  ],
  "user": {
    "object": "user",
    "id": "user_01E4ZCR3C56J083X43JQXF3JK5",
    "first_name": "Marcelina",
    "last_name": "Davis",
    "name": "Marcelina Davis",
    "profile_picture_url": "https://workoscdn.com/images/v1/123abc",
    "email": "marcelina.davis@example.com",
    "email_verified": true,
    "external_id": "f1ffa2b2-c20b-4d39-be5c-212726e11222",
    "metadata": {
      "timezone": "America/New_York"
    },
    "last_sign_in_at": "2025-06-25T19:07:33.155Z",
    "locale": "en-US",
    "created_at": "2026-01-15T12:00:00.000Z",
    "updated_at": "2026-01-15T12:00:00.000Z"
  }
}
```

:::

## Delete an organization membership

Permanently deletes an existing organization membership. It cannot be undone.

:::code-group{title="Request"}

```bash language="curl"
curl --request DELETE \
  --url https://api.workos.com/user_management/organization_memberships/om_01E4ZCR3C56J083X43JQXF3JK5 \
  --header "Authorization: Bearer sk_example_123456789"
```

```js language="js"
import { WorkOS } from '@workos-inc/node';

const workos = new WorkOS('sk_example_123456789');

await workos.userManagement.deleteOrganizationMembership(
  'om_01E4ZCR3C56J083X43JQXF3JK5',
);
```

```rb language="ruby"
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.organization_membership.delete_organization_membership(id: "om_01HXYZ123456789ABCDEFGHIJ")
```

```py language="python"
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.organization_membership.delete_organization_membership(
    id_="om_01HXYZ123456789ABCDEFGHIJ"
)
```

```go language="go"
package main

import (
	"context"

	"github.com/workos/workos-go/v10"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.OrganizationMembership().Delete(context.Background(), "om_01HXYZ123456789ABCDEFGHIJ")
	if err != nil {
		panic(err)
	}
}
```

```php language="php"
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->organizationMembership()
    ->deleteOrganizationMembership(id: "om_01HXYZ123456789ABCDEFGHIJ");
```

```java language="java"
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.organizationMembership.deleteOrganizationMembership(
    "om_01HXYZ123456789ABCDEFGHIJ");
```

```cs language="dotnet"
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.OrganizationMembership.DeleteAsync("om_01HXYZ123456789ABCDEFGHIJ");
```

```rust language="rust"
use workos::Client;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .organization_membership()
        .delete_organization_membership("om_01HXYZ123456789ABCDEFGHIJ")
        .await?;

    Ok(())
}
```

:::

## Get an organization membership

Get the details of an existing organization membership.

:::code-group

```bash language="curl" title="Request" tab="1"
curl "https://api.workos.com/user_management/organization_memberships/om_01HXYZ123456789ABCDEFGHIJ" \
  --header "Authorization: Bearer sk_example_123456789"
```

```js language="js" title="Request" tab="1"
import { WorkOS } from '@workos-inc/node';

const workos = new WorkOS('sk_example_123456789');

const organizationMembership =
  await workos.userManagement.getOrganizationMembership(
    'om_01E4ZCR3C56J083X43JQXF3JK5',
  );
```

```rb language="ruby" title="Request" tab="1"
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.organization_membership.get_organization_membership(id: "om_01HXYZ123456789ABCDEFGHIJ")
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.organization_membership.get_organization_membership(
    id_="om_01HXYZ123456789ABCDEFGHIJ"
)
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

	"github.com/workos/workos-go/v10"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.OrganizationMembership().Get(context.Background(), "om_01HXYZ123456789ABCDEFGHIJ")
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->organizationMembership()
    ->getOrganizationMembership(id: "om_01HXYZ123456789ABCDEFGHIJ");
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.organizationMembership.getOrganizationMembership("om_01HXYZ123456789ABCDEFGHIJ");
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.OrganizationMembership.GetAsync("om_01HXYZ123456789ABCDEFGHIJ");
```

```rust language="rust" title="Request" tab="1"
use workos::Client;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .organization_membership()
        .get_organization_membership("om_01HXYZ123456789ABCDEFGHIJ")
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "organization_membership",
  "id": "om_01HXYZ123456789ABCDEFGHIJ",
  "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5",
  "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT",
  "status": "active",
  "directory_managed": false,
  "organization_name": "Acme Corp",
  "custom_attributes": {
    "department": "Engineering",
    "title": "Developer Experience Engineer",
    "location": "Brooklyn"
  },
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z",
  "role": {
    "slug": "admin"
  },
  "roles": [
    {
      "slug": "admin"
    }
  ],
  "user": {
    "object": "user",
    "id": "user_01E4ZCR3C56J083X43JQXF3JK5",
    "first_name": "Marcelina",
    "last_name": "Davis",
    "name": "Marcelina Davis",
    "profile_picture_url": "https://workoscdn.com/images/v1/123abc",
    "email": "marcelina.davis@example.com",
    "email_verified": true,
    "external_id": "f1ffa2b2-c20b-4d39-be5c-212726e11222",
    "metadata": {
      "timezone": "America/New_York"
    },
    "last_sign_in_at": "2025-06-25T19:07:33.155Z",
    "locale": "en-US",
    "created_at": "2026-01-15T12:00:00.000Z",
    "updated_at": "2026-01-15T12:00:00.000Z"
  }
}
```

:::

## List groups

Get a list of groups that an organization membership belongs to.

:::code-group

```bash language="curl" title="Request" tab="1"
curl "https://api.workos.com/user_management/organization_memberships/om_01HXYZ123456789ABCDEFGHIJ/groups" \
  --header "Authorization: Bearer sk_example_123456789"
```

```rb language="ruby" title="Request" tab="1"
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.organization_membership.list_organization_membership_groups(om_id: "om_01HXYZ123456789ABCDEFGHIJ")
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.organization_membership.list_organization_membership_groups(
    om_id="om_01HXYZ123456789ABCDEFGHIJ"
)
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

	"github.com/workos/workos-go/v10"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.OrganizationMembership().ListGroups(context.Background(), "om_01HXYZ123456789ABCDEFGHIJ")
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->organizationMembership()
    ->listOrganizationMembershipGroups(omId: "om_01HXYZ123456789ABCDEFGHIJ");
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.organizationMembership.listOrganizationMembershipGroups(
    "om_01HXYZ123456789ABCDEFGHIJ");
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.OrganizationMembership.ListGroupsAsync("om_01HXYZ123456789ABCDEFGHIJ");
```

```rust language="rust" title="Request" tab="1"
use workos::Client;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .organization_membership()
        .list_organization_membership_groups("om_01HXYZ123456789ABCDEFGHIJ")
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "list",
  "data": [
    {
      "object": "group",
      "id": "group_01HXYZ123456789ABCDEFGHIJ",
      "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY",
      "name": "Engineering",
      "description": "The engineering team",
      "created_at": "2026-01-15T12:00:00.000Z",
      "updated_at": "2026-01-15T12:00:00.000Z"
    }
  ],
  "list_metadata": {
    "before": "group_01HXYZ123456789ABCDEFGHIJ",
    "after": "group_01HXYZ987654321KJIHGFEDCBA"
  }
}
```

:::

## List organization memberships

Get a list of all organization memberships matching the criteria specified. At least one of `user_id` or `organization_id` must be provided. By default only active memberships are returned. Use the `statuses` parameter to filter by other statuses.

:::code-group

```bash language="curl" title="Request" tab="1"
curl "https://api.workos.com/user_management/organization_memberships" \
  --header "Authorization: Bearer sk_example_123456789"
```

```js language="js" title="Request" tab="1"
import { WorkOS } from '@workos-inc/node';

const workos = new WorkOS('sk_example_123456789');

const organizationMemberships =
  await workos.userManagement.listOrganizationMemberships({
    userId: 'user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E',
  });

console.log(organizationMemberships.data);
```

```rb language="ruby" title="Request" tab="1"
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.organization_membership.list_organization_memberships
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.organization_membership.list_organization_memberships()
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

	"github.com/workos/workos-go/v10"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.OrganizationMembership().List(context.Background())
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos->organizationMembership()->listOrganizationMemberships();
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.organizationMembership.listOrganizationMemberships();
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.OrganizationMembership.ListAsync();
```

```rust language="rust" title="Request" tab="1"
use workos::Client;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .organization_membership()
        .list_organization_memberships()
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "list",
  "data": [
    {
      "object": "organization_membership",
      "id": "om_01HXYZ123456789ABCDEFGHIJ",
      "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5",
      "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT",
      "status": "active",
      "directory_managed": false,
      "organization_name": "Acme Corp",
      "custom_attributes": {
        "department": "Engineering",
        "title": "Developer Experience Engineer",
        "location": "Brooklyn"
      },
      "created_at": "2026-01-15T12:00:00.000Z",
      "updated_at": "2026-01-15T12:00:00.000Z",
      "role": {
        "slug": "admin"
      },
      "roles": [
        {
          "slug": "admin"
        }
      ],
      "user": {
        "object": "user",
        "id": "user_01E4ZCR3C56J083X43JQXF3JK5",
        "first_name": "Marcelina",
        "last_name": "Davis",
        "name": "Marcelina Davis",
        "profile_picture_url": "https://workoscdn.com/images/v1/123abc",
        "email": "marcelina.davis@example.com",
        "email_verified": true,
        "external_id": "f1ffa2b2-c20b-4d39-be5c-212726e11222",
        "metadata": {
          "timezone": "America/New_York"
        },
        "last_sign_in_at": "2025-06-25T19:07:33.155Z",
        "locale": "en-US",
        "created_at": "2026-01-15T12:00:00.000Z",
        "updated_at": "2026-01-15T12:00:00.000Z"
      }
    }
  ],
  "list_metadata": {
    "before": "om_01HXYZ123456789ABCDEFGHIJ",
    "after": "om_01HXYZ987654321KJIHGFEDCBA"
  }
}
```

:::

## Reactivate an organization membership

Reactivates an `inactive` organization membership, retaining the pre-existing role(s). Emits an [organization\_membership.updated](https://workos.com/docs/events/organization-membership) event upon successful reactivation.

- Reactivating an `active` membership is a no-op and does not emit an event.
- Reactivating a `pending` membership returns an error. The user needs to [accept the invitation](https://workos.com/docs/authkit/invitations) instead.

See the [membership management documentation](https://workos.com/docs/authkit/users-organizations/organizations/membership-management) for additional details.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request PUT \
  --url "https://api.workos.com/user_management/organization_memberships/om_01HXYZ123456789ABCDEFGHIJ/reactivate" \
  --header "Authorization: Bearer sk_example_123456789"
```

```js language="js" title="Request" tab="1"
import { WorkOS } from '@workos-inc/node';

const workos = new WorkOS('sk_example_123456789');

const organizationMembership =
  await workos.userManagement.reactivateOrganizationMembership(
    'om_01E4ZCR3C56J083X43JQXF3JK5',
  );
```

```rb language="ruby" title="Request" tab="1"
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.organization_membership.reactivate_organization_membership(id: "om_01HXYZ123456789ABCDEFGHIJ")
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.organization_membership.reactivate_organization_membership(
    id_="om_01HXYZ123456789ABCDEFGHIJ"
)
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

	"github.com/workos/workos-go/v10"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.OrganizationMembership().Reactivate(context.Background(), "om_01HXYZ123456789ABCDEFGHIJ")
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->organizationMembership()
    ->reactivateOrganizationMembership(id: "om_01HXYZ123456789ABCDEFGHIJ");
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.organizationMembership.reactivateOrganizationMembership(
    "om_01HXYZ123456789ABCDEFGHIJ");
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.OrganizationMembership.ReactivateAsync("om_01HXYZ123456789ABCDEFGHIJ");
```

```rust language="rust" title="Request" tab="1"
use workos::Client;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .organization_membership()
        .reactivate_organization_membership("om_01HXYZ123456789ABCDEFGHIJ")
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "organization_membership",
  "id": "om_01HXYZ123456789ABCDEFGHIJ",
  "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5",
  "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT",
  "status": "active",
  "directory_managed": false,
  "organization_name": "Acme Corp",
  "custom_attributes": {
    "department": "Engineering",
    "title": "Developer Experience Engineer",
    "location": "Brooklyn"
  },
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z",
  "role": {
    "slug": "admin"
  },
  "roles": [
    {
      "slug": "admin"
    }
  ],
  "user": {
    "object": "user",
    "id": "user_01E4ZCR3C56J083X43JQXF3JK5",
    "first_name": "Marcelina",
    "last_name": "Davis",
    "name": "Marcelina Davis",
    "profile_picture_url": "https://workoscdn.com/images/v1/123abc",
    "email": "marcelina.davis@example.com",
    "email_verified": true,
    "external_id": "f1ffa2b2-c20b-4d39-be5c-212726e11222",
    "metadata": {
      "timezone": "America/New_York"
    },
    "last_sign_in_at": "2025-06-25T19:07:33.155Z",
    "locale": "en-US",
    "created_at": "2026-01-15T12:00:00.000Z",
    "updated_at": "2026-01-15T12:00:00.000Z"
  }
}
```

:::

## Update an organization membership

Update the details of an existing organization membership.

:::code-group

```bash language="curl" title="Request" tab="1"
curl --request PUT \
  --url "https://api.workos.com/user_management/organization_memberships/om_01HXYZ123456789ABCDEFGHIJ" \
  --header "Authorization: Bearer sk_example_123456789" \
  --header "Content-Type: application/json" \
  -d @- <<'BODY'
    {
        "role_slug": "admin"
    }
BODY
```

```js language="js" title="Request" tab="1"
import { WorkOS } from '@workos-inc/node';

const workos = new WorkOS('sk_example_123456789');

const organizationMembership =
  await workos.userManagement.updateOrganizationMembership(
    'om_01E4ZCR3C56J083X43JQXF3JK5',
    {
      roleSlug: 'admin',
    },
  );
```

```rb language="ruby" title="Request" tab="1"
require "workos"

WorkOS.configure do |config|
  config.api_key = "sk_example_123456789"
end

WorkOS.client.organization_membership.update_organization_membership(id: "om_01HXYZ123456789ABCDEFGHIJ")
```

```py language="python" title="Request" tab="1"
from workos import WorkOSClient

client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789")

client.organization_membership.update_organization_membership(
    id_="om_01HXYZ123456789ABCDEFGHIJ"
)
```

```go language="go" title="Request" tab="1"
package main

import (
	"context"

	"github.com/workos/workos-go/v10"
)

func main() {
	client := workos.NewClient("sk_example_123456789")

	_, err := client.OrganizationMembership().Update(context.Background(), "om_01HXYZ123456789ABCDEFGHIJ")
	if err != nil {
		panic(err)
	}
}
```

```php language="php" title="Request" tab="1"
<?php

use WorkOS\WorkOS;

$workos = new WorkOS(
    apiKey: "sk_example_123456789",
    clientId: "client_123456789",
);

$workos
    ->organizationMembership()
    ->updateOrganizationMembership(id: "om_01HXYZ123456789ABCDEFGHIJ");
```

```java language="java" title="Request" tab="1"
import com.workos.WorkOS;

WorkOS workos = new WorkOS("sk_example_123456789");

workos.organizationMembership.updateOrganizationMembership(
    "om_01HXYZ123456789ABCDEFGHIJ");
```

```cs language="dotnet" title="Request" tab="1"
using WorkOS;

var client = new WorkOSClient(new WorkOSOptions {
    ApiKey = "sk_example_123456789",
    ClientId = "client_123456789",
});

await client.OrganizationMembership.UpdateAsync("om_01HXYZ123456789ABCDEFGHIJ");
```

```rust language="rust" title="Request" tab="1"
use workos::Client;

#[tokio::main]
async fn main() -> Result<(), workos::Error> {
    let client = Client::builder()
        .api_key("sk_example_123456789")
        .client_id("client_123456789")
        .build();

    let _result = client
        .organization_membership()
        .update_organization_membership("om_01HXYZ123456789ABCDEFGHIJ")
        .await?;

    Ok(())
}
```

```json language="json" title="Response" tab="2"
{
  "object": "organization_membership",
  "id": "om_01HXYZ123456789ABCDEFGHIJ",
  "user_id": "user_01E4ZCR3C56J083X43JQXF3JK5",
  "organization_id": "org_01EHZNVPK3SFK441A1RGBFSHRT",
  "status": "active",
  "directory_managed": false,
  "organization_name": "Acme Corp",
  "custom_attributes": {
    "department": "Engineering",
    "title": "Developer Experience Engineer",
    "location": "Brooklyn"
  },
  "created_at": "2026-01-15T12:00:00.000Z",
  "updated_at": "2026-01-15T12:00:00.000Z",
  "role": {
    "slug": "admin"
  },
  "roles": [
    {
      "slug": "admin"
    }
  ],
  "user": {
    "object": "user",
    "id": "user_01E4ZCR3C56J083X43JQXF3JK5",
    "first_name": "Marcelina",
    "last_name": "Davis",
    "name": "Marcelina Davis",
    "profile_picture_url": "https://workoscdn.com/images/v1/123abc",
    "email": "marcelina.davis@example.com",
    "email_verified": true,
    "external_id": "f1ffa2b2-c20b-4d39-be5c-212726e11222",
    "metadata": {
      "timezone": "America/New_York"
    },
    "last_sign_in_at": "2025-06-25T19:07:33.155Z",
    "locale": "en-US",
    "created_at": "2026-01-15T12:00:00.000Z",
    "updated_at": "2026-01-15T12:00:00.000Z"
  }
}
```

:::

### organization_membership

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `object` | "organization_membership" | Yes | Distinguishes the organization membership object. |
| `id` | string | Yes | The unique ID of the organization membership. |
| `userId` | string | Yes | The ID of the [user](/reference/authkit/user). |
| `organizationId` | string | Yes | The ID of the [organization](/reference/organization) which the user belongs to. |
| `organizationName` | string | Yes | The name of the [organization](/reference/organization) which the user belongs to. |
| `role` | object | Yes | organization_membership.role |
| `roles` | array | Yes | The list of roles assigned to the user within the organization. |
| `customAttributes` | object | Yes | 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. |
| `directoryManaged` | boolean | Yes | Whether the organization membership is managed by a directory sync connection. |
| `status` | "active" \| "inactive" \| "pending" | Yes | The status of the organization membership. One of `active`, `inactive`, or `pending`. |
| `createdAt` | string | Yes | The timestamp when the organization membership was created. |
| `updatedAt` | string | Yes | The timestamp when the organization membership was last updated. |

### POST /user_management/organization_memberships

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `user_id` | string | Yes | The ID of the [user](/reference/authkit/user). |
| `organization_id` | string | Yes | The ID of the [organization](/reference/organization) which the user belongs to. |
| `role_slug` | string | No | A single role identifier. Defaults to `member` or the explicit default role. Mutually exclusive with `role_slugs`. |
| `role_slugs` | string[] | No | An array of role identifiers. Mutually exclusive with `role_slug`. Limited to one role when Multiple Roles is disabled. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `organization_membership` | object | Distinguishes the organization membership object. |

### PUT /user_management/organization_memberships/{id}/deactivate

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the organization membership. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `organization_membership` | object | Distinguishes the organization membership object. |

### DELETE /user_management/organization_memberships/{id}

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the organization membership. |

### GET /user_management/organization_memberships/{id}

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the organization membership. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `organization_membership` | object | Distinguishes the organization membership object. |

### GET /user_management/organization_memberships/{omId}/groups

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `omId` | string | Yes | Unique identifier of the Organization Membership. |
| `before` | string | No | An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. |
| `after` | string | No | An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. |
| `limit` | integer | No | Upper limit on the number of objects to return, between `1` and `100`. Defaults to `10`. |
| `order` | "normal" \| "desc" \| "asc" | No | Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to `normal`. |

### GET /user_management/organization_memberships

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `before` | string | No | An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `before="obj_123"` to fetch a new batch of objects before `"obj_123"`. |
| `after` | string | No | An object ID that defines your place in the list. When the ID is not present, you are at the end of the list. For example, if you make a list request and receive 100 objects, ending with `"obj_123"`, your subsequent call can include `after="obj_123"` to fetch a new batch of objects after `"obj_123"`. |
| `limit` | integer | No | Upper limit on the number of objects to return, between `1` and `100`. Defaults to `10`. |
| `order` | "normal" \| "desc" \| "asc" | No | Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to `desc`. |
| `organization_id` | string | No | The ID of the [organization](/reference/organization) which the user belongs to. |
| `statuses` | ("active" \| "inactive" \| "pending")[] | No | Filter by the status of the organization membership. Array including any of `active`, `inactive`, or `pending`. |
| `user_id` | string | No | The ID of the [user](/reference/authkit/user). |

### PUT /user_management/organization_memberships/{id}/reactivate

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the organization membership. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `organization_membership` | object | Distinguishes the organization membership object. |

### PUT /user_management/organization_memberships/{id}

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `role_slug` | string | No | A single role identifier. Defaults to `member` or the explicit default role. Mutually exclusive with `role_slugs`. |
| `role_slugs` | string[] | No | An array of role identifiers. Mutually exclusive with `role_slug`. Limited to one role when Multiple Roles is disabled. |

#### Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | Yes | The unique ID of the organization membership. |

#### Returns

| Field | Type | Description |
| --- | --- | --- |
| `organization_membership` | object | Distinguishes the organization membership object. |