# WorkOS

WorkOS: organizations, SSO connections, directory sync, users, audit logs. Exposes **40 actions** covering the API surface an agent needs - read and write.

## What it can do

| Method | What it does |
| --- | --- |
| `workos_organizations_list` | List organizations - GET /organizations. |
| `workos_organization_get` | Get one organization - GET /organizations/&#123;id&#125;. |
| `workos_organization_create` | Create an organization - POST /organizations. |
| `workos_organization_update` | Update an organization - PATCH /organizations/&#123;id&#125;. |
| `workos_organization_delete` | Delete an organization - DELETE /organizations/&#123;id&#125;. |
| `workos_connections_list` | List connections (SSO/OAuth providers) - GET /connections. |
| `workos_connection_get` | Get one connection - GET /connections/&#123;id&#125;. |
| `workos_connection_create` | Create a connection (SSO provider) - POST /connections. |
| `workos_connection_update` | Update a connection - PATCH /connections/&#123;id&#125;. |
| `workos_connection_delete` | Delete a connection - DELETE /connections/&#123;id&#125;. |
| `workos_connection_activate` | Activate a connection - POST /connections/&#123;id&#125;/activate. |
| `workos_connection_deactivate` | Deactivate a connection - POST /connections/&#123;id&#125;/deactivate. |
| `workos_directories_list` | List directories (SCIM/directory-sync sources) - GET /directories. |
| `workos_directory_get` | Get one directory - GET /directories/&#123;id&#125;. |
| `workos_directory_sync_users` | List synced users from a directory - GET /directories/&#123;id&#125;/users. |
| `workos_directory_sync_groups` | List synced groups from a directory - GET /directories/&#123;id&#125;/groups. |
| `workos_directory_user_get` | Get a synced directory user - GET /directories/&#123;directory_id&#125;/users/&#123;user_id&#125;. |
| `workos_directory_group_get` | Get a synced directory group - GET /directories/&#123;directory_id&#125;/groups/&#123;group_id&#125;. |
| `workos_users_list` | List users - GET /users. |
| `workos_user_get` | Get one user - GET /users/&#123;id&#125;. |
| `workos_user_create` | Create a user - POST /users. |
| `workos_user_update` | Update a user - PATCH /users/&#123;id&#125;. |
| `workos_user_delete` | Delete a user - DELETE /users/&#123;id&#125;. |
| `workos_user_invite` | Invite a user (send passwordless invitation) - POST /users/invites. |
| `workos_organization_memberships_list` | List organization memberships - GET /organization_memberships. |
| `workos_organization_membership_get` | Get one organization membership - GET /organization_memberships/&#123;id&#125;. |
| `workos_organization_membership_create` | Create an organization membership (add user to org) - POST /organization_memberships. |
| `workos_organization_membership_update` | Update an organization membership - PATCH /organization_memberships/&#123;id&#125;. |
| `workos_organization_membership_delete` | Delete an organization membership - DELETE /organization_memberships/&#123;id&#125;. |
| `workos_audit_logs_list` | List audit logs - GET /audit_logs. |
| `workos_events_list` | List events - GET /events. |
| `workos_event_get` | Get one event - GET /events/&#123;id&#125;. |
| `workos_mfa_enrollments_list` | List MFA enrollments for a user - GET /users/&#123;id&#125;/mfa_enrollments. |
| `workos_mfa_enrollment_get` | Get one MFA enrollment - GET /mfa_enrollments/&#123;id&#125;. |
| `workos_mfa_enrollment_create` | Create an MFA enrollment for a user - POST /users/&#123;id&#125;/mfa_enrollments. |
| `workos_mfa_enrollment_delete` | Delete an MFA enrollment - DELETE /mfa_enrollments/&#123;id&#125;. |
| `workos_mfa_verify` | Verify an MFA enrollment with code - POST /mfa_enrollments/&#123;id&#125;/verify. |
| `workos_portal_links_list` | List portal links - GET /portal_links. |
| `workos_portal_link_create` | Create a portal link - POST /portal_links. |
| `workos_portal_link_get` | Get one portal link - GET /portal_links/&#123;id&#125;. |

## How to get credentials

This connector uses an **API key / token**. Create one in the provider
dashboard, then paste it into FlyMyAI:

- **`WORKOS_API_KEY`** - WorkOS Dashboard - API Keys - Secret key (sk_...). (https://dashboard.workos.com/api-keys)

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `WORKOS_API_KEY` | WorkOS Dashboard - API Keys - Secret key (sk_...). |

## Troubleshooting

- **`401 Unauthorized` / `403 Forbidden`** - the token is wrong, expired, or missing a required scope; regenerate it.
- **`429 Too Many Requests`** - provider rate limit; retry after a short backoff.
- **Unexpected `4xx` on writes** - double-check required fields; the agent confirms before write actions.

## Links

- [WorkOS API documentation](https://workos.com/docs/reference)
