On this page
Create a sandbox
Create the organization’s sandbox on first use. It shares membership with production and has separate resources.
Operation ID: environments.ensure_sandbox.
Request
POST /api/v1/environments/sandbox
- TypeScript SDK:
client.environments.ensure_sandbox(path arguments usepath). - MCP tool:
sdk_client_callwithoperationId: "environments.ensure_sandbox"(path arguments useinput.path). Legacy alias:environments_ensure_sandbox. Connect to your authenticated/mcpendpoint with an API key for the same environment. - Minimum API key role: admin.
- Idempotency: No header required; the resource or revision identifies the change.
Read resource IDs from earlier responses and use a key for the same environment.
Request example
Set each path variable to an ID returned by an earlier API request.
Set CUMULUS_BASE_URL to your workspace API URL and CUMULUS_API_KEY to a key for that environment. Example values are synthetic.
cURL
curl --fail-with-body -sS -X POST "${CUMULUS_BASE_URL%/}/api/v1/environments/sandbox" \
-H "Authorization: Bearer $CUMULUS_API_KEY"
TypeScript
import { Cumulus } from "@cumulus/sdk";
const baseUrl = process.env.CUMULUS_BASE_URL;
const apiKey = process.env.CUMULUS_API_KEY;
if (!baseUrl || !apiKey) throw new Error("Set CUMULUS_BASE_URL and CUMULUS_API_KEY");
const client = new Cumulus({ baseUrl, apiKey });
const response = await client.environments.ensure_sandbox({});
Input schema
Path, query and header parameters
No path or query parameters.
JSON request body
This operation has no JSON request body.
Complete OpenAPI schema
{
"parameters": [],
"requestBody": null
}
Responses
HTTP 200
Create this organization's sandbox environment on first use (same members)
application/json
| Field | Type or values | Required | Description and limits |
|---|---|---|---|
current | "production" · "sandbox" | Required | — |
items | array of object | Required | — |
items[].kind | "production" · "sandbox" | Required | — |
items[].tenant_id | string (uuid) | Required | pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$. |
items[].slug | string | Required | minLength: 1. |
items[].name | string | Required | minLength: 1. |
items[].display_name | string or null | Required | — |
created | boolean | Required | — |
sandbox_provisioning | "configured" · "pending" · "unavailable" | Required | — |
Error responses
| HTTP | Description |
|---|---|
| 4XX | Typed error (ApiError) |
| 5XX | Typed error (ApiError) |
Errors use the shared error envelope. Inspect error.code, retryable, outcome and details before retrying.
Complete OpenAPI schema
{
"200": {
"description": "Create this organization's sandbox environment on first use (same members)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/EnvironmentsEnsureSandboxResponse200"
}
}
}
},
"4XX": {
"description": "Typed error (ApiError)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
},
"5XX": {
"description": "Typed error (ApiError)",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ApiError"
}
}
}
}
}
Referenced schemas
Expand the complete OpenAPI definitions for integrations that generate their own clients.
Complete OpenAPI schema
{
"components": {
"schemas": {
"EnvironmentsEnsureSandboxResponse200": {
"type": "object",
"properties": {
"current": {
"type": "string",
"enum": [
"production",
"sandbox"
]
},
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"kind": {
"type": "string",
"enum": [
"production",
"sandbox"
]
},
"tenant_id": {
"type": "string",
"format": "uuid",
"pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"
},
"slug": {
"type": "string",
"minLength": 1
},
"name": {
"type": "string",
"minLength": 1
},
"display_name": {
"nullable": true,
"type": "string"
}
},
"required": [
"kind",
"tenant_id",
"slug",
"name",
"display_name"
],
"additionalProperties": false
}
},
"created": {
"type": "boolean"
},
"sandbox_provisioning": {
"type": "string",
"enum": [
"configured",
"pending",
"unavailable"
]
}
},
"required": [
"current",
"items",
"created",
"sandbox_provisioning"
],
"additionalProperties": false
},
"ApiError": {
"type": "object",
"properties": {
"error": {
"type": "object",
"properties": {
"code": {
"type": "string",
"enum": [
"unauthenticated",
"forbidden",
"not_found",
"conflict",
"invalid_request",
"idempotency_conflict",
"policy_denied",
"capability_unavailable",
"provider_unavailable",
"knowledge_unavailable",
"publication_invalid",
"run_not_active",
"rate_limited",
"outcome_unknown",
"internal"
]
},
"message": {
"type": "string"
},
"retryable": {
"type": "boolean"
},
"outcome": {
"type": "string",
"enum": [
"none",
"unknown"
]
},
"details": {
"type": "object",
"additionalProperties": {}
}
},
"required": [
"code",
"message",
"retryable",
"outcome"
],
"additionalProperties": false
}
},
"required": [
"error"
],
"additionalProperties": false
}
}
}
}
Errors and recovery
See API error handling and Troubleshooting.