FileRelay
Documentation
Try our Sandbox

Members API

API endpoints for listing workspace members and pending invitations, inviting users, changing roles, removing members, and cancelling invitations.

Members API

The Members API manages who can access the current workspace. Every endpoint — reads included — requires the owner or admin role; writes additionally need the members:write token scope (reads need members:read).

List Members

Accepted members of the current workspace, owner included.

GET /api/{workspaceSlug}/members

Example Response

{
  "data": [
    {
      "id": "01h8x…",
      "type": "member",
      "attributes": {
        "user_id": "01h8x…",
        "name": "Adaeze Okonkwo",
        "email": "adaeze@company.com",
        "role": "owner",
        "joined_at": "2026-03-02T09:00:00+00:00"
      }
    },
    {
      "id": "01h9y…",
      "type": "member",
      "attributes": {
        "user_id": "01h9y…",
        "name": "Brian Smith",
        "email": "brian@company.com",
        "role": "member",
        "joined_at": "2026-04-11T14:22:00+00:00"
      }
    }
  ]
}

List Pending Invitations

Invitations that are still pending (unexpired) for the current workspace.

GET /api/{workspaceSlug}/members/invitations

Example Response

{
  "data": [
    {
      "id": "01haz…",
      "type": "invitation",
      "attributes": {
        "email": "chen@company.com",
        "role": "admin",
        "status": "pending",
        "expires_at": "2026-10-19T08:00:00+00:00",
        "accepted_at": null,
        "created_at": "2026-10-17T08:00:00+00:00"
      }
    }
  ]
}

Invite a Member

Creates a pending invitation and emails it to the address. Role is admin or member (default member).

POST /api/{workspaceSlug}/members/invitations
{
  "email": "chen@company.com",
  "role": "admin"
}

Rejects with 422 when the address belongs to the inviter, to an existing member, or to an already-pending invitation for this workspace. Returns 201 with the invitation resource.

Change a Member's Role

PATCH /api/{workspaceSlug}/members/{id}
{
  "role": "admin"
}

Role is admin or member. The workspace owner's role cannot be changed, and you cannot change your own role through this endpoint (prevents accidental self-lockout). Returns the updated member resource.

Remove a Member

DELETE /api/{workspaceSlug}/members/{id}

Detaches the user from the current workspace immediately. There is no confirmation step on this endpoint — the dashboard asks in an in-app dialog before it calls the equivalent session route. The workspace owner cannot be removed, and you cannot remove yourself — leaving a workspace is a dashboard action. Returns 204 with no body. Unknown users return 422; unknown ids return 404.

Assignable roles on PATCH are admin and member only. owner is derived from the workspace owner and cannot be set through the API.

Workspace Settings Integration

In addition to the public REST API (/api/{workspaceSlug}/members), Workspace Settings manages the same membership for one workspace. Owners and admins — including a pivot role of owner — can use these session routes. They are not a substitute for a scoped API token.

Method Path Purpose
GET /workspaces/{workspaceId}/members Members plus pending invitations for that workspace. can_manage is true when the caller is allowed to change membership.
POST /workspaces/{workspaceId}/members/lookup Check whether an email already has an account and a role in this workspace.
POST /workspaces/{workspaceId}/members Create an account or attach an existing one. Existing name and password are left unchanged.
PATCH /workspaces/{workspaceId}/members/{userId} Set admin or member. The owner cannot be changed.
DELETE /workspaces/{workspaceId}/members/{userId} Remove a non-owner from this workspace.
POST /workspaces/{workspaceId}/members/invitations Invite by email to this workspace only. Returns 404 when public registration is disabled.
DELETE /workspaces/{workspaceId}/members/invitations/{invitationId} Cancel a pending invitation that includes this workspace.

The public API invite, role change, remove, and cancel endpoints remain the integration path. Creating an account with a password is a dashboard action only — the public API does not accept passwords.

Cancel an Invitation

Only pending invitations can be cancelled; accepted, declined, and expired invitations are history and stay untouched. An invitation for a different workspace returns 422.

DELETE /api/{workspaceSlug}/members/invitations/{id}

Returns the cancelled invitation (status: expired).

Roles & Scopes

Endpoint Roles Token scope
List members / invitations owner, admin members:read
Invite, role change, remove, cancel owner, admin members:write

Members have no team visibility at all — the dashboard Team page and these endpoints return 403 for the member role.

Accepting and declining invitations stays in the dashboard invitation flow (email link) — it is not part of this API.