Set a tenant's limits
const url = 'https://example.com/v1/system/tenants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/limits';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"apiRequestsPerMinute":1,"webhookReceivesPerMinute":1,"runsAtOnce":1,"runsPending":1,"toolCallsInFlight":1,"approvalsPending":1,"projectsInProduction":1,"storageMiB":1,"flowsInProduction":1,"agentsInProduction":1}'};
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://example.com/v1/system/tenants/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/limits \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "apiRequestsPerMinute": 1, "webhookReceivesPerMinute": 1, "runsAtOnce": 1, "runsPending": 1, "toolCallsInFlight": 1, "approvalsPending": 1, "projectsInProduction": 1, "storageMiB": 1, "flowsInProduction": 1, "agentsInProduction": 1 }'Replaces the tenant’s limits with exactly these: a limit left out isn’t set, and isn’t enforced. Each is a whole number from 1 to 1000000. The tenant’s plan id isn’t a limit, and is left as it is. The tenant reads them on GET /v1/tenant. Takes system:tenants:limits. A closing tenant is frozen: 409 tenant-closing.
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 workspace’s limits that are set. A limit that isn’t set is absent, and isn’t enforced.
object
Examplegenerated
{ "apiRequestsPerMinute": 1, "webhookReceivesPerMinute": 1, "runsAtOnce": 1, "runsPending": 1, "toolCallsInFlight": 1, "approvalsPending": 1, "projectsInProduction": 1, "storageMiB": 1, "flowsInProduction": 1, "agentsInProduction": 1}Responses
Section titled “Responses”The tenant’s limits now.
object
Examplegenerated
{ "tenantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "limits": { "apiRequestsPerMinute": 1, "webhookReceivesPerMinute": 1, "runsAtOnce": 1, "runsPending": 1, "toolCallsInFlight": 1, "approvalsPending": 1, "projectsInProduction": 1, "storageMiB": 1, "flowsInProduction": 1, "agentsInProduction": 1 }, "inUse": { "projectsInProduction": 1, "storageUsedBytes": 1, "flowsInProduction": 1, "agentsInProduction": 1 }, "plan": "example"}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" }}A tenant’s key or session (system-principal-required), or a system key without system:tenants:limits (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" }}The tenant is closing (tenant-closing); 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 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.
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Headers
Section titled “Headers”See also
GET /v1/system/tenants/{tenantId}/limits: Read a tenant's limitsGET /v1/system/tenants: List tenantsPOST /v1/system/tenants: Create a tenantGET /v1/system/tenants/{tenantId}: Read a tenant- Plan limits
- Serve many tenants
- Organize work by org and project
- Error code
authz-backend-unavailable - 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 - Every error code