Skip to content
You're viewing documentation for v2026.11.9-beta. It may be out of date.Go to latest
TimescaleDB Enterprise
Esc
↑↓navigate↵open⌘Jpreview

Set a user's service role

The role on the service is the higher of the default role of the user and the grant. The change applies to the open sessions of the user at once.

PUT/api/v1/users/{id}/service-grants/{service_id}
Authorization
tse_sessionAPI key · cookierequired
Path parameters
idstringrequired
service_idstringrequired
Request body
requiredapplication/json
rolestring

viewer or operator

Responses
200

OK

created_atstring<date-time>required
created_bystringrequired

The admin who gave the grant, as the audit log shows it

rolestringrequired
Allowed:vieweroperator
service_idstringrequired
service_namestringrequired
default

Error

codestring

Stable code of the refusal, when the route has codes

detailsstring[]

Additional detail, e.g. per-field validation failures

errorstringrequired

Human-readable error message

Request
curl -X PUT 'https://console.example.com/api/v1/users/string/service-grants/string' \
  -H 'Cookie: tse_session=YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "role": "string"
}'
Response
{
  "created_at": "2019-08-24T14:15:22Z",
  "created_by": "string",
  "role": "viewer",
  "service_id": "string",
  "service_name": "string"
}