---
title: "Organizations, workspaces, and access API"
description: "Manage organizations, workspaces, members, invitations, and API keys while signed in."
canonical_url: "https://docs.flashdrive.space/reference/access-api"
---
# Organizations, workspaces, and access API

> Manage organizations, workspaces, members, invitations, and API keys while signed in.

These routes require a signed-in user's access token, not a workspace API key. What the user can do depends on their role. To manage access without writing requests, sign in to the [Console](https://app.flashdrive.space). See [members and roles](https://docs.flashdrive.space/platform/members-and-roles) and [API keys](https://docs.flashdrive.space/platform/api-keys) for the workflows.

See [authentication](https://docs.flashdrive.space/reference/authentication) for request headers and response formats, and [errors and recovery](https://docs.flashdrive.space/reference/errors) for failed requests.

## Roles

Organizations have the roles `owner`, `admin` and `member`. Workspaces have the roles `admin`, `editor` and `viewer`. Organization owners and admins have admin access to every workspace in the organization.

<table>
<thead>
  <tr>
    <th>
      Action
    </th>
    
    <th>
      Required role
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      Create workspaces, rename the organization
    </td>
    
    <td>
      Organization owner or admin
    </td>
  </tr>
  
  <tr>
    <td>
      Promote or demote organization owners and admins
    </td>
    
    <td>
      Organization owner; the organization keeps at least one owner (<code>
        last_owner
      </code>
      
      )
    </td>
  </tr>
  
  <tr>
    <td>
      Remove ordinary organization members
    </td>
    
    <td>
      Organization owner or admin
    </td>
  </tr>
  
  <tr>
    <td>
      Invite an ordinary member; list, read, revoke or resend a member invitation
    </td>
    
    <td>
      Organization owner or admin
    </td>
  </tr>
  
  <tr>
    <td>
      Invite an admin; revoke or resend an admin invitation
    </td>
    
    <td>
      Organization owner
    </td>
  </tr>
  
  <tr>
    <td>
      Rename a workspace; manage its members and API keys
    </td>
    
    <td>
      Workspace admin, including inherited organization owner and admin access
    </td>
  </tr>
  
  <tr>
    <td>
      Leave an organization
    </td>
    
    <td>
      The member, unless they are its last owner
    </td>
  </tr>
</tbody>
</table>

List entries that have a `version` carry an `etag` field. A single object returns its entity tag in the `ETag` response header. Send that value in `If-Match` when you change or delete the object.

## Account

### POST `/v1/account/bootstrap`

Set up the account once, after the user has signed in and verified their email address. Requires `Idempotency-Key`.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Presence
    </th>
    
    <th>
      Guidance
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        skip_invitation
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      Optional
    </td>
    
    <td>
      Set up a new organization even though an invitation is waiting for this address. Without it, a waiting invitation makes the request fail with <code>
        invitation_unavailable
      </code>
      
      : accept the invitation instead.
    </td>
  </tr>
</tbody>
</table>

**200**: `provisioned` (`true`), `organization_id` and `workspace_id` (UUIDs, or null).

### GET `/v1/me`

Read the signed-in user's identity and setup state.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        user_id
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      UUID.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        email
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      The verified email address.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        active
      </code>
      
      , <code>
        disabled
      </code>
      
      , <code>
        unprovisioned
      </code>
    </td>
    
    <td>
      Account state.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        provisioned
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      Whether the account is set up.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        invitation_pending
      </code>
    </td>
    
    <td>
      boolean
    </td>
    
    <td>
      Whether an invitation is waiting for this address.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        compatibility.cli
      </code>
    </td>
    
    <td>
      object
    </td>
    
    <td>
      <code>
        api_major
      </code>
      
      , <code>
        minimum_cli_version
      </code>
      
      , <code>
        latest_stable_cli_version
      </code>
      
       (or null) and <code>
        notices
      </code>
      
       (each with <code>
        id
      </code>
      
      , <code>
        severity
      </code>
      
       of <code>
        upgrade
      </code>
      
       or <code>
        deprecation
      </code>
      
      , <code>
        message
      </code>
      
      , and optional <code>
        effective_date
      </code>
      
       and <code>
        documentation_url
      </code>
      
      ).
    </td>
  </tr>
</tbody>
</table>

## Organizations

### GET `/v1/organizations`

List the organizations you belong to. Query: `limit` (1 to 100, default 50), `cursor`.

**200**: `data` and `next_cursor`. Each organization has:

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      UUID.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        version
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Positive decimal version.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        created_at
      </code>
      
      , <code>
        updated_at
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      ISO 8601 date-times.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      1 to 120 characters.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        status
      </code>
    </td>
    
    <td>
      <code>
        active
      </code>
      
      , <code>
        suspended
      </code>
    </td>
    
    <td>
      Organization state.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        created_by
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      UUID of the user who created it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        bootstrap_user_id
      </code>
    </td>
    
    <td>
      string or null
    </td>
    
    <td>
      UUID of the user whose account setup created it.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        role
      </code>
    </td>
    
    <td>
      <code>
        owner
      </code>
      
      , <code>
        admin
      </code>
      
      , <code>
        member
      </code>
    </td>
    
    <td>
      Your role.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        etag
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Send in <code>
        If-Match
      </code>
      
       to change it.
    </td>
  </tr>
</tbody>
</table>

### GET `/v1/organizations/{organization_id}`

Read one organization. **200**: the organization fields above, with its `ETag` header.

### PATCH `/v1/organizations/{organization_id}`

Rename the organization. Requires `If-Match`. Body: `name` (required, 1 to 120 characters). **200**: the updated organization.

## Organization members

### GET `/v1/organizations/{organization_id}/members`

List members. Query: `limit`, `cursor`. Each entry has `user_id`, `display_name` (or null), `email` (or null), `role`, `version`, `created_at` and `etag`.

### PATCH `/v1/organizations/{organization_id}/members/{user_id}`

Change a member's organization role. Requires `If-Match`. Body: `role` (required): `owner`, `admin` or `member`. **200**: the updated membership. Demoting the last owner returns 409 `last_owner`.

### DELETE `/v1/organizations/{organization_id}/members/{user_id}`

Remove a member, or leave the organization with your own user ID. Requires `If-Match`. **204** with no body.

## Workspaces

A workspace has a `kind`: `org_wide` is the organization's workspace that every member joins (its default drive is the team drive), and `team` is a workspace for chosen members.

### GET `/v1/organizations/{organization_id}/workspaces`

List the workspaces you can see. Query: `limit`, `cursor`. Each entry has:

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Meaning
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        id
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      UUID.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        version
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Positive decimal version.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        created_at
      </code>
      
      , <code>
        updated_at
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      ISO 8601 date-times.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        organization_id
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      UUID.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      1 to 120 characters.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        role
      </code>
    </td>
    
    <td>
      <code>
        admin
      </code>
      
      , <code>
        editor
      </code>
      
      , <code>
        viewer
      </code>
    </td>
    
    <td>
      Your effective role.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        kind
      </code>
    </td>
    
    <td>
      <code>
        org_wide
      </code>
      
      , <code>
        team
      </code>
    </td>
    
    <td>
      See above.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        etag
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Send in <code>
        If-Match
      </code>
      
       to change it.
    </td>
  </tr>
</tbody>
</table>

### POST `/v1/organizations/{organization_id}/workspaces`

Create a workspace. Requires `Idempotency-Key`. Body: `name` (required, 1 to 120 characters). **201**: the new workspace. An organization can have a limited number of team workspaces (the `policy.workspace_limit` reported by [workspace storage](https://docs.flashdrive.space/platform/storage-and-upgrades)); past it, the request returns 409 `workspace_limit_reached`.

### GET `/v1/workspaces/{workspace_id}`

Read a workspace and your effective role. **200**: the workspace fields above, with its `ETag` header.

### PATCH `/v1/workspaces/{workspace_id}`

Rename a workspace. Requires `If-Match`. Body: `name` (required, 1 to 120 characters). **200**: the updated workspace.

## Workspace members

### GET `/v1/workspaces/{workspace_id}/members`

List members assigned directly to this workspace. Query: `limit`, `cursor`. Each entry has `user_id`, `display_name`, `email`, `role` (`admin`, `editor` or `viewer`), `version`, `created_at` and `etag`.

### GET `/v1/workspaces/{workspace_id}/inherited-members`

List the organization owners and admins who have admin access to this workspace through their organization role. Query: `limit`, `cursor`. Same entry fields as above.

### POST `/v1/workspaces/{workspace_id}/members`

Add an existing organization member. Requires `Idempotency-Key`.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Presence
    </th>
    
    <th>
      Guidance
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        user_id
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Required
    </td>
    
    <td>
      UUID of an organization member.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        role
      </code>
    </td>
    
    <td>
      <code>
        admin
      </code>
      
      , <code>
        editor
      </code>
      
      , <code>
        viewer
      </code>
    </td>
    
    <td>
      Required
    </td>
    
    <td>
      Workspace role.
    </td>
  </tr>
</tbody>
</table>

**201**: the new membership.

### PATCH `/v1/workspaces/{workspace_id}/members/{user_id}`

Change a member's workspace role. Requires `If-Match`. Body: `role` (required): `admin`, `editor` or `viewer`. **200**: the updated membership.

### DELETE `/v1/workspaces/{workspace_id}/members/{user_id}`

Remove a member's direct access to the workspace. Requires `If-Match`. **204** with no body.

## Invitations

An invitation expires 7 days after it is sent or resent. Past the invitation limits, the API returns 429 `invitation_rate_limit`.

`status` changes to `expired` only when the organization next invites the same address, so a `pending` invitation can already be past its `expires_at`. Check `expires_at` to tell whether it can still be accepted.

Invitation objects have `id`, `version`, `created_at`, `updated_at`, `organization_id`, `email`, `organization_role` (`admin` or `member`), `invited_by`, `status` (`pending`, `accepted`, `revoked` or `expired`), `expires_at`, `accepted_by` (or null), `accepted_at` (or null), `delivery_generation` (from 1), `delivery_status` (`queued`) and `etag`.

### GET `/v1/organizations/{organization_id}/invitations`

List invitations. Query: `limit`, `cursor`. Requires organization owner or admin.

### POST `/v1/organizations/{organization_id}/invitations`

Invite someone by email. Requires `Idempotency-Key`.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Presence
    </th>
    
    <th>
      Guidance
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        email
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Required
    </td>
    
    <td>
      At most 254 characters.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        organization_role
      </code>
    </td>
    
    <td>
      <code>
        admin
      </code>
      
      , <code>
        member
      </code>
    </td>
    
    <td>
      Optional
    </td>
    
    <td>
      Default <code>
        member
      </code>
      
      . Only owners can invite admins.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        workspaces
      </code>
    </td>
    
    <td>
      array
    </td>
    
    <td>
      Optional
    </td>
    
    <td>
      At most 100 entries, each with <code>
        workspace_id
      </code>
      
       and <code>
        role
      </code>
      
       (<code>
        admin
      </code>
      
      , <code>
        editor
      </code>
      
       or <code>
        viewer
      </code>
      
      ), applied when the invitation is accepted. More returns 400 <code>
        invalid_grants
      </code>
      
      ; a workspace listed twice returns 400 <code>
        duplicate_workspace
      </code>
      
      .
    </td>
  </tr>
</tbody>
</table>

**202**: the invitation. An address can have only one unexpired pending invitation per organization; inviting it again returns 409 `already_exists`, so resend the existing invitation instead.

### GET `/v1/organizations/{organization_id}/invitations/{invitation_id}`

Read one invitation. Requires organization owner or admin.

### DELETE `/v1/organizations/{organization_id}/invitations/{invitation_id}`

Revoke an unaccepted invitation. Requires `If-Match`. **204** with no body. An accepted invitation returns 409 `already_accepted`.

### POST `/v1/organizations/{organization_id}/invitations/{invitation_id}/resend`

Send a new invitation email. Its link replaces the earlier one. Requires `Idempotency-Key`; send `{}`. **202**: the invitation.

- Wait 60 seconds after the invitation was created or last resent; an earlier request returns 429 `resend_cooldown`.
- An accepted or revoked invitation returns 409 `invitation_unavailable`.
- Resends count toward the hourly invitation limits.

### POST `/v1/invitations/preview`

Preview an invitation as its recipient, signed in with the invited address and verified. Body: `token` (required), the 43-character token from the invitation link. No `Idempotency-Key` is needed.

**200**: `organization_id`, `organization_name`, `organization_role` and `workspaces` (each with `workspace_id` and `role`); or `organization_id` and `accepted: true` when you have already accepted it. An unknown token, a token for another address, or an invitation that cannot be used returns 404 `invitation_unavailable`. An expired invitation returns 410 `invitation_expired`.

### POST `/v1/invitations/accept`

Accept an invitation with the token from its link. Requires `Idempotency-Key`. Body: `token` (required). **200**: `organization_id` and `accepted: true`.

### GET `/v1/invitations/pending`

List invitations waiting for your verified address. **200**: `data`, each with `id`, `organization_id`, `organization_name`, `organization_role` and `workspaces`.

### POST `/v1/invitations/pending/{invitation_id}/accept`

Accept a waiting invitation by its ID, without its link. Requires `Idempotency-Key`; send `{}`. **200**: `organization_id` and `accepted: true`.

## API keys

A workspace API key has a `permission`: `search` allows reading drives, folders and files, and `read_write` also allows adding, changing and deleting them. The full key is shown only once, when it is created.

### GET `/v1/workspaces/{workspace_id}/api-keys`

List keys without their secrets. Query: `limit`, `cursor`. Each entry has `id`, `organization_id`, `workspace_id`, `name`, `display_prefix`, `permission`, `created_by`, `expires_at` (or null), `revoked_at` (or null) and `created_at`.

### POST `/v1/workspaces/{workspace_id}/api-keys`

Create a key. Requires `Idempotency-Key`.

<table>
<thead>
  <tr>
    <th>
      Field
    </th>
    
    <th>
      Type
    </th>
    
    <th>
      Presence
    </th>
    
    <th>
      Guidance
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <code>
        name
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Required
    </td>
    
    <td>
      1 to 120 characters.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        permission
      </code>
    </td>
    
    <td>
      <code>
        search
      </code>
      
      , <code>
        read_write
      </code>
    </td>
    
    <td>
      Required
    </td>
    
    <td>
      See above.
    </td>
  </tr>
  
  <tr>
    <td>
      <code>
        expires_at
      </code>
    </td>
    
    <td>
      string
    </td>
    
    <td>
      Optional
    </td>
    
    <td>
      A future ISO 8601 date-time; otherwise 400 <code>
        invalid_expiry
      </code>
      
      . Omit for a key that does not expire.
    </td>
  </tr>
</tbody>
</table>

**201**: the key's fields, plus `secret` (the full key, returned on the first successful creation only) and `secret_available`. A retry with the same idempotency key does not return the secret again; if you lose it, revoke the key and create another.

### DELETE `/v1/workspaces/{workspace_id}/api-keys/{key_id}`

Revoke a key at once. Repeating the request is safe. **204** with no body.


## Sitemap

See the full [sitemap](https://docs.flashdrive.space/sitemap.md) for all pages.
