An organization membership is a top-level resource that represents a user’s relationship with an organization. A user may be a member of zero, one, or many organizations.
See the events reference documentation for the organization membership events.
Get the details of an existing organization membership.
| curl "https://api.workos.com/user_management/organization_memberships/om_01HXYZ123456789ABCDEFGHIJ" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const organizationMembership = | |
| await workos.userManagement.getOrganizationMembership( | |
| 'om_01E4ZCR3C56J083X43JQXF3JK5', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organization_membership.get_organization_membership(id: "om_01HXYZ123456789ABCDEFGHIJ") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organization_membership.get_organization_membership( | |
| id_="om_01HXYZ123456789ABCDEFGHIJ" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.OrganizationMembership().Get(context.Background(), "om_01HXYZ123456789ABCDEFGHIJ") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizationMembership() | |
| ->getOrganizationMembership(id: "om_01HXYZ123456789ABCDEFGHIJ"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizationMembership.getOrganizationMembership("om_01HXYZ123456789ABCDEFGHIJ"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.OrganizationMembership.GetAsync("om_01HXYZ123456789ABCDEFGHIJ"); |
| 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(()) | |
| } |
| { | |
| "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" | |
| } | |
| } |
GET/user_management /organization_memberships /:id
Parameters
Returns
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.
| curl "https://api.workos.com/user_management/organization_memberships" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| 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); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organization_membership.list_organization_memberships |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organization_membership.list_organization_memberships() |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.OrganizationMembership().List(context.Background()) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos->organizationMembership()->listOrganizationMemberships(); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizationMembership.listOrganizationMemberships(); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.OrganizationMembership.ListAsync(); |
| 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(()) | |
| } |
| { | |
| "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" | |
| } | |
| } |
GET/user_management /organization_memberships
Parameters
Returns object
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).
| 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 |
| 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', | |
| }); |
| 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" | |
| ) |
| 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", | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| 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 | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizationMembership() | |
| ->createOrganizationMembership( | |
| userId: "user_01E4ZCR3C5A4QZ2Z2JQXGKZJ9E", | |
| organizationId: "org_01E4ZCR3C56J083X43JQXF3JK5", | |
| ); |
| 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); |
| 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", | |
| }); |
| 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(()) | |
| } |
| { | |
| "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" | |
| } | |
| } |
POST/user_management /organization_memberships
Returns
Update the details of an existing organization membership.
| 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 |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const organizationMembership = | |
| await workos.userManagement.updateOrganizationMembership( | |
| 'om_01E4ZCR3C56J083X43JQXF3JK5', | |
| { | |
| roleSlug: 'admin', | |
| }, | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organization_membership.update_organization_membership(id: "om_01HXYZ123456789ABCDEFGHIJ") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organization_membership.update_organization_membership( | |
| id_="om_01HXYZ123456789ABCDEFGHIJ" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.OrganizationMembership().Update(context.Background(), "om_01HXYZ123456789ABCDEFGHIJ") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizationMembership() | |
| ->updateOrganizationMembership(id: "om_01HXYZ123456789ABCDEFGHIJ"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizationMembership.updateOrganizationMembership( | |
| "om_01HXYZ123456789ABCDEFGHIJ"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.OrganizationMembership.UpdateAsync("om_01HXYZ123456789ABCDEFGHIJ"); |
| 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(()) | |
| } |
| { | |
| "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" | |
| } | |
| } |
PUT/user_management /organization_memberships /:id
Parameters
Returns
Deactivates an active organization membership. Emits an organization_membership.updated event upon successful deactivation.
- Deactivating an
inactivemembership is a no-op and does not emit an event. - Deactivating a
pendingmembership returns an error. This membership should be deleted instead.
See the membership management documentation for additional details.
| curl --request PUT \ | |
| --url "https://api.workos.com/user_management/organization_memberships/om_01HXYZ123456789ABCDEFGHIJ/deactivate" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const organizationMembership = | |
| await workos.userManagement.deactivateOrganizationMembership( | |
| 'om_01E4ZCR3C56J083X43JQXF3JK5', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organization_membership.deactivate_organization_membership(id: "om_01HXYZ123456789ABCDEFGHIJ") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organization_membership.deactivate_organization_membership( | |
| id_="om_01HXYZ123456789ABCDEFGHIJ" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.OrganizationMembership().Deactivate(context.Background(), "om_01HXYZ123456789ABCDEFGHIJ") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizationMembership() | |
| ->deactivateOrganizationMembership(id: "om_01HXYZ123456789ABCDEFGHIJ"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizationMembership.deactivateOrganizationMembership( | |
| "om_01HXYZ123456789ABCDEFGHIJ"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.OrganizationMembership.DeactivateAsync("om_01HXYZ123456789ABCDEFGHIJ"); |
| 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(()) | |
| } |
| { | |
| "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" | |
| } | |
| } |
PUT/user_management /organization_memberships /:id /deactivate
Parameters
Returns
Reactivates an inactive organization membership, retaining the pre-existing role(s). Emits an organization_membership.updated event upon successful reactivation.
- Reactivating an
activemembership is a no-op and does not emit an event. - Reactivating a
pendingmembership returns an error. The user needs to accept the invitation instead.
See the membership management documentation for additional details.
| curl --request PUT \ | |
| --url "https://api.workos.com/user_management/organization_memberships/om_01HXYZ123456789ABCDEFGHIJ/reactivate" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const organizationMembership = | |
| await workos.userManagement.reactivateOrganizationMembership( | |
| 'om_01E4ZCR3C56J083X43JQXF3JK5', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.organization_membership.reactivate_organization_membership(id: "om_01HXYZ123456789ABCDEFGHIJ") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.organization_membership.reactivate_organization_membership( | |
| id_="om_01HXYZ123456789ABCDEFGHIJ" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.OrganizationMembership().Reactivate(context.Background(), "om_01HXYZ123456789ABCDEFGHIJ") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizationMembership() | |
| ->reactivateOrganizationMembership(id: "om_01HXYZ123456789ABCDEFGHIJ"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizationMembership.reactivateOrganizationMembership( | |
| "om_01HXYZ123456789ABCDEFGHIJ"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.OrganizationMembership.ReactivateAsync("om_01HXYZ123456789ABCDEFGHIJ"); |
| 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(()) | |
| } |
| { | |
| "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" | |
| } | |
| } |
PUT/user_management /organization_memberships /:id /reactivate
Parameters
Returns
Get a list of groups that an organization membership belongs to.
| curl "https://api.workos.com/user_management/organization_memberships/om_01HXYZ123456789ABCDEFGHIJ/groups" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| 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") |
| 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" | |
| ) |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.OrganizationMembership().ListGroups(context.Background(), "om_01HXYZ123456789ABCDEFGHIJ") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->organizationMembership() | |
| ->listOrganizationMembershipGroups(omId: "om_01HXYZ123456789ABCDEFGHIJ"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.organizationMembership.listOrganizationMembershipGroups( | |
| "om_01HXYZ123456789ABCDEFGHIJ"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.OrganizationMembership.ListGroupsAsync("om_01HXYZ123456789ABCDEFGHIJ"); |
| 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(()) | |
| } |
| { | |
| "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" | |
| } | |
| } |
GET