sandpi/ platform

Operate

Retention & deletion

Set Run retention, erase content and track deletion receipts.

On this page

Choose Run retention

Each Environment defaults to 30-day retention for Platform Run content. Read GET /v1/environments/{environmentId}/data-policy or use PUT with {"runContentRetentionDays":7} to choose 7, 30 or 90 days. Retention is measured from a terminal Run's finishedAt. Cleanup waits for its checkpoint to stop being pending and runs asynchronously. Shortening the policy also affects old records; increasing it does not recover erased content.

This policy erases Platform prompts, output, steering messages, event payloads, file references/manifests and verbose errors. It does not erase the live RootFS, native harness history, supervisor journals or checkpoints. Those remain until the Environment is deleted. Cleared Runs return contentDeletedAt, empty input, no output, and no replayable content events. Minimal Run/usage identities remain so settlement and unresolved provider reservations still work. Idempotency fingerprints and minimum native recovery coordinates also remain; they support safe retries and rollback without restoring erased API content.

Read Run content retention and deletion boundaries

GET /v1/environments/{environmentId}/data-policy

Authentication: Platform API bearer token

Parameters and headers
FieldType and constraintsRequiredDescription
path: environmentIdstring · min length 1YesEnvironment identifier. It must belong to the caller’s account or Project.

Request example

sh
curl \
    "https://api.sandpi.ai/v1/environments/$ENVIRONMENT_ID/data-policy" \
    -H "Authorization: Bearer $SANDPI_API_TOKEN"

No request body.

Responses

200 Successful response.
Response body application/json
FieldType and constraintsRequiredDescription
dataobject · extra fields rejectedYesRun content retention and its workspace, audit and backup boundaries.
data.runContentRetentionDaysany of the variants belowYeswithin dataRetention period for terminal Run content, counted from finishedAt. Shortening it affects existing records.
data.runContentRetentionDaysnumber · values: 7Yesvariant 1—
data.runContentRetentionDaysnumber · values: 30Yesvariant 2—
data.runContentRetentionDaysnumber · values: 90Yesvariant 3—
data.auditRetentionDaysnumber · values: 90Yeswithin dataRetention period for content-free Platform operation facts, in days.
data.workspaceRetentionstring · values: "until_environment_deletion"Yeswithin dataWorkspace and native history retention boundary, independent of Run record retention.
data.runContentScopestring · values: "platform_records"Yeswithin dataData scope covered by the Run content policy.
data.backupErasurestring · values: "operator_managed"Yeswithin dataBackup cleanup boundary; operator-managed rather than verified by Platform receipts.
Example
Example
{
  "data": {
    "runContentRetentionDays": "",
    "auditRetentionDays": 90,
    "workspaceRetention": "until_environment_deletion",
    "runContentScope": "platform_records",
    "backupErasure": "operator_managed"
  }
}
Error responses
default Sandpi error.
Error body application/json

Standard error envelope containing a stable code, diagnostic message and request identity.

FieldType and constraintsRequiredDescription
errorobject · extra fields rejectedYesStructured failure information. Inspect the stable code and retain the request ID for investigation.
error.codestringYeswithin errorStable error code used to distinguish failures programmatically.
error.messagestringYeswithin errorHuman-readable diagnostic text.
error.requestIdstringYeswithin errorRequest identifier for correlating diagnostics and support investigations.
error.detailsanyNowithin errorOptional structured error context. Its shape is specific to the service failure.
error.loginUrlstringNowithin errorAuthentication URL supplied when a browser login is required.
error.registrationOpenbooleanNowithin errorWhether new account registration is enabled for this deployment.
Example
Example
{
  "error": {
    "code": "platform_balance_insufficient",
    "message": "Top up Platform credits before submitting a Run.",
    "requestId": "req_example"
  }
}

Set Run record retention to 7, 30, or 90 days

PUT /v1/environments/{environmentId}/data-policy

Authentication: Platform API bearer token

Parameters and headers
FieldType and constraintsRequiredDescription
path: environmentIdstring · min length 1YesEnvironment identifier. It must belong to the caller’s account or Project.

Request example

sh
curl -X PUT \
    "https://api.sandpi.ai/v1/environments/$ENVIRONMENT_ID/data-policy" \
    -H "Authorization: Bearer $SANDPI_API_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
  "runContentRetentionDays": ""
}'
Request body · required application/json

Replacement retention period for Platform Run content.

FieldType and constraintsRequiredDescription
runContentRetentionDaysany of the variants belowYesRetention period for terminal Run content, counted from finishedAt. Shortening it affects existing records.
runContentRetentionDaysnumber · values: 7Yesvariant 1—
runContentRetentionDaysnumber · values: 30Yesvariant 2—
runContentRetentionDaysnumber · values: 90Yesvariant 3—
Example
Example
{
  "runContentRetentionDays": ""
}

Responses

200 Successful response.
Response body application/json
FieldType and constraintsRequiredDescription
dataobject · extra fields rejectedYesRun content retention and its workspace, audit and backup boundaries.
data.runContentRetentionDaysany of the variants belowYeswithin dataRetention period for terminal Run content, counted from finishedAt. Shortening it affects existing records.
data.runContentRetentionDaysnumber · values: 7Yesvariant 1—
data.runContentRetentionDaysnumber · values: 30Yesvariant 2—
data.runContentRetentionDaysnumber · values: 90Yesvariant 3—
data.auditRetentionDaysnumber · values: 90Yeswithin dataRetention period for content-free Platform operation facts, in days.
data.workspaceRetentionstring · values: "until_environment_deletion"Yeswithin dataWorkspace and native history retention boundary, independent of Run record retention.
data.runContentScopestring · values: "platform_records"Yeswithin dataData scope covered by the Run content policy.
data.backupErasurestring · values: "operator_managed"Yeswithin dataBackup cleanup boundary; operator-managed rather than verified by Platform receipts.
Example
Example
{
  "data": {
    "runContentRetentionDays": "",
    "auditRetentionDays": 90,
    "workspaceRetention": "until_environment_deletion",
    "runContentScope": "platform_records",
    "backupErasure": "operator_managed"
  }
}
Error responses
default Sandpi error.
Error body application/json

Standard error envelope containing a stable code, diagnostic message and request identity.

FieldType and constraintsRequiredDescription
errorobject · extra fields rejectedYesStructured failure information. Inspect the stable code and retain the request ID for investigation.
error.codestringYeswithin errorStable error code used to distinguish failures programmatically.
error.messagestringYeswithin errorHuman-readable diagnostic text.
error.requestIdstringYeswithin errorRequest identifier for correlating diagnostics and support investigations.
error.detailsanyNowithin errorOptional structured error context. Its shape is specific to the service failure.
error.loginUrlstringNowithin errorAuthentication URL supplied when a browser login is required.
error.registrationOpenbooleanNowithin errorWhether new account registration is enabled for this deployment.
Example
Example
{
  "error": {
    "code": "platform_balance_insufficient",
    "message": "Top up Platform credits before submitting a Run.",
    "requestId": "req_example"
  }
}

Delete Run records

Wait for the Run to be terminal and its checkpoint to stop being pending. Request record cleanup, save the returned deletion ID and poll the receipt. This does not restore workspace state.

Erase a terminal Run's Platform records

POST /v1/environments/{environmentId}/runs/{runId}/content-deletions

Idempotent per Run. Requires a terminal Run and non-pending checkpoint. Erases inputs, output, event payloads, steering messages and file manifests. Native history, supervisor journals, workspace files and checkpoints remain until Environment deletion.

Authentication: Platform API bearer token

Parameters and headers
FieldType and constraintsRequiredDescription
path: environmentIdstring · min length 1YesEnvironment identifier. It must belong to the caller’s account or Project.
path: runIdstring · min length 1YesRun identifier within the named Environment and, where applicable, Session.

Request example

sh
curl -X POST \
    "https://api.sandpi.ai/v1/environments/$ENVIRONMENT_ID/runs/$RUN_ID/content-deletions" \
    -H "Authorization: Bearer $SANDPI_API_TOKEN"

No request body.

Responses

202 Accepted.
Response body application/json
FieldType and constraintsRequiredDescription
dataobject · extra fields rejectedYesDurable asynchronous cleanup receipt. Completion applies only to its declared online-content scope.
data.idstringYeswithin dataResource identifier used to read or manage this resource.
data.environmentIdstringYeswithin dataEnvironment identifier. It must belong to the caller’s account or Project.
data.runIdstringNowithin dataRun identifier within the named Environment and, where applicable, Session.
data.kindstring · values: "run_content" | "environment"Yeswithin dataWhether cleanup covers a Run’s Platform records or the entire Environment’s online content.
data.statusstring · values: "pending" | "processing" | "completed"Yeswithin dataAsynchronous cleanup state; completed confirms only the receipt’s declared scope.
data.attemptsinteger · ≥ -9007199254740991; ≤ 9007199254740991Yeswithin dataNumber of cleanup attempts recorded for this deletion.
data.errorCodestringNowithin dataStable diagnostic code when execution or cleanup reports a failure.
data.requestedAtstring · format: date-time
Validation pattern^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Yeswithin dataCleanup request time as a UTC date-time string.
data.completedAtstring · format: date-time
Validation pattern^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Nowithin dataCleanup completion time as a UTC date-time string.
data.scopestring · values: "platform_records" | "environment_online_content"Yeswithin dataOnline content scope whose cleanup is acknowledged by this receipt.
data.physicalErasurestring · values: "not_verified"Yeswithin dataWhether physical storage erasure is verified by this receipt. Online cleanup does not prove physical erasure.
data.backupErasurestring · values: "operator_managed"Yeswithin dataBackup cleanup boundary; operator-managed rather than verified by Platform receipts.
data.providerErasurestring · values: "provider_managed"Yeswithin dataProvider-held copy boundary; managed by the provider rather than verified by Platform receipts.
Example
Example
{
  "data": {
    "id": "",
    "environmentId": "",
    "kind": "run_content",
    "status": "pending",
    "attempts": -9007199254740991,
    "requestedAt": "2026-10-12T01:00:00Z",
    "scope": "platform_records",
    "physicalErasure": "not_verified",
    "backupErasure": "operator_managed",
    "providerErasure": "provider_managed"
  }
}
Error responses
default Sandpi error.
Error body application/json

Standard error envelope containing a stable code, diagnostic message and request identity.

FieldType and constraintsRequiredDescription
errorobject · extra fields rejectedYesStructured failure information. Inspect the stable code and retain the request ID for investigation.
error.codestringYeswithin errorStable error code used to distinguish failures programmatically.
error.messagestringYeswithin errorHuman-readable diagnostic text.
error.requestIdstringYeswithin errorRequest identifier for correlating diagnostics and support investigations.
error.detailsanyNowithin errorOptional structured error context. Its shape is specific to the service failure.
error.loginUrlstringNowithin errorAuthentication URL supplied when a browser login is required.
error.registrationOpenbooleanNowithin errorWhether new account registration is enabled for this deployment.
Example
Example
{
  "error": {
    "code": "platform_balance_insufficient",
    "message": "Top up Platform credits before submitting a Run.",
    "requestId": "req_example"
  }
}

Delete an Environment

Request cleanup and track the receipt until completion. New operations are fenced as soon as deletion is accepted. Delete independent completed forks separately.

Request durable Environment online-content deletion

POST /v1/environments/{environmentId}/deletions

Idempotent per Environment. Fences new operations, deletes the sandbox and owned checkpoints, and erases Platform content. Minimal billing and 90-day Platform audit records remain. Completion does not verify physical, backup, fork, or provider erasure.

Authentication: Platform API bearer token

Parameters and headers
FieldType and constraintsRequiredDescription
path: environmentIdstring · min length 1YesEnvironment identifier. It must belong to the caller’s account or Project.

Request example

sh
curl -X POST \
    "https://api.sandpi.ai/v1/environments/$ENVIRONMENT_ID/deletions" \
    -H "Authorization: Bearer $SANDPI_API_TOKEN"

No request body.

Responses

202 Accepted.
Response body application/json
FieldType and constraintsRequiredDescription
dataobject · extra fields rejectedYesDurable asynchronous cleanup receipt. Completion applies only to its declared online-content scope.
data.idstringYeswithin dataResource identifier used to read or manage this resource.
data.environmentIdstringYeswithin dataEnvironment identifier. It must belong to the caller’s account or Project.
data.runIdstringNowithin dataRun identifier within the named Environment and, where applicable, Session.
data.kindstring · values: "run_content" | "environment"Yeswithin dataWhether cleanup covers a Run’s Platform records or the entire Environment’s online content.
data.statusstring · values: "pending" | "processing" | "completed"Yeswithin dataAsynchronous cleanup state; completed confirms only the receipt’s declared scope.
data.attemptsinteger · ≥ -9007199254740991; ≤ 9007199254740991Yeswithin dataNumber of cleanup attempts recorded for this deletion.
data.errorCodestringNowithin dataStable diagnostic code when execution or cleanup reports a failure.
data.requestedAtstring · format: date-time
Validation pattern^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Yeswithin dataCleanup request time as a UTC date-time string.
data.completedAtstring · format: date-time
Validation pattern^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Nowithin dataCleanup completion time as a UTC date-time string.
data.scopestring · values: "platform_records" | "environment_online_content"Yeswithin dataOnline content scope whose cleanup is acknowledged by this receipt.
data.physicalErasurestring · values: "not_verified"Yeswithin dataWhether physical storage erasure is verified by this receipt. Online cleanup does not prove physical erasure.
data.backupErasurestring · values: "operator_managed"Yeswithin dataBackup cleanup boundary; operator-managed rather than verified by Platform receipts.
data.providerErasurestring · values: "provider_managed"Yeswithin dataProvider-held copy boundary; managed by the provider rather than verified by Platform receipts.
Example
Example
{
  "data": {
    "id": "",
    "environmentId": "",
    "kind": "run_content",
    "status": "pending",
    "attempts": -9007199254740991,
    "requestedAt": "2026-10-12T01:00:00Z",
    "scope": "platform_records",
    "physicalErasure": "not_verified",
    "backupErasure": "operator_managed",
    "providerErasure": "provider_managed"
  }
}
Error responses
default Sandpi error.
Error body application/json

Standard error envelope containing a stable code, diagnostic message and request identity.

FieldType and constraintsRequiredDescription
errorobject · extra fields rejectedYesStructured failure information. Inspect the stable code and retain the request ID for investigation.
error.codestringYeswithin errorStable error code used to distinguish failures programmatically.
error.messagestringYeswithin errorHuman-readable diagnostic text.
error.requestIdstringYeswithin errorRequest identifier for correlating diagnostics and support investigations.
error.detailsanyNowithin errorOptional structured error context. Its shape is specific to the service failure.
error.loginUrlstringNowithin errorAuthentication URL supplied when a browser login is required.
error.registrationOpenbooleanNowithin errorWhether new account registration is enabled for this deployment.
Example
Example
{
  "error": {
    "code": "platform_balance_insufficient",
    "message": "Top up Platform credits before submitting a Run.",
    "requestId": "req_example"
  }
}

Read a deletion receipt, including retry and erasure boundaries

GET /v1/deletions/{deletionId}

Authentication: Platform API bearer token

Parameters and headers
FieldType and constraintsRequiredDescription
path: deletionIdstring · min length 1YesDurable deletion receipt identifier; remains readable after Environment removal.

Request example

sh
curl \
    "https://api.sandpi.ai/v1/deletions/$DELETION_ID" \
    -H "Authorization: Bearer $SANDPI_API_TOKEN"

No request body.

Responses

200 Successful response.
Response body application/json
FieldType and constraintsRequiredDescription
dataobject · extra fields rejectedYesDurable asynchronous cleanup receipt. Completion applies only to its declared online-content scope.
data.idstringYeswithin dataResource identifier used to read or manage this resource.
data.environmentIdstringYeswithin dataEnvironment identifier. It must belong to the caller’s account or Project.
data.runIdstringNowithin dataRun identifier within the named Environment and, where applicable, Session.
data.kindstring · values: "run_content" | "environment"Yeswithin dataWhether cleanup covers a Run’s Platform records or the entire Environment’s online content.
data.statusstring · values: "pending" | "processing" | "completed"Yeswithin dataAsynchronous cleanup state; completed confirms only the receipt’s declared scope.
data.attemptsinteger · ≥ -9007199254740991; ≤ 9007199254740991Yeswithin dataNumber of cleanup attempts recorded for this deletion.
data.errorCodestringNowithin dataStable diagnostic code when execution or cleanup reports a failure.
data.requestedAtstring · format: date-time
Validation pattern^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Yeswithin dataCleanup request time as a UTC date-time string.
data.completedAtstring · format: date-time
Validation pattern^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Nowithin dataCleanup completion time as a UTC date-time string.
data.scopestring · values: "platform_records" | "environment_online_content"Yeswithin dataOnline content scope whose cleanup is acknowledged by this receipt.
data.physicalErasurestring · values: "not_verified"Yeswithin dataWhether physical storage erasure is verified by this receipt. Online cleanup does not prove physical erasure.
data.backupErasurestring · values: "operator_managed"Yeswithin dataBackup cleanup boundary; operator-managed rather than verified by Platform receipts.
data.providerErasurestring · values: "provider_managed"Yeswithin dataProvider-held copy boundary; managed by the provider rather than verified by Platform receipts.
Example
Example
{
  "data": {
    "id": "",
    "environmentId": "",
    "kind": "run_content",
    "status": "pending",
    "attempts": -9007199254740991,
    "requestedAt": "2026-10-12T01:00:00Z",
    "scope": "platform_records",
    "physicalErasure": "not_verified",
    "backupErasure": "operator_managed",
    "providerErasure": "provider_managed"
  }
}
Error responses
default Sandpi error.
Error body application/json

Standard error envelope containing a stable code, diagnostic message and request identity.

FieldType and constraintsRequiredDescription
errorobject · extra fields rejectedYesStructured failure information. Inspect the stable code and retain the request ID for investigation.
error.codestringYeswithin errorStable error code used to distinguish failures programmatically.
error.messagestringYeswithin errorHuman-readable diagnostic text.
error.requestIdstringYeswithin errorRequest identifier for correlating diagnostics and support investigations.
error.detailsanyNowithin errorOptional structured error context. Its shape is specific to the service failure.
error.loginUrlstringNowithin errorAuthentication URL supplied when a browser login is required.
error.registrationOpenbooleanNowithin errorWhether new account registration is enabled for this deployment.
Example
Example
{
  "error": {
    "code": "platform_balance_insufficient",
    "message": "Top up Platform credits before submitting a Run.",
    "requestId": "req_example"
  }
}

What completion proves

Receipts explicitly report physicalErasure: "not_verified", backupErasure: "operator_managed" and providerErasure: "provider_managed". Sandbox0 reference release and physical object garbage collection are distinct. Shared blocks needed by independent forks remain. Backup copies may contain older content, and restoring a backup requires replaying deletion receipts before access is reopened. Contact contact@sandpi.ai for deployment-specific backup retention, provider processing terms or a DPA. These APIs do not assert a certification or that every physical/provider/backup copy has been erased.

Track cleanup

Poll the deletion receipt or list the latest 100 receipts in your key’s scope. Filter by Environment ID to find the receipt created by DELETE Environment, which returns 204 on acceptance. A receipt remains readable after the Environment is deleted. Completed receipts describe their declared scope: Platform records for a Run, or online Environment content for whole-workspace cleanup. Pending jobs retry asynchronously.

List the latest 100 deletion receipts in this scope

GET /v1/deletions

Authentication: Platform API bearer token

Parameters and headers
FieldType and constraintsRequiredDescription
query: environmentIdstringNoFilter receipts or audit facts by this Environment identifier within the token’s scope.

Request example

sh
curl \
    "https://api.sandpi.ai/v1/deletions" \
    -H "Authorization: Bearer $SANDPI_API_TOKEN"

No request body.

Responses

200 Successful response.
Response body application/json
FieldType and constraintsRequiredDescription
dataarrayYesSuccessful result wrapped by the API. The child fields describe its content.
data[]object · extra fields rejectedYeseach array itemDurable asynchronous cleanup receipt. Completion applies only to its declared online-content scope.
data[].idstringYeseach array itemResource identifier used to read or manage this resource.
data[].environmentIdstringYeseach array itemEnvironment identifier. It must belong to the caller’s account or Project.
data[].runIdstringNoeach array itemRun identifier within the named Environment and, where applicable, Session.
data[].kindstring · values: "run_content" | "environment"Yeseach array itemWhether cleanup covers a Run’s Platform records or the entire Environment’s online content.
data[].statusstring · values: "pending" | "processing" | "completed"Yeseach array itemAsynchronous cleanup state; completed confirms only the receipt’s declared scope.
data[].attemptsinteger · ≥ -9007199254740991; ≤ 9007199254740991Yeseach array itemNumber of cleanup attempts recorded for this deletion.
data[].errorCodestringNoeach array itemStable diagnostic code when execution or cleanup reports a failure.
data[].requestedAtstring · format: date-time
Validation pattern^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Yeseach array itemCleanup request time as a UTC date-time string.
data[].completedAtstring · format: date-time
Validation pattern^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d(?:\.\d+)?)?(?:Z))$
Noeach array itemCleanup completion time as a UTC date-time string.
data[].scopestring · values: "platform_records" | "environment_online_content"Yeseach array itemOnline content scope whose cleanup is acknowledged by this receipt.
data[].physicalErasurestring · values: "not_verified"Yeseach array itemWhether physical storage erasure is verified by this receipt. Online cleanup does not prove physical erasure.
data[].backupErasurestring · values: "operator_managed"Yeseach array itemBackup cleanup boundary; operator-managed rather than verified by Platform receipts.
data[].providerErasurestring · values: "provider_managed"Yeseach array itemProvider-held copy boundary; managed by the provider rather than verified by Platform receipts.
Example
Example
{
  "data": [
    {
      "id": "",
      "environmentId": "",
      "kind": "run_content",
      "status": "pending",
      "attempts": -9007199254740991,
      "requestedAt": "2026-10-12T01:00:00Z",
      "scope": "platform_records",
      "physicalErasure": "not_verified",
      "backupErasure": "operator_managed",
      "providerErasure": "provider_managed"
    }
  ]
}
Error responses
default Sandpi error.
Error body application/json

Standard error envelope containing a stable code, diagnostic message and request identity.

FieldType and constraintsRequiredDescription
errorobject · extra fields rejectedYesStructured failure information. Inspect the stable code and retain the request ID for investigation.
error.codestringYeswithin errorStable error code used to distinguish failures programmatically.
error.messagestringYeswithin errorHuman-readable diagnostic text.
error.requestIdstringYeswithin errorRequest identifier for correlating diagnostics and support investigations.
error.detailsanyNowithin errorOptional structured error context. Its shape is specific to the service failure.
error.loginUrlstringNowithin errorAuthentication URL supplied when a browser login is required.
error.registrationOpenbooleanNowithin errorWhether new account registration is enabled for this deployment.
Example
Example
{
  "error": {
    "code": "platform_balance_insufficient",
    "message": "Top up Platform credits before submitting a Run.",
    "requestId": "req_example"
  }
}

Select the right operation

GoalOperationEffect
Undo a task and later workRun rollbackRestores a preceding checkpoint; retains charges
Clear a Run’s API contentRun content deletionErases Platform records; retains workspace and settlement facts
Remove an online workspaceEnvironment deletionDeletes its workspace, native history and owned checkpoints asynchronously

See stop and rollback and audit and exports.

Delete using the Environment resource

The Environment DELETE operation uses the same asynchronous cleanup queue but returns an empty response. List deletion receipts to track completion. Prefer the receipt-returning request above when your integration needs a deletion ID immediately.

Request Environment online-content deletion

DELETE /v1/environments/{environmentId}

Accept a durable deletion request. A 204 response confirms admission, not completion. Poll GET /v1/deletions?environmentId=... for the receipt. Minimal billing and audit metadata remain; physical, backup and provider erasure are separate.

Authentication: Platform API bearer token

Parameters and headers
FieldType and constraintsRequiredDescription
path: environmentIdstring · min length 1YesEnvironment identifier. It must belong to the caller’s account or Project.

Request example

sh
curl -X DELETE \
    "https://api.sandpi.ai/v1/environments/$ENVIRONMENT_ID" \
    -H "Authorization: Bearer $SANDPI_API_TOKEN"

No request body.

Responses

204 No content.

Empty response body.

Error responses
400 Invalid request.

application/json

401 Missing or invalid Platform API token.

application/json

404 Resource not found or outside token scope.

application/json

default Sandpi error.
Error body application/json

Standard error envelope containing a stable code, diagnostic message and request identity.

FieldType and constraintsRequiredDescription
errorobject · extra fields rejectedYesStructured failure information. Inspect the stable code and retain the request ID for investigation.
error.codestringYeswithin errorStable error code used to distinguish failures programmatically.
error.messagestringYeswithin errorHuman-readable diagnostic text.
error.requestIdstringYeswithin errorRequest identifier for correlating diagnostics and support investigations.
error.detailsanyNowithin errorOptional structured error context. Its shape is specific to the service failure.
error.loginUrlstringNowithin errorAuthentication URL supplied when a browser login is required.
error.registrationOpenbooleanNowithin errorWhether new account registration is enabled for this deployment.
Example
Example
{
  "error": {
    "code": "platform_balance_insufficient",
    "message": "Top up Platform credits before submitting a Run.",
    "requestId": "req_example"
  }
}