Rename a tenant
const url = 'https://example.com/v1/system/tenants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","slug":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://example.com/v1/system/tenants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "slug": "example" }'Changes its name, its slug, or both, as the tenant’s own admins can (PATCH /v1/tenant); a field left out stays as it is. Its id stays. The same values again change nothing. Takes system:tenants. A closing tenant is refused (409 tenant-closing). A runtime whose tenant-hierarchy binding can’t rename tenants doesn’t serve this route.
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”A new name, a new slug, or both; a field left out stays as it is. The id stays, so whatever names the workspace by its id keeps working.
object
Examplegenerated
{ "name": "example", "slug": "example"}Responses
Section titled “Responses”Renamed, or already so. No body.
A malformed body or a field out of its rules (bad-input), or a field other than name and slug (unknown-field).
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" }}A tenant’s key or session (system-principal-required), or a system key without system:tenants (system-scope-missing).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}No tenant with that id, or a purged one (tenant-not-found).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Another tenant has the slug (tenant-slug-taken); the server’s verified sign-in domains name the tenant by its current slug, or name the new one (tenant-slug-in-config); the tenant is closing (tenant-closing); its setup hasn’t finished (tenant-setup-pending); or an Idempotency-Key reused with another body. 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" }}Server error (unmapped domain code or framework crash).
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}The operator’s access record can’t be written, so nothing was done (access-record-unavailable), or the Idempotency-Key store couldn’t be read before the request ran (idempotency-store-unavailable, with Retry-After). Or the authorization store couldn’t be reached (authz-backend-unavailable, with Retry-After), or the database was too busy for the authorization check (database-busy, with Retry-After), so the request wasn’t run.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/system/tenants/{tenantId}: Read a tenantGET /v1/system/tenants: List tenantsPOST /v1/system/tenants: Create a tenantPOST /v1/system/tenants/{tenantId}/close: Close a tenant- Kindgi 0.1.10
- Error code
access-record-unavailable - Error code
authz-backend-unavailable - Error code
bad-input - Error code
database-busy - Error code
idempotency-key-in-flight - Error code
idempotency-store-unavailable - Error code
request-too-large - Error code
system-principal-required - Error code
system-scope-missing - Error code
tenant-closing - Error code
tenant-not-found - Error code
tenant-setup-pending - Error code
tenant-slug-in-config - Error code
tenant-slug-taken - Error code
unknown-field - Every error code