# Clerk

Clerk auth: users, organizations, sessions, invitations, JWT templates. Exposes **48 actions** covering the API surface an agent needs - read and write.

## What it can do

| Method | What it does |
| --- | --- |
| `clerk_users_list` | List all users - GET /users. |
| `clerk_user_get` | Get one user by ID - GET /users/&#123;id&#125;. |
| `clerk_user_create` | Create a new user - POST /users. |
| `clerk_user_update` | Update a user - PATCH /users/&#123;id&#125;. |
| `clerk_user_ban` | Ban a user (prevent login/API access) - POST /users/&#123;id&#125;/ban. |
| `clerk_user_unban` | Unban a user (restore access) - DELETE /users/&#123;id&#125;/ban. |
| `clerk_user_lock` | Lock a user account (disable) - POST /users/&#123;id&#125;/lock. |
| `clerk_user_unlock` | Unlock a user account (enable) - DELETE /users/&#123;id&#125;/lock. |
| `clerk_user_delete` | Delete a user - DELETE /users/&#123;id&#125;. |
| `clerk_organizations_list` | List organizations - GET /organizations. |
| `clerk_organization_get` | Get one organization - GET /organizations/&#123;id&#125;. |
| `clerk_organization_create` | Create an organization - POST /organizations. |
| `clerk_organization_update` | Update an organization - PATCH /organizations/&#123;id&#125;. |
| `clerk_organization_delete` | Delete an organization - DELETE /organizations/&#123;id&#125;. |
| `clerk_org_memberships_list` | List organization members - GET /organizations/&#123;organization_id&#125;/memberships. |
| `clerk_org_membership_get` | Get one organization member - GET /organizations/&#123;organization_id&#125;/memberships/&#123;user_id&#125;. |
| `clerk_org_membership_create` | Add a user to an organization - POST /organizations/&#123;organization_id&#125;/memberships. |
| `clerk_org_membership_update` | Update organization member role - PATCH /organizations/&#123;organization_id&#125;/memberships/&#123;user_id&#125;. |
| `clerk_org_membership_delete` | Remove a user from organization - DELETE /organizations/&#123;organization_id&#125;/memberships/&#123;user_id&#125;. |
| `clerk_org_invitations_list` | List organization invitations - GET /organizations/&#123;organization_id&#125;/invitations. |
| `clerk_org_invitation_create` | Create an organization invitation - POST /organizations/&#123;organization_id&#125;/invitations. |
| `clerk_org_invitation_revoke` | Revoke an organization invitation - DELETE /organizations/&#123;organization_id&#125;/invitations/&#123;invitation_id&#125;. |
| `clerk_sessions_list` | List sessions - GET /sessions. |
| `clerk_session_get` | Get one session - GET /sessions/&#123;id&#125;. |
| `clerk_session_revoke` | Revoke a session (force user logout) - POST /sessions/&#123;id&#125;/revoke. |
| `clerk_invitations_list` | List invitations - GET /invitations. |
| `clerk_invitation_create` | Create an invitation - POST /invitations. |
| `clerk_invitation_revoke` | Revoke an invitation - DELETE /invitations/&#123;id&#125;. |
| `clerk_allowlists_list` | List allowlisted identifiers - GET /allowlist_identifiers. |
| `clerk_allowlist_create` | Add to allowlist - POST /allowlist_identifiers. |
| `clerk_allowlist_delete` | Remove from allowlist - DELETE /allowlist_identifiers/&#123;id&#125;. |
| `clerk_blocklists_list` | List blocklisted identifiers - GET /blocklist_identifiers. |
| `clerk_blocklist_create` | Add to blocklist - POST /blocklist_identifiers. |
| `clerk_blocklist_delete` | Remove from blocklist - DELETE /blocklist_identifiers/&#123;id&#125;. |
| `clerk_jwt_templates_list` | List JWT templates - GET /jwt_templates. |
| `clerk_jwt_template_get` | Get one JWT template - GET /jwt_templates/&#123;id&#125;. |
| `clerk_jwt_template_create` | Create a JWT template - POST /jwt_templates. |
| `clerk_jwt_template_update` | Update a JWT template - PATCH /jwt_templates/&#123;id&#125;. |
| `clerk_jwt_template_delete` | Delete a JWT template - DELETE /jwt_templates/&#123;id&#125;. |
| `clerk_domains_list` | List custom domains - GET /domains. |
| `clerk_domain_get` | Get one domain - GET /domains/&#123;id&#125;. |
| `clerk_domain_create` | Create a custom domain - POST /domains. |
| `clerk_domain_delete` | Delete a custom domain - DELETE /domains/&#123;id&#125;. |
| `clerk_clients_list` | List OAuth clients - GET /oauth_applications. |
| `clerk_client_get` | Get one OAuth client - GET /oauth_applications/&#123;id&#125;. |
| `clerk_client_create` | Create an OAuth client - POST /oauth_applications. |
| `clerk_client_update` | Update an OAuth client - PATCH /oauth_applications/&#123;id&#125;. |
| `clerk_client_delete` | Delete an OAuth client - DELETE /oauth_applications/&#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:

- **`CLERK_SECRET_KEY`** - Clerk Dashboard - API Keys - Secret key (sk_...). (https://dashboard.clerk.com/)

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `CLERK_SECRET_KEY` | Clerk 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

- [Clerk API documentation](https://clerk.com/docs/reference/backend-api)
