RecoupGet a Free AuditFree Audit

API REFERENCE

Delete Sandbox

On this page
DELETE/api/sandboxes

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.

Authentication

See the authentication guide for API key and account access requirements.

Request

cURL
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_idstring

UUID 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 · enumrequired

Status of the delete operation

Values: "success", "error"

deleted_snapshotobjectnullable

The snapshot record that was deleted. Null if no snapshot existed for the account.

Properties for deleted_snapshot
account_idstringrequired

The account ID this snapshot belongs to

format: uuid

snapshot_idstringrequired

The snapshot ID that was set for the account

expires_atstringrequired

When the snapshot expires

format: date-time

github_repostringrequirednullable

The GitHub repository URL associated with the sandbox

created_atstringrequirednullable

When the snapshot record was created

format: date-time

errorstring

Error message (only present if status is error)

400Bad request - failed to delete sandbox

application/json

errorstringrequired

Error message describing what went wrong

401Unauthorized - invalid or missing API key

application/json

errorstringrequired

Error 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

errorstringrequired

Error message describing what went wrong

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download content.json
View operation source
json
{
  "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"
          }
        }
      }
    }
  }
}