Give a tenant admin capabilities
const url = 'https://example.com/v1/identity/users/example/capabilities';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"capabilities":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/identity/users/example/capabilities \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "capabilities": [ "example" ] }'A tenant admin gives another tenant admin capabilities their own person holds now, such as env:write or signing-keys:write. What a key was minted with never counts, so a service account or a system key gives none. No person gives secrets:reveal or a system capability. Written before the call answers, so the person’s next request holds them. Tenant admins only.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Header Parameters
Section titled “Header Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”The capabilities to give: 1 to 32 names, counted as sent; a name sent twice is given once.
object
Examplegenerated
{ "capabilities": [ "example" ]}Responses
Section titled “Responses”The person’s grants, after, with the capabilities they hold.
What a person may do, as granted directly: tenant admin, a role on a project (its memberships), a role in a team, and the reviewer roster. What a team’s or an org’s grants imply is not expanded.
object
Example
{ "projects": [ { "role": "viewer" } ], "teams": [ { "role": "member" } ], "reviewer": { "role": "standard" }}Malformed request body.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Not a tenant admin; asked by a service account or a system key (caller-not-a-person); a capability no person gives (capability-not-givable); or one the caller’s own person doesn’t hold now (capability-not-held, naming the missing ones).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No user with that id under this workspace (identity-user-not-found).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The person was removed from the workspace (identity-user-unregistered), isn’t a tenant admin (receiver-not-tenant-admin: make them one first), or an idempotency conflict. Or idempotency-key-in-flight (with Retry-After): a request with the same Idempotency-Key still runs, so this one wasn’t run; send it again after Retry-After to get that request’s answer.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”The request body is over the API’s limit (request-too-large; details.maxBytes says how much).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The runtime has no authorization store (person-grants-unsupported), or doesn’t give capabilities (person-capabilities-unsupported).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The Idempotency-Key store (idempotency-store-unavailable) or the authorization store (authz-backend-unavailable) couldn’t be reached before the request ran, or the database was too busy for its authorization check (database-busy), so nothing was changed; Retry-After (whole seconds) says when to try again with the same key. Or tenant-state-unavailable (with Retry-After), on a runtime serving many workspaces: the workspace’s state couldn’t be read, so nothing was changed.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/identity/users: List users in the workspacePOST /v1/identity/users: Add a personGET /v1/identity/users/{userId}: Get a user by idGET /v1/identity/users/{userId}/sessions: List active sessions for a user- People, API keys and service accounts
- Error code
authz-backend-unavailable - Error code
caller-not-a-person - Error code
capability-not-givable - Error code
capability-not-held - Error code
database-busy - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
identity-user-not-found - Error code
identity-user-unregistered - Error code
person-capabilities-unsupported - Error code
person-grants-unsupported - Error code
rate-limit-exceeded - Error code
receiver-not-tenant-admin - Error code
request-too-large - Error code
tenant-state-unavailable - Every error code