API Reference: Users & Organizations Managing Organization Members via API

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.

Authentication Required

All endpoints in this guide require a valid API token with organization admin privileges. Attach your token as a Bearer token in the Authorization header.

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 Invite

Common Workflows

Here is a typical sequence for onboarding a new team member via the API.

  1. 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. 2

    Send an invitation

    Use the POST /v1/organization/{organization_id}/user/invite endpoint to send an email invitation to the new user. They will appear in the pending invites list until they accept.

  3. 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}/documentations to 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

ActionMethodEndpoint
Invite userPOST/v1/organization/{organization_id}/user/invite
Get all usersGET/v1/organization/{organization_id}/user
Get active usersGET/v1/organization/{organization_id}/user/active
Get pending invitesGET/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.

ActionMethodEndpoint
List my pending invitationsGET/v1/invitations
Accept my invitationPOST/v1/invitations/{invitation_id}/accept

Managing Roles and Access

As your team changes, you can programmatically elevate or restrict user privileges.

ActionMethodEndpoint
Update user rolePATCH/v1/organization/{organization_id}/user/{user_id}/role
Add/remove doc grantsPATCH/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

ActionMethodEndpoint
Remove userDELETE/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.

ActionMethodEndpoint
List all preferencesGET/preferences
Get a preferenceGET/preference
Set a preferencePUT/preference
Delete a preferenceDELETE/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.