Managing your organization's members programmatically allows you to automate onboarding, synchronize roles with your internal identity provider, and easily audit access. This guide covers the API endpoints available to invite, update, and remove members within your organization.
Member Lifecycle
Understanding the lifecycle of a user in your organization helps you know which endpoints to call and when.
stateDiagram-v2
[*] --> Pending : Invite User
Pending --> Active : User Accepts Invite
Active --> Active : Update Role / Doc Grants
Active --> [*] : Remove User
Pending --> [*] : Revoke InviteCommon Workflows
Here is a typical sequence for onboarding a new team member via the API.
- 1
Check existing members
Before inviting someone, you might want to check if they are already in the organization by retrieving the active users list using
GET /v1/organization/{organization_id}/user/active. - 2
Send an invitation
Use the
POST /v1/organization/{organization_id}/user/inviteendpoint to send an email invitation to the new user. They will appear in the pending invites list until they accept. - 3
Assign specific permissions
Once the user accepts and becomes active, you can adjust their access. For example, use
PATCH /v1/organization/{organization_id}/users/{user_id}/documentationsto grant them access to specific documentation resources.
Organization User Endpoints
Use the following endpoints to manage the users in your organization. Replace {organization_id} and {user_id} with the respective UUIDs in your system.
Inviting and Viewing Users
| Action | Method | Endpoint |
|---|---|---|
| Invite user | POST | /v1/organization/{organization_id}/user/invite |
| Get all users | GET | /v1/organization/{organization_id}/user |
| Get active users | GET | /v1/organization/{organization_id}/user/active |
| Get pending invites | GET | /v1/organization/{organization_id}/user/pending |
Example: Inviting a user
curl -X POST "https://api.example.com/v1/organization/org_123abc/user/invite"
-H "Authorization: Bearer YOUR_API_TOKEN"
-H "Content-Type: application/json"
-d '{"email": "new.hire@example.com", "role": "reader"}'Managing Personal Invitations
While organization admins manage invites from the organization side, individual users can view and accept invitations sent to them using these endpoints.
| Action | Method | Endpoint |
|---|---|---|
| List my pending invitations | GET | /v1/invitations |
| Accept my invitation | POST | /v1/invitations/{invitation_id}/accept |
Managing Roles and Access
As your team changes, you can programmatically elevate or restrict user privileges.
| Action | Method | Endpoint |
|---|---|---|
| Update user role | PATCH | /v1/organization/{organization_id}/user/{user_id}/role |
| Add/remove doc grants | PATCH | /v1/organization/{organization_id}/users/{user_id}/documentations |
Currently, specific documentation grants (PATCH .../documentations) can only be applied to users who hold the reader role. Admins automatically have access to all documentation.
Removing a User
| Action | Method | Endpoint |
|---|---|---|
| Remove user | DELETE | /v1/organization/{organization_id}/user/{user_id} |
Removing a user revokes their access immediately. If the user owns any personal API keys or specific resources, those may be invalidated. Ensure you reassign critical resources before deletion.
User Preferences Endpoints
In addition to organization-level management, the API provides endpoints for managing individual user preferences. These are typically accessed in the context of the currently authenticated user.
| Action | Method | Endpoint |
|---|---|---|
| List all preferences | GET | /preferences |
| Get a preference | GET | /preference |
| Set a preference | PUT | /preference |
| Delete a preference | DELETE | /preference |
Can I manage preferences for other users?
No. The /preference and /preferences endpoints operate on the currently authenticated user's context. Organization admins cannot read or modify the personal UI preferences of other members.
What happens to pending invites if they expire?
Pending invites typically expire after 7 days. If an invite expires, it will automatically be removed from the pending list, and you will need to issue a new POST request to re-invite the user.