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
| Method | Path | Description |
|---|---|---|
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
}
}
} | Field | Type | Description |
|---|---|---|
limits.max_sandboxes | integer|null | Lifetime sandbox creation limit |
limits.max_concurrent | integer|null | Max sandboxes running simultaneously |
limits.max_storage_gb | integer|null | Total attached storage cap in GiB |
limits.max_credit_cents | integer|null | Spend cap in cents (platform credits) |
usage.total_sandboxes | integer | Total sandboxes created by this user |
usage.concurrent | integer | Currently 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
| Status | Code | Cause |
|---|---|---|
| 404 | not_found | No quota exists for this external_user_id (GET/DELETE) |
| 422 | validation errors | A limit value is non-integer or negative |