Workspaces

Bulk add members to a workspace

Changed on

Add multiple organization members to a workspace. New members are assigned the workspace role that matches their organization role. Users who are already members of the workspace keep their current role and are not included in the response. Management key required.

post/workspaces/{id}/members/add

Request

  • Base URL
    https://openrouter.ai/api/v1
  • Auth
    HTTP bearer

Path parameters

id, string required

The workspace ID (UUID) or slug

Example:production

Request body

BulkAddWorkspaceMembersRequest required
user_ids, string[] required

List of user IDs to add to the workspace. New members are assigned the workspace role that matches their organization role; users already in the workspace keep their current role.

Example request

{
  "user_ids": [
    "user_abc123",
    "user_def456"
  ]
}

Response

Members added successfully

BulkAddWorkspaceMembersResponse required
added_count, integer required

Number of workspace memberships created

data, WorkspaceMember[] required

List of added workspace memberships

Example response

{
  "added_count": 1,
  "data": [
    {
      "created_at": "2025-08-24T10:30:00Z",
      "id": "660e8400-e29b-41d4-a716-446655440000",
      "role": "member",
      "user_id": "user_abc123",
      "workspace_id": "550e8400-e29b-41d4-a716-446655440000"
    }
  ]
}

Changes

    • warning

      added the new restricted_viewer enum value to the data/items/role response property for the response status

    • warning

      added the new viewer enum value to the data/items/role response property for the response status

    • info

      added the optional property openrouter_metadata to the response with the status

    4 more changes in this revision