An email invitation allows the recipient to sign up for your app and join a specific organization. When an invitation is accepted, a user and a corresponding organization membership are created.
Users may be invited to your app without joining an organization, or they may be invited to join an organization if they already have an account. Invitations may be also issued on behalf of another user. In this case, the invitation email will mention the name of the user who invited the recipient.
Get the details of an existing invitation.
curl "https://api.workos.com/user_management/invitations/invitation_01E4ZCR3C56J083X43JQXF3JK5" \ --header "Authorization: Bearer sk_example_123456789"
{ "object": "invitation", "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", "email": "marcelina.davis@example.com", "state": "pending", "accepted_at": null, "revoked_at": null, "expires_at": "2026-01-15T12:00:00.000Z", "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", "accepted_user_id": null, "role_slug": "admin", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" }
| curl "https://api.workos.com/user_management/invitations/invitation_01E4ZCR3C56J083X43JQXF3JK5" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const invitation = await workos.userManagement.getInvitation( | |
| 'invitation_01EHZNVPK3SFK441A1RGBFSHRT', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.get_invitation(id: "invitation_01E4ZCR3C56J083X43JQXF3JK5") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.get_invitation(id_="invitation_01E4ZCR3C56J083X43JQXF3JK5") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().GetInvitation(context.Background(), "invitation_01E4ZCR3C56J083X43JQXF3JK5") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->userManagement() | |
| ->getInvitation(id: "invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.userManagement.getInvitation("invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.GetInvitationAsync("invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| 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 | |
| .user_management() | |
| .get_invitation("invitation_01E4ZCR3C56J083X43JQXF3JK5") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "invitation", | |
| "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", | |
| "email": "marcelina.davis@example.com", | |
| "state": "pending", | |
| "accepted_at": null, | |
| "revoked_at": null, | |
| "expires_at": "2026-01-15T12:00:00.000Z", | |
| "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", | |
| "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", | |
| "accepted_user_id": null, | |
| "role_slug": "admin", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z", | |
| "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", | |
| "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" | |
| } |
GET/user_management /invitations /:idParameters Returns Retrieve an existing invitation using the token.
curl "https://api.workos.com/user_management/invitations/by_token/Z1uX3RbwcIl5fIGJJJCXXisdI" \ --header "Authorization: Bearer sk_example_123456789"
{ "object": "invitation", "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", "email": "marcelina.davis@example.com", "state": "pending", "accepted_at": null, "revoked_at": null, "expires_at": "2026-01-15T12:00:00.000Z", "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", "accepted_user_id": null, "role_slug": "admin", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" }
| curl "https://api.workos.com/user_management/invitations/by_token/Z1uX3RbwcIl5fIGJJJCXXisdI" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const invitation = await workos.userManagement.findInvitationByToken( | |
| 'Z1uX3RbwcIl5fIGJJJCXXisdI', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.find_invitation_by_token(token: "Z1uX3RbwcIl5fIGJJJCXXisdI") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.find_invitation_by_token(token="Z1uX3RbwcIl5fIGJJJCXXisdI") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().FindInvitationByToken(context.Background(), "Z1uX3RbwcIl5fIGJJJCXXisdI") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->userManagement() | |
| ->findInvitationByToken(token: "Z1uX3RbwcIl5fIGJJJCXXisdI"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.userManagement.findInvitationByToken("Z1uX3RbwcIl5fIGJJJCXXisdI"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.FindInvitationByTokenAsync("Z1uX3RbwcIl5fIGJJJCXXisdI"); |
| 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 | |
| .user_management() | |
| .find_invitation_by_token("Z1uX3RbwcIl5fIGJJJCXXisdI") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "invitation", | |
| "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", | |
| "email": "marcelina.davis@example.com", | |
| "state": "pending", | |
| "accepted_at": null, | |
| "revoked_at": null, | |
| "expires_at": "2026-01-15T12:00:00.000Z", | |
| "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", | |
| "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", | |
| "accepted_user_id": null, | |
| "role_slug": "admin", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z", | |
| "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", | |
| "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" | |
| } |
GET/user_management /invitations /by_token /:tokenParameters Returns Get a list of all of invitations matching the criteria specified.
curl "https://api.workos.com/user_management/invitations" \ --header "Authorization: Bearer sk_example_123456789"
{ "object": "list", "data": [ { "object": "invitation", "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", "email": "marcelina.davis@example.com", "state": "pending", "accepted_at": null, "revoked_at": null, "expires_at": "2026-01-15T12:00:00.000Z", "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", "accepted_user_id": null, "role_slug": "admin", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" } ], "list_metadata": { "before": "invitation_01HXYZ123456789ABCDEFGHIJ", "after": "invitation_01HXYZ987654321KJIHGFEDCBA" } }
| curl "https://api.workos.com/user_management/invitations" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const invitation = await workos.userManagement.listInvitations({ | |
| organizationId: 'org_123456789', | |
| }); | |
| console.log(invitation.data); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.list_invitations |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.list_invitations() |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().ListInvitations(context.Background()) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos->userManagement()->listInvitations(); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.userManagement.listInvitations(); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.ListInvitationsAsync(); |
| 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 | |
| .user_management() | |
| .list_invitations() | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "list", | |
| "data": [ | |
| { | |
| "object": "invitation", | |
| "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", | |
| "email": "marcelina.davis@example.com", | |
| "state": "pending", | |
| "accepted_at": null, | |
| "revoked_at": null, | |
| "expires_at": "2026-01-15T12:00:00.000Z", | |
| "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", | |
| "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", | |
| "accepted_user_id": null, | |
| "role_slug": "admin", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z", | |
| "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", | |
| "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" | |
| } | |
| ], | |
| "list_metadata": { | |
| "before": "invitation_01HXYZ123456789ABCDEFGHIJ", | |
| "after": "invitation_01HXYZ987654321KJIHGFEDCBA" | |
| } | |
| } |
GET/user_management /invitationsParameters Returns objectSends an invitation email to the recipient.
curl --request POST \ --url "https://api.workos.com/user_management/invitations" \ --header "Authorization: Bearer sk_example_123456789" \ --header "Content-Type: application/json" \ -d @- <<'BODY' { "email": "marcelina.davis@example.com" } BODY
{ "object": "invitation", "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", "email": "marcelina.davis@example.com", "state": "pending", "accepted_at": null, "revoked_at": null, "expires_at": "2026-01-15T12:00:00.000Z", "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", "accepted_user_id": null, "role_slug": "admin", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" }
| curl --request POST \ | |
| --url "https://api.workos.com/user_management/invitations" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "email": "marcelina.davis@example.com" | |
| } | |
| BODY |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const invitation = await workos.userManagement.sendInvitation({ | |
| email: 'marcelina@example.com', | |
| }); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.send_invitation(email: "marcelina.davis@example.com") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.send_invitation(email="marcelina.davis@example.com") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().SendInvitation(context.Background(), &workos.UserManagementSendInvitationParams{ | |
| Email: "marcelina.davis@example.com", | |
| }) | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos->userManagement()->sendInvitation(email: "marcelina.davis@example.com"); |
| import com.workos.WorkOS; | |
| import com.workos.usermanagement.UserManagementApi.SendInvitationOptions; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| SendInvitationOptions options = | |
| SendInvitationOptions.builder().email("marcelina.davis@example.com").build(); | |
| workos.userManagement.sendInvitation(options); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.SendInvitationAsync(new UserManagementSendInvitationOptions { | |
| Email = "marcelina.davis@example.com", | |
| }); |
| use workos::Client; | |
| use workos::user_management::SendInvitationParams; | |
| #[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 | |
| .user_management() | |
| .send_invitation( | |
| SendInvitationParams { | |
| email: "marcelina.davis@example.com".into(), | |
| ..Default::default() | |
| } | |
| ) | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "invitation", | |
| "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", | |
| "email": "marcelina.davis@example.com", | |
| "state": "pending", | |
| "accepted_at": null, | |
| "revoked_at": null, | |
| "expires_at": "2026-01-15T12:00:00.000Z", | |
| "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", | |
| "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", | |
| "accepted_user_id": null, | |
| "role_slug": "admin", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z", | |
| "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", | |
| "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" | |
| } |
POST/user_management /invitationsReturns Resends an invitation email to the recipient. The invitation must be in a pending state.
curl --request POST \ --url "https://api.workos.com/user_management/invitations/invitation_01E4ZCR3C56J083X43JQXF3JK5/resend" \ --header "Authorization: Bearer sk_example_123456789" \
{ "object": "invitation", "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", "email": "marcelina.davis@example.com", "state": "pending", "accepted_at": null, "revoked_at": null, "expires_at": "2026-01-15T12:00:00.000Z", "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", "accepted_user_id": null, "role_slug": "admin", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" }
| curl --request POST \ | |
| --url "https://api.workos.com/user_management/invitations/invitation_01E4ZCR3C56J083X43JQXF3JK5/resend" \ | |
| --header "Authorization: Bearer sk_example_123456789" \ |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const invitation = await workos.userManagement.resendInvitation( | |
| 'invitation_01E4ZCR3C56J083X43JQXF3JK5', | |
| ); | |
| console.log(invitation.data); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.resend_invitation(id: "invitation_01E4ZCR3C56J083X43JQXF3JK5") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.resend_invitation(id_="invitation_01E4ZCR3C56J083X43JQXF3JK5") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().ResendInvitation(context.Background(), "invitation_01E4ZCR3C56J083X43JQXF3JK5") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->userManagement() | |
| ->resendInvitation(id: "invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.userManagement.resendInvitation("invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.ResendInvitationAsync("invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| 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 | |
| .user_management() | |
| .resend_invitation("invitation_01E4ZCR3C56J083X43JQXF3JK5") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "invitation", | |
| "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", | |
| "email": "marcelina.davis@example.com", | |
| "state": "pending", | |
| "accepted_at": null, | |
| "revoked_at": null, | |
| "expires_at": "2026-01-15T12:00:00.000Z", | |
| "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", | |
| "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", | |
| "accepted_user_id": null, | |
| "role_slug": "admin", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z", | |
| "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", | |
| "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" | |
| } |
POST/user_management /invitations /:id /resendParameters Returns Accepts an invitation and, if linked to an organization, activates the user’s membership in that organization.
In most cases, use existing authentication methods like authenticateWithCode, which also accept an invitation token. These methods offer the same functionality (invitation acceptance and membership activation) while also signing the user in.
This method is useful for apps requiring a highly customized invitation flow, as it focuses solely on handling invitations without authentication. It’s also helpful when users can be invited to multiple organizations and need a way to accept invitations after signing in.
Your application should verify that the invitation is intended for the user accepting it. For example, by fetching the invitation using the find-by-token endpoint and ensuring the email matches the email address of the accepting user.
curl --request POST \ --url "https://api.workos.com/user_management/invitations/invitation_01E4ZCR3C56J083X43JQXF3JK5/accept" \ --header "Authorization: Bearer sk_example_123456789"
{ "object": "invitation", "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", "email": "marcelina.davis@example.com", "state": "accepted", "accepted_at": "2026-01-15T12:00:00.000Z", "revoked_at": null, "expires_at": "2026-01-15T12:00:00.000Z", "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", "accepted_user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", "role_slug": "admin", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" }
| curl --request POST \ | |
| --url "https://api.workos.com/user_management/invitations/invitation_01E4ZCR3C56J083X43JQXF3JK5/accept" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789', { | |
| clientId: 'client_123456789', | |
| }); | |
| const invitation = await workos.userManagement.acceptInvitation( | |
| 'invitation_01E4ZCR3C56J083X43JQXF3JK5', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.accept_invitation(id: "invitation_01E4ZCR3C56J083X43JQXF3JK5") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.accept_invitation(id_="invitation_01E4ZCR3C56J083X43JQXF3JK5") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().AcceptInvitation(context.Background(), "invitation_01E4ZCR3C56J083X43JQXF3JK5") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->userManagement() | |
| ->acceptInvitation(id: "invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.userManagement.acceptInvitation("invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.AcceptInvitationAsync("invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| 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 | |
| .user_management() | |
| .accept_invitation("invitation_01E4ZCR3C56J083X43JQXF3JK5") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "invitation", | |
| "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", | |
| "email": "marcelina.davis@example.com", | |
| "state": "accepted", | |
| "accepted_at": "2026-01-15T12:00:00.000Z", | |
| "revoked_at": null, | |
| "expires_at": "2026-01-15T12:00:00.000Z", | |
| "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", | |
| "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", | |
| "accepted_user_id": "user_01E4ZCR3C56J083X43JQXF3JK5", | |
| "role_slug": "admin", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z", | |
| "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", | |
| "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" | |
| } |
POST/user_management /invitations /:id /acceptParameters Returns Revokes an existing invitation.
curl --request POST \ --url "https://api.workos.com/user_management/invitations/invitation_01E4ZCR3C56J083X43JQXF3JK5/revoke" \ --header "Authorization: Bearer sk_example_123456789"
{ "object": "invitation", "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", "email": "marcelina.davis@example.com", "state": "revoked", "accepted_at": null, "revoked_at": "2026-01-15T12:00:00.000Z", "expires_at": "2026-01-15T12:00:00.000Z", "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", "accepted_user_id": null, "role_slug": "admin", "created_at": "2026-01-15T12:00:00.000Z", "updated_at": "2026-01-15T12:00:00.000Z", "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" }
| curl --request POST \ | |
| --url "https://api.workos.com/user_management/invitations/invitation_01E4ZCR3C56J083X43JQXF3JK5/revoke" \ | |
| --header "Authorization: Bearer sk_example_123456789" |
| import { WorkOS } from '@workos-inc/node'; | |
| const workos = new WorkOS('sk_example_123456789'); | |
| const invitation = await workos.userManagement.revokeInvitation( | |
| 'invitation_01E4ZCR3C56J083X43JQXF3JK5', | |
| ); |
| require "workos" | |
| WorkOS.configure do |config| | |
| config.api_key = "sk_example_123456789" | |
| end | |
| WorkOS.client.user_management.revoke_invitation(id: "invitation_01E4ZCR3C56J083X43JQXF3JK5") |
| from workos import WorkOSClient | |
| client = WorkOSClient(api_key="sk_example_123456789", client_id="client_123456789") | |
| client.user_management.revoke_invitation(id_="invitation_01E4ZCR3C56J083X43JQXF3JK5") |
| package main | |
| import ( | |
| "context" | |
| "github.com/workos/workos-go/v9" | |
| ) | |
| func main() { | |
| client := workos.NewClient("sk_example_123456789") | |
| _, err := client.UserManagement().RevokeInvitation(context.Background(), "invitation_01E4ZCR3C56J083X43JQXF3JK5") | |
| if err != nil { | |
| panic(err) | |
| } | |
| } |
| <?php | |
| use WorkOS\WorkOS; | |
| $workos = new WorkOS( | |
| apiKey: "sk_example_123456789", | |
| clientId: "client_123456789", | |
| ); | |
| $workos | |
| ->userManagement() | |
| ->revokeInvitation(id: "invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| import com.workos.WorkOS; | |
| WorkOS workos = new WorkOS("sk_example_123456789"); | |
| workos.userManagement.revokeInvitation("invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| using WorkOS; | |
| var client = new WorkOSClient(new WorkOSOptions { | |
| ApiKey = "sk_example_123456789", | |
| ClientId = "client_123456789", | |
| }); | |
| await client.UserManagement.RevokeInvitationAsync("invitation_01E4ZCR3C56J083X43JQXF3JK5"); |
| 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 | |
| .user_management() | |
| .revoke_invitation("invitation_01E4ZCR3C56J083X43JQXF3JK5") | |
| .await?; | |
| Ok(()) | |
| } |
| { | |
| "object": "invitation", | |
| "id": "invitation_01E4ZCR3C56J083X43JQXF3JK5", | |
| "email": "marcelina.davis@example.com", | |
| "state": "revoked", | |
| "accepted_at": null, | |
| "revoked_at": "2026-01-15T12:00:00.000Z", | |
| "expires_at": "2026-01-15T12:00:00.000Z", | |
| "organization_id": "org_01E4ZCR3C56J083X43JQXF3JK5", | |
| "inviter_user_id": "user_01HYGBX8ZGD19949T3BM4FW1C3", | |
| "accepted_user_id": null, | |
| "role_slug": "admin", | |
| "created_at": "2026-01-15T12:00:00.000Z", | |
| "updated_at": "2026-01-15T12:00:00.000Z", | |
| "token": "Z1uX3RbwcIl5fIGJJJCXXisdI", | |
| "accept_invitation_url": "https://your-app.com/invite?invitation_token=Z1uX3RbwcIl5fIGJJJCXXisdI" | |
| } |
POST/user_management /invitations /:id /revokeParameters Returns