API REFERENCE
Delete Sandbox
On this page
/api/sandboxesDelete a sandbox environment for the authenticated account. This permanently deletes the associated GitHub repository and removes the account's snapshot record from the database. By default, deletes the sandbox for the key owner's account. Pass account_id to target a specific account the API key has access to. Authentication is handled via the x-api-key header or Authorization Bearer token.
Authentication
See the authentication guide for API key and account access requirements.
Request
curl --request DELETE \
--url 'https://api.recoupable.dev/api/sandboxes' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"account_id": "YOUR_ID"
}'Request body
Optional account targeting parameters
application/json
account_idstringUUID of the account to delete the sandbox for. Only applicable when the authenticated account has access to multiple accounts via organization membership. If not provided, deletes the sandbox for the API key's own account.
format: uuid
Responses
200Sandbox deleted successfully+
application/json
statusstring · enumrequiredStatus of the delete operation
Values: "success", "error"
deleted_snapshotobjectnullableThe snapshot record that was deleted. Null if no snapshot existed for the account.
Properties for deleted_snapshot
account_idstringrequiredThe account ID this snapshot belongs to
format: uuid
snapshot_idstringrequiredThe snapshot ID that was set for the account
expires_atstringrequiredWhen the snapshot expires
format: date-time
github_repostringrequirednullableThe GitHub repository URL associated with the sandbox
created_atstringrequirednullableWhen the snapshot record was created
format: date-time
errorstringError message (only present if status is error)
400Bad request - failed to delete sandbox+
application/json
errorstringrequiredError message describing what went wrong
401Unauthorized - invalid or missing API key+
application/json
errorstringrequiredError message describing what went wrong
403Forbidden - account_id is not a member of the organization or account tried to use an account_id they don't have access to+
application/json
errorstringrequiredError message describing what went wrong
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download content.jsonView operation source
{
"description": "Delete a sandbox environment for the authenticated account. This permanently deletes the associated GitHub repository and removes the account's snapshot record from the database. By default, deletes the sandbox for the key owner's account. Pass account_id to target a specific account the API key has access to. Authentication is handled via the x-api-key header or Authorization Bearer token.",
"requestBody": {
"description": "Optional account targeting parameters",
"required": false,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteSandboxRequest"
}
}
}
},
"responses": {
"200": {
"description": "Sandbox deleted successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DeleteSandboxResponse"
}
}
}
},
"400": {
"description": "Bad request - failed to delete sandbox",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SandboxErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized - invalid or missing API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SandboxErrorResponse"
}
}
}
},
"403": {
"description": "Forbidden - account_id is not a member of the organization or account tried to use an account_id they don't have access to",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SandboxErrorResponse"
}
}
}
}
}
}