Skip to main content

Users and Authentication

User management combines the CMS auth endpoints with Clerk user management and site membership management.

Endpoints

Auth

MethodPathPermissionDescription
GET/auth/meAnyGet current auth info (permission, site scope, memberships)
GET/auth/profileAnyGet full user profile (includes Clerk data for JWT users)
GET/auth/exportAnyExport all user data (GDPR data portability)
DELETE/auth/accountClerk JWTDelete the authenticated user's account

Clerk User Management

MethodPathPermissionDescription
GET/clerk/users?limit&offsetAdminList all Clerk users
GET/clerk/users/{id}AdminGet a Clerk user by ID
PUT/clerk/users/{id}/roleAdminUpdate a user's CMS role

Site Memberships

MethodPathPermissionDescription
GET/sites/{site_id}/membersAdminList site members
POST/sites/{site_id}/membersAdminAdd a member to a site
PUT/sites/{site_id}/members/{id}AdminUpdate a member's role
DELETE/sites/{site_id}/members/{id}AdminRemove a member from a site
POST/sites/{site_id}/members/transfer-ownershipOwnerTransfer site ownership

Auth Info

Quick check of your authentication state and permissions:

curl -H "X-API-Key: oy_live_abc123..." \
https://your-domain.com/api/v1/auth/me

Response 200 OK

{
"permission": "Write",
"site_id": "site-uuid",
"auth_method": "api_key",
"clerk_user_id": null,
"memberships": null,
"is_system_admin": null
}

User Profile

For Clerk-authenticated users, includes email, name, avatar URL, and sign-in timestamps:

curl -H "Authorization: Bearer eyJ..." \
https://your-domain.com/api/v1/auth/profile

Export User Data

Returns a comprehensive export of all data associated with the authenticated user, including profile, audit logs, API keys, change history, and site memberships. Designed for GDPR data portability compliance.

curl -H "Authorization: Bearer eyJ..." \
https://your-domain.com/api/v1/auth/export

Delete Account

Deletes the authenticated user's Clerk account and cleans up all CMS references. Blocked if the user is the sole owner of any site -- ownership must be transferred first.

curl -X DELETE \
-H "Authorization: Bearer eyJ..." \
https://your-domain.com/api/v1/auth/account

Response 204 No Content

Returns 409 Conflict if the user is the sole owner of a site.

Manage Clerk Users

List and manage Clerk users for member assignment. Requires Admin role on at least one site or system admin status.

curl -H "Authorization: Bearer eyJ..." \
"https://your-domain.com/api/v1/clerk/users?limit=20&offset=0"