Source: https://docs.cumuluslabs.io/reference/environments.ensure_sandbox
Content version: 8dd63c82

# environments.ensure_sandbox

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

## Request {#request}

`POST /api/v1/environments/sandbox`

- MCP: `environments_ensure_sandbox`
- SDK: `client.environments.ensure_sandbox` (SDK path arguments use `path`; MCP uses `params`).
- Minimum API key role: **admin**.
- Idempotency: **natural**.

Use the request schema below. Read IDs from earlier operation results.

## Input schema {#input-schema}

```json
{
  "parameters": [],
  "requestBody": null
}
```

## Responses {#responses}

```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 {#schemas}

```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"
                },
                "slug": {
                  "type": "string",
                  "minLength": 1
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "display_name": {
                  "type": "string",
                  "nullable": true
                }
              },
              "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 {#errors}

See [API error handling](https://docs.cumuluslabs.io/api#errors) and [Troubleshooting](https://docs.cumuluslabs.io/troubleshooting).

## Related guides {#related-guides}

- [Build with an AI agent](https://docs.cumuluslabs.io/ai-agents)
- [Connect the Cumulus MCP](https://docs.cumuluslabs.io/mcp)
