CumulusDocs
Open Studio
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 use path).
  • MCP tool: sdk_client_call with operationId: "environments.ensure_sandbox" (path arguments use input.path). Legacy alias: environments_ensure_sandbox. Connect to your authenticated /mcp endpoint 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
curl --fail-with-body -sS -X POST "${CUMULUS_BASE_URL%/}/api/v1/environments/sandbox" \
  -H "Authorization: Bearer $CUMULUS_API_KEY"

TypeScript

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
OpenAPI JSON
{
  "parameters": [],
  "requestBody": null
}

Responses

HTTP 200

Create this organization's sandbox environment on first use (same members)

application/json

FieldType or valuesRequiredDescription and limits
current"production" · "sandbox"Required—
itemsarray of objectRequired—
items[].kind"production" · "sandbox"Required—
items[].tenant_idstring (uuid)Requiredpattern: ^([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[].slugstringRequiredminLength: 1.
items[].namestringRequiredminLength: 1.
items[].display_namestring or nullRequired—
createdbooleanRequired—
sandbox_provisioning"configured" · "pending" · "unavailable"Required—

Error responses

HTTPDescription
4XXTyped error (ApiError)
5XXTyped error (ApiError)

Errors use the shared error envelope. Inspect error.code, retryable, outcome and details before retrying.

Complete OpenAPI schema
OpenAPI JSON
{
  "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
OpenAPI JSON
{
  "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.

Content version 8436f58cCustomer SDKMarkdown source
Create a sandbox · Cumulus developer docs