On this page

Quotas let you cap how many sandboxes an individual end-user of your product can create and run. They are keyed by external_user_id - the same opaque identifier you pass when creating sandboxes on behalf of your users.

Base path: /api/v1/quotas/external/{external_user_id}


Endpoints

MethodPathDescription
GET/api/v1/quotas/external/{external_user_id}Get quota and current usage
PUT/api/v1/quotas/external/{external_user_id}Create or update a quota
DELETE/api/v1/quotas/external/{external_user_id}Remove quota (unlimited)

Get Quota

GET /api/v1/quotas/external/{external_user_id}

Returns the configured limits and live usage counters for the user.

Auth

Authorization: Bearer msk_...

Response - 200 OK

{
  "data": {
    "external_user_id": "user_clinic_42",
    "limits": {
      "max_sandboxes": 10,
      "max_concurrent": 3,
      "max_storage_gb": 50,
      "max_credit_cents": 5000
    },
    "usage": {
      "total_sandboxes": 4,
      "concurrent": 1
    }
  }
}
FieldTypeDescription
limits.max_sandboxesinteger|nullLifetime sandbox creation limit
limits.max_concurrentinteger|nullMax sandboxes running simultaneously
limits.max_storage_gbinteger|nullTotal attached storage cap in GiB
limits.max_credit_centsinteger|nullSpend cap in cents (platform credits)
usage.total_sandboxesintegerTotal sandboxes created by this user
usage.concurrentintegerCurrently running sandboxes

A null limit means no cap is applied for that dimension.


Set Quota

PUT /api/v1/quotas/external/{external_user_id}

Creates or replaces the quota. All limit fields are optional - omit a field to leave it uncapped.

Request Body

{
  "max_sandboxes": 10,
  "max_concurrent": 3,
  "max_storage_gb": 50,
  "max_credit_cents": 5000
}

Response - 200 OK

Same shape as GET response.


Delete Quota

DELETE /api/v1/quotas/external/{external_user_id}

Removes all limits for the user. Future sandbox creation is governed only by your tenant plan.

Response - 204 No Content


Errors

StatusCodeCause
404not_foundNo quota exists for this external_user_id (GET/DELETE)
422validation errorsA limit value is non-integer or negative

Examples

Was this helpful?