Replace a role's Chat capabilities in one context
const url = 'https://chat.centralcodestation.com/api/v1/tenants/example/admin/role-permissions/example';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"capabilities":["conversations.read","messages.read","messages.send","messages.update"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://chat.centralcodestation.com/api/v1/tenants/example/admin/role-permissions/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "capabilities": [ "conversations.read", "messages.read", "messages.send", "messages.update" ] }'Stored at the Identity Server. tenant_owner is locked (400).
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”An Identity Server role id.
The Identity Server tenant id.
Query Parameters
Section titled “Query Parameters”A chat-enabled tenant application; omit for the tenant-wide mapping.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The complete set of Chat capabilities the role grants in this context.
Example
{ "capabilities": [ "conversations.read", "messages.read", "messages.send", "messages.update" ]}Responses
Section titled “Responses”Success.
object
True for tenant_owner: holds every capability, not editable.
Example
{ "role_id": "role-coach", "role": "coach", "display_name": "Coach", "role_scope": "application", "system": false, "locked": false, "capabilities": [ "conversations.read", "messages.read", "messages.send", "messages.update" ]}Error. error is one of: invalid_request, role_locked.
object
Stable snake_case error code.
Example
{ "status_code": 400, "error": "invalid_request", "message": "The request is malformed: a required field is missing, a value has the wrong type or format, or a field the route does not accept was sent", "path": "/api/v1/tenants/fitness/applications/fitness-app/conversations", "timestamp": "2026-10-14T09:30:00.000Z"}Error. error is one of: invalid_token, token_revoked.
object
Stable snake_case error code.
Example
{ "status_code": 401, "error": "invalid_token", "message": "The bearer token is missing, malformed, expired, signed by an unknown key, has the wrong audience (`aud` must be `chat-api`), or lacks the required scope.", "path": "/api/v1/tenants/fitness/applications/fitness-app/conversations", "timestamp": "2026-10-14T09:30:00.000Z"}Error. error is one of: not_tenant_member, no_application_access, tenant_not_available, insufficient_scope, client_context_mismatch, missing_capability, principal_not_allowed.
object
Stable snake_case error code.
Example
{ "status_code": 403, "error": "not_tenant_member", "message": "The user is not an active member of the tenant in the URL.", "path": "/api/v1/tenants/fitness/applications/fitness-app/conversations", "timestamp": "2026-10-14T09:30:00.000Z"}Error. error is one of: not_found, role_not_found.
object
Stable snake_case error code.
Example
{ "status_code": 404, "error": "not_found", "message": "The resource does not exist, or belongs to another tenant or application", "path": "/api/v1/tenants/fitness/applications/fitness-app/conversations", "timestamp": "2026-10-14T09:30:00.000Z"}Error. error is one of: rate_limited.
object
Stable snake_case error code.
Example
{ "status_code": 429, "error": "rate_limited", "message": "The caller exceeded a rate limit", "path": "/api/v1/tenants/fitness/applications/fitness-app/conversations", "timestamp": "2026-10-14T09:30:00.000Z"}Error. error is one of: identity_unavailable.
object
Stable snake_case error code.
Example
{ "status_code": 503, "error": "identity_unavailable", "message": "Chat could not reach the Identity Server and has no fresh cached answer.", "path": "/api/v1/tenants/fitness/applications/fitness-app/conversations", "timestamp": "2026-10-14T09:30:00.000Z"}default
Section titled “default”Error — see error for the code.
object
Stable snake_case error code.
Example
{ "status_code": 403, "error": "invalid_request", "message": "Missing Chat capability messages.send", "path": "/api/v1/tenants/t1/applications/a1/conversations"}