Team Members

REST endpoints for team members. Bearer-auth required.

GET /api/team-members

List team members.

Query parameters

  • limit (optional): Page size (1–100, default 100).
  • after (optional): Keyset cursor — return the page after this row (next page).
  • before (optional): Keyset cursor — return the page before this row (prev page).
  • ids (optional): Comma-separated list of IDs. Narrows results to these IDs within the caller's accessible scope (does not bypass access checks).
  • filter (optional): Nested filter expression (<Entity>Filter): AND/OR/NOT + per-field comparison operators + relation traversal. JSON-encoded on the query string.
  • orderBy (optional): Multi-key sort (<Entity>OrderBy[]): array of { field: direction } applied in order. Directions: asc/desc plus the four explicit nulls variants. JSON-encoded on the query string.
  • team_id (optional): Optional team narrower. Admins see every team member when omitted; non-admin callers are scoped to teams they can access.
  • user_id (optional): Shorthand: filter where userId equals this value.
  • role (optional): Shorthand: filter where role equals this value.

Response

JSON
{
  "data": [
    {
      "id": "<...>",
      "teamId": "<...>",
      "userId": "<...>",
      "role": "<...>",
      "createdAt": "<...>"
    }
  ],
  "pageInfo": {
    "total": "number",
    "hasNextPage": "boolean",
    "hasPreviousPage": "boolean",
    "startCursor": "string",
    "endCursor": "string"
  }
}

POST /api/team-members

Add team member

Request body

JSON
{
  "teamId": "string",
  "userId": "string",
  "role?": "viewer | editor | admin"
}

Response

JSON
{
  "id": "string",
  "teamId": "string",
  "userId": "string",
  "role": "viewer | editor | admin",
  "createdAt": "string"
}

GET /api/team-members/{id}

Get a team member by ID.

Path parameters

  • id (required): Membership to retrieve.

Response

JSON
{
  "id": "string",
  "teamId": "string",
  "userId": "string",
  "role": "viewer | editor | admin",
  "createdAt": "string"
}

PATCH /api/team-members/{id}

Update team member role

Path parameters

  • id (required): The team member's prefixed ID.

Request body

JSON
{
  "role": "viewer | editor | admin"
}

Response

JSON
{
  "id": "string",
  "teamId": "string",
  "userId": "string",
  "role": "viewer | editor | admin",
  "createdAt": "string"
}

DELETE /api/team-members/{id}

Remove a team member.

Path parameters

  • id (required): Membership to remove.

Response

JSON
{
  "success": "boolean"
}