On this page
team.set_role
Change a member's role
Request
PATCH /api/v1/team/members/{user_id}
- MCP:
team_set_role - SDK:
client.team.set_role(SDK path arguments usepath; MCP usesparams). - Minimum API key role: admin.
- Idempotency: natural.
Use the request schema below. Read IDs from earlier operation results.
Input schema
json
{
"parameters": [
{
"name": "user_id",
"in": "path",
"required": true,
"schema": {
"type": "string",
"format": "uuid"
}
}
],
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TeamSetRoleRequest"
}
}
}
}
}
Responses
json
{
"200": {
"description": "Change a member's role",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TeamSetRoleResponse200"
}
}
}
},
"4XX": {
"description": "Typed error (ApiError)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"5XX": {
"description": "Typed error (ApiError)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
Referenced schemas
json
{
"components": {
"schemas": {
"TeamSetRoleRequest": {
"type": "object",
"properties": {
"role": {
"type": "string",
"enum": [
"owner",
"admin",
"member",
"viewer"
]
},
"can_dial": {
"type": "boolean"
}
},
"additionalProperties": false
},
"TeamSetRoleResponse200": {
"type": "object",
"properties": {
"user_id": {
"type": "string",
"format": "uuid"
},
"email": {
"type": "string",
"pattern": "^(?!\\.)(?!.*\\.\\.)([a-zA-Z0-9_'+\\-\\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\\-]*\\.)+[a-zA-Z]{2,}$"
},
"name": {
"type": "string",
"maxLength": 256,
"nullable": true
},
"role": {
"type": "string",
"enum": [
"owner",
"admin",
"member",
"viewer"
]
},
"can_dial": {
"type": "boolean"
},
"joined_at": {
"type": "string",
"format": "date-time"
}
},
"required": [
"user_id",
"email",
"name",
"role",
"can_dial",
"joined_at"
],
"additionalProperties": false
},
"ApiError": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"unauthenticated",
"forbidden",
"not_found",
"conflict",
"invalid_request",
"idempotency_conflict",
"policy_denied",
"capability_unavailable",
"provider_unavailable",
"knowledge_unavailable",
"publication_invalid",
"run_not_active",
"rate_limited",
"outcome_unknown",
"internal"
]
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"outcome": {
"type": "string",
"enum": [
"none",
"unknown"
]
},
"details": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"code",
"message",
"retryable",
"outcome"
],
"additionalProperties": false
}
},
"required": [
"error"
],
"additionalProperties": false
}
}
}
}
Errors and recovery
See API error handling and Troubleshooting.
Related guides
Content version 3f4609afMarkdown source