Organization › Workspaces › Members
List Workspace Members
GET /v1/organizations/workspaces/\{workspace_id\}/members
List Workspace Members
Path parameters
workspace_id: stringID of the Workspace.
Query parameters
after_id: optional stringID of the object to use as a cursor for pagination. When provided, returns the page of results immediately after this object.
before_id: optional stringID of the object to use as a cursor for pagination. When provided, returns the page of results immediately before this object.
limit: optional numberNumber of items to return per page.
Defaults to
20. Ranges from1to1000.default: 20, maximum: 1000, minimum: 1
Returns
data: array of BetaWorkspaceMembertype: "workspace_member"Object type.
For Workspace Members, this is always
"workspace_member".default: workspace_member
user_id: stringID of the User.
workspace_id: stringID of the Workspace.
workspace_role: BetaWorkspaceRoleRole of the Workspace Member.
"workspace_admin""workspace_billing""workspace_developer""workspace_restricted_developer""workspace_user"
first_id: string or nullFirst ID in the
datalist. Can be used as thebefore_idfor the previous page.has_more: booleanIndicates if there are more results in the requested page direction.
last_id: string or nullLast ID in the
datalist. Can be used as theafter_idfor the next page.
Example
curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/members \
-H 'anthropic-version: 2023-06-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"Response (200)
{
"data": [
{
"type": "workspace_member",
"user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
"workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
"workspace_role": "workspace_admin"
}
],
"first_id": "first_id",
"has_more": true,
"last_id": "last_id"
}Create Workspace Member
POST /v1/organizations/workspaces/\{workspace_id\}/members
Create Workspace Member
Path parameters
workspace_id: stringID of the Workspace.
Body parameters
user_id: stringID of the User.
workspace_role: BetaNoBillingWorkspaceRoleRole of the new Workspace Member. Cannot be
workspace_billing."workspace_admin""workspace_developer""workspace_restricted_developer""workspace_user"
Returns
BetaWorkspaceMember objecttype: "workspace_member"Object type.
For Workspace Members, this is always
"workspace_member".default: workspace_member
user_id: stringID of the User.
workspace_id: stringID of the Workspace.
workspace_role: BetaWorkspaceRoleRole of the Workspace Member.
"workspace_admin""workspace_billing""workspace_developer""workspace_restricted_developer""workspace_user"
Example
curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/members \
-H 'Content-Type: application/json' \
-H 'anthropic-version: 2023-06-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY" \
-d '{
"user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
"workspace_role": "workspace_admin"
}'Response (200)
{
"type": "workspace_member",
"user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
"workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
"workspace_role": "workspace_admin"
}Get Workspace Member
GET /v1/organizations/workspaces/\{workspace_id\}/members/\{user_id\}
Get Workspace Member
Path parameters
workspace_id: stringID of the Workspace.
user_id: stringID of the User.
Returns
BetaWorkspaceMember objecttype: "workspace_member"Object type.
For Workspace Members, this is always
"workspace_member".default: workspace_member
user_id: stringID of the User.
workspace_id: stringID of the Workspace.
workspace_role: BetaWorkspaceRoleRole of the Workspace Member.
"workspace_admin""workspace_billing""workspace_developer""workspace_restricted_developer""workspace_user"
Example
curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/members/$USER_ID \
-H 'anthropic-version: 2023-06-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"Response (200)
{
"type": "workspace_member",
"user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
"workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
"workspace_role": "workspace_admin"
}Update Workspace Member
POST /v1/organizations/workspaces/\{workspace_id\}/members/\{user_id\}
Update Workspace Member
Path parameters
workspace_id: stringID of the Workspace.
user_id: stringID of the User.
Body parameters
workspace_role: BetaWorkspaceRoleNew workspace role for the User.
"workspace_admin""workspace_billing""workspace_developer""workspace_restricted_developer""workspace_user"
Returns
BetaWorkspaceMember objecttype: "workspace_member"Object type.
For Workspace Members, this is always
"workspace_member".default: workspace_member
user_id: stringID of the User.
workspace_id: stringID of the Workspace.
workspace_role: BetaWorkspaceRoleRole of the Workspace Member.
"workspace_admin""workspace_billing""workspace_developer""workspace_restricted_developer""workspace_user"
Example
curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/members/$USER_ID \
-H 'Content-Type: application/json' \
-H 'anthropic-version: 2023-06-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY" \
-d '{
"workspace_role": "workspace_admin"
}'Response (200)
{
"type": "workspace_member",
"user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
"workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
"workspace_role": "workspace_admin"
}Delete Workspace Member
DELETE /v1/organizations/workspaces/\{workspace_id\}/members/\{user_id\}
Delete Workspace Member
Path parameters
workspace_id: stringID of the Workspace.
user_id: stringID of the User.
Returns
type: "workspace_member_deleted"Deleted object type.
For Workspace Members, this is always
"workspace_member_deleted".default: workspace_member_deleted
user_id: stringID of the User.
workspace_id: stringID of the Workspace.
Example
curl https://api.anthropic.com/v1/organizations/workspaces/$WORKSPACE_ID/members/$USER_ID \
-X DELETE \
-H 'anthropic-version: 2023-06-01' \
-H "X-Api-Key: $ANTHROPIC_API_KEY"Response (200)
{
"type": "workspace_member_deleted",
"user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
"workspace_id": "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
}