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
/v1/environments/{environmentId}/data-policyAuthentication: Platform API bearer token
Parameters and headers
| Field | Type and constraints | Required | Description |
|---|---|---|---|
path: environmentId | string · min length 1 | Yes | Environment identifier. It must belong to the caller’s account or Project. |
Request example
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
| Field | Type and constraints | Required | Description |
|---|---|---|---|
data | object · extra fields rejected | Yes | Run content retention and its workspace, audit and backup boundaries. |
data.runContentRetentionDays | any of the variants below | Yeswithin data | Retention period for terminal Run content, counted from finishedAt. Shortening it affects existing records. |
data.runContentRetentionDays | number · values: 7 | Yesvariant 1 | — |
data.runContentRetentionDays | number · values: 30 | Yesvariant 2 | — |
data.runContentRetentionDays | number · values: 90 | Yesvariant 3 | — |
data.auditRetentionDays | number · values: 90 | Yeswithin data | Retention period for content-free Platform operation facts, in days. |
data.workspaceRetention | string · values: "until_environment_deletion" | Yeswithin data | Workspace and native history retention boundary, independent of Run record retention. |
data.runContentScope | string · values: "platform_records" | Yeswithin data | Data scope covered by the Run content policy. |
data.backupErasure | string · values: "operator_managed" | Yeswithin data | Backup cleanup boundary; operator-managed rather than verified by Platform receipts. |
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.
| Field | Type and constraints | Required | Description |
|---|---|---|---|
error | object · extra fields rejected | Yes | Structured failure information. Inspect the stable code and retain the request ID for investigation. |
error.code | string | Yeswithin error | Stable error code used to distinguish failures programmatically. |
error.message | string | Yeswithin error | Human-readable diagnostic text. |
error.requestId | string | Yeswithin error | Request identifier for correlating diagnostics and support investigations. |
error.details | any | Nowithin error | Optional structured error context. Its shape is specific to the service failure. |
error.loginUrl | string | Nowithin error | Authentication URL supplied when a browser login is required. |
error.registrationOpen | boolean | Nowithin error | Whether new account registration is enabled for this deployment. |
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
/v1/environments/{environmentId}/data-policyAuthentication: Platform API bearer token
Parameters and headers
| Field | Type and constraints | Required | Description |
|---|---|---|---|
path: environmentId | string · min length 1 | Yes | Environment identifier. It must belong to the caller’s account or Project. |
Request example
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.
| Field | Type and constraints | Required | Description |
|---|---|---|---|
runContentRetentionDays | any of the variants below | Yes | Retention period for terminal Run content, counted from finishedAt. Shortening it affects existing records. |
runContentRetentionDays | number · values: 7 | Yesvariant 1 | — |
runContentRetentionDays | number · values: 30 | Yesvariant 2 | — |
runContentRetentionDays | number · values: 90 | Yesvariant 3 | — |
Example
{
"runContentRetentionDays": ""
}Responses
200 Successful response.Response body application/json
| Field | Type and constraints | Required | Description |
|---|---|---|---|
data | object · extra fields rejected | Yes | Run content retention and its workspace, audit and backup boundaries. |
data.runContentRetentionDays | any of the variants below | Yeswithin data | Retention period for terminal Run content, counted from finishedAt. Shortening it affects existing records. |
data.runContentRetentionDays | number · values: 7 | Yesvariant 1 | — |
data.runContentRetentionDays | number · values: 30 | Yesvariant 2 | — |
data.runContentRetentionDays | number · values: 90 | Yesvariant 3 | — |
data.auditRetentionDays | number · values: 90 | Yeswithin data | Retention period for content-free Platform operation facts, in days. |
data.workspaceRetention | string · values: "until_environment_deletion" | Yeswithin data | Workspace and native history retention boundary, independent of Run record retention. |
data.runContentScope | string · values: "platform_records" | Yeswithin data | Data scope covered by the Run content policy. |
data.backupErasure | string · values: "operator_managed" | Yeswithin data | Backup cleanup boundary; operator-managed rather than verified by Platform receipts. |
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.
| Field | Type and constraints | Required | Description |
|---|---|---|---|
error | object · extra fields rejected | Yes | Structured failure information. Inspect the stable code and retain the request ID for investigation. |
error.code | string | Yeswithin error | Stable error code used to distinguish failures programmatically. |
error.message | string | Yeswithin error | Human-readable diagnostic text. |
error.requestId | string | Yeswithin error | Request identifier for correlating diagnostics and support investigations. |
error.details | any | Nowithin error | Optional structured error context. Its shape is specific to the service failure. |
error.loginUrl | string | Nowithin error | Authentication URL supplied when a browser login is required. |
error.registrationOpen | boolean | Nowithin error | Whether new account registration is enabled for this deployment. |
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
/v1/environments/{environmentId}/runs/{runId}/content-deletionsIdempotent 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
| Field | Type and constraints | Required | Description |
|---|---|---|---|
path: environmentId | string · min length 1 | Yes | Environment identifier. It must belong to the caller’s account or Project. |
path: runId | string · min length 1 | Yes | Run identifier within the named Environment and, where applicable, Session. |
Request example
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
| Field | Type and constraints | Required | Description |
|---|---|---|---|
data | object · extra fields rejected | Yes | Durable asynchronous cleanup receipt. Completion applies only to its declared online-content scope. |
data.id | string | Yeswithin data | Resource identifier used to read or manage this resource. |
data.environmentId | string | Yeswithin data | Environment identifier. It must belong to the caller’s account or Project. |
data.runId | string | Nowithin data | Run identifier within the named Environment and, where applicable, Session. |
data.kind | string · values: "run_content" | "environment" | Yeswithin data | Whether cleanup covers a Run’s Platform records or the entire Environment’s online content. |
data.status | string · values: "pending" | "processing" | "completed" | Yeswithin data | Asynchronous cleanup state; completed confirms only the receipt’s declared scope. |
data.attempts | integer · ≥ -9007199254740991; ≤ 9007199254740991 | Yeswithin data | Number of cleanup attempts recorded for this deletion. |
data.errorCode | string | Nowithin data | Stable diagnostic code when execution or cleanup reports a failure. |
data.requestedAt | string · format: date-timeValidation 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 data | Cleanup request time as a UTC date-time string. |
data.completedAt | string · format: date-timeValidation 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 data | Cleanup completion time as a UTC date-time string. |
data.scope | string · values: "platform_records" | "environment_online_content" | Yeswithin data | Online content scope whose cleanup is acknowledged by this receipt. |
data.physicalErasure | string · values: "not_verified" | Yeswithin data | Whether physical storage erasure is verified by this receipt. Online cleanup does not prove physical erasure. |
data.backupErasure | string · values: "operator_managed" | Yeswithin data | Backup cleanup boundary; operator-managed rather than verified by Platform receipts. |
data.providerErasure | string · values: "provider_managed" | Yeswithin data | Provider-held copy boundary; managed by the provider rather than verified by Platform receipts. |
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.
| Field | Type and constraints | Required | Description |
|---|---|---|---|
error | object · extra fields rejected | Yes | Structured failure information. Inspect the stable code and retain the request ID for investigation. |
error.code | string | Yeswithin error | Stable error code used to distinguish failures programmatically. |
error.message | string | Yeswithin error | Human-readable diagnostic text. |
error.requestId | string | Yeswithin error | Request identifier for correlating diagnostics and support investigations. |
error.details | any | Nowithin error | Optional structured error context. Its shape is specific to the service failure. |
error.loginUrl | string | Nowithin error | Authentication URL supplied when a browser login is required. |
error.registrationOpen | boolean | Nowithin error | Whether new account registration is enabled for this deployment. |
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
/v1/environments/{environmentId}/deletionsIdempotent 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
| Field | Type and constraints | Required | Description |
|---|---|---|---|
path: environmentId | string · min length 1 | Yes | Environment identifier. It must belong to the caller’s account or Project. |
Request example
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
| Field | Type and constraints | Required | Description |
|---|---|---|---|
data | object · extra fields rejected | Yes | Durable asynchronous cleanup receipt. Completion applies only to its declared online-content scope. |
data.id | string | Yeswithin data | Resource identifier used to read or manage this resource. |
data.environmentId | string | Yeswithin data | Environment identifier. It must belong to the caller’s account or Project. |
data.runId | string | Nowithin data | Run identifier within the named Environment and, where applicable, Session. |
data.kind | string · values: "run_content" | "environment" | Yeswithin data | Whether cleanup covers a Run’s Platform records or the entire Environment’s online content. |
data.status | string · values: "pending" | "processing" | "completed" | Yeswithin data | Asynchronous cleanup state; completed confirms only the receipt’s declared scope. |
data.attempts | integer · ≥ -9007199254740991; ≤ 9007199254740991 | Yeswithin data | Number of cleanup attempts recorded for this deletion. |
data.errorCode | string | Nowithin data | Stable diagnostic code when execution or cleanup reports a failure. |
data.requestedAt | string · format: date-timeValidation 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 data | Cleanup request time as a UTC date-time string. |
data.completedAt | string · format: date-timeValidation 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 data | Cleanup completion time as a UTC date-time string. |
data.scope | string · values: "platform_records" | "environment_online_content" | Yeswithin data | Online content scope whose cleanup is acknowledged by this receipt. |
data.physicalErasure | string · values: "not_verified" | Yeswithin data | Whether physical storage erasure is verified by this receipt. Online cleanup does not prove physical erasure. |
data.backupErasure | string · values: "operator_managed" | Yeswithin data | Backup cleanup boundary; operator-managed rather than verified by Platform receipts. |
data.providerErasure | string · values: "provider_managed" | Yeswithin data | Provider-held copy boundary; managed by the provider rather than verified by Platform receipts. |
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.
| Field | Type and constraints | Required | Description |
|---|---|---|---|
error | object · extra fields rejected | Yes | Structured failure information. Inspect the stable code and retain the request ID for investigation. |
error.code | string | Yeswithin error | Stable error code used to distinguish failures programmatically. |
error.message | string | Yeswithin error | Human-readable diagnostic text. |
error.requestId | string | Yeswithin error | Request identifier for correlating diagnostics and support investigations. |
error.details | any | Nowithin error | Optional structured error context. Its shape is specific to the service failure. |
error.loginUrl | string | Nowithin error | Authentication URL supplied when a browser login is required. |
error.registrationOpen | boolean | Nowithin error | Whether new account registration is enabled for this deployment. |
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
/v1/deletions/{deletionId}Authentication: Platform API bearer token
Parameters and headers
| Field | Type and constraints | Required | Description |
|---|---|---|---|
path: deletionId | string · min length 1 | Yes | Durable deletion receipt identifier; remains readable after Environment removal. |
Request example
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
| Field | Type and constraints | Required | Description |
|---|---|---|---|
data | object · extra fields rejected | Yes | Durable asynchronous cleanup receipt. Completion applies only to its declared online-content scope. |
data.id | string | Yeswithin data | Resource identifier used to read or manage this resource. |
data.environmentId | string | Yeswithin data | Environment identifier. It must belong to the caller’s account or Project. |
data.runId | string | Nowithin data | Run identifier within the named Environment and, where applicable, Session. |
data.kind | string · values: "run_content" | "environment" | Yeswithin data | Whether cleanup covers a Run’s Platform records or the entire Environment’s online content. |
data.status | string · values: "pending" | "processing" | "completed" | Yeswithin data | Asynchronous cleanup state; completed confirms only the receipt’s declared scope. |
data.attempts | integer · ≥ -9007199254740991; ≤ 9007199254740991 | Yeswithin data | Number of cleanup attempts recorded for this deletion. |
data.errorCode | string | Nowithin data | Stable diagnostic code when execution or cleanup reports a failure. |
data.requestedAt | string · format: date-timeValidation 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 data | Cleanup request time as a UTC date-time string. |
data.completedAt | string · format: date-timeValidation 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 data | Cleanup completion time as a UTC date-time string. |
data.scope | string · values: "platform_records" | "environment_online_content" | Yeswithin data | Online content scope whose cleanup is acknowledged by this receipt. |
data.physicalErasure | string · values: "not_verified" | Yeswithin data | Whether physical storage erasure is verified by this receipt. Online cleanup does not prove physical erasure. |
data.backupErasure | string · values: "operator_managed" | Yeswithin data | Backup cleanup boundary; operator-managed rather than verified by Platform receipts. |
data.providerErasure | string · values: "provider_managed" | Yeswithin data | Provider-held copy boundary; managed by the provider rather than verified by Platform receipts. |
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.
| Field | Type and constraints | Required | Description |
|---|---|---|---|
error | object · extra fields rejected | Yes | Structured failure information. Inspect the stable code and retain the request ID for investigation. |
error.code | string | Yeswithin error | Stable error code used to distinguish failures programmatically. |
error.message | string | Yeswithin error | Human-readable diagnostic text. |
error.requestId | string | Yeswithin error | Request identifier for correlating diagnostics and support investigations. |
error.details | any | Nowithin error | Optional structured error context. Its shape is specific to the service failure. |
error.loginUrl | string | Nowithin error | Authentication URL supplied when a browser login is required. |
error.registrationOpen | boolean | Nowithin error | Whether new account registration is enabled for this deployment. |
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
/v1/deletionsAuthentication: Platform API bearer token
Parameters and headers
| Field | Type and constraints | Required | Description |
|---|---|---|---|
query: environmentId | string | No | Filter receipts or audit facts by this Environment identifier within the token’s scope. |
Request example
curl \
"https://api.sandpi.ai/v1/deletions" \
-H "Authorization: Bearer $SANDPI_API_TOKEN"No request body.
Responses
200 Successful response.Response body application/json
| Field | Type and constraints | Required | Description |
|---|---|---|---|
data | array | Yes | Successful result wrapped by the API. The child fields describe its content. |
data[] | object · extra fields rejected | Yeseach array item | Durable asynchronous cleanup receipt. Completion applies only to its declared online-content scope. |
data[].id | string | Yeseach array item | Resource identifier used to read or manage this resource. |
data[].environmentId | string | Yeseach array item | Environment identifier. It must belong to the caller’s account or Project. |
data[].runId | string | Noeach array item | Run identifier within the named Environment and, where applicable, Session. |
data[].kind | string · values: "run_content" | "environment" | Yeseach array item | Whether cleanup covers a Run’s Platform records or the entire Environment’s online content. |
data[].status | string · values: "pending" | "processing" | "completed" | Yeseach array item | Asynchronous cleanup state; completed confirms only the receipt’s declared scope. |
data[].attempts | integer · ≥ -9007199254740991; ≤ 9007199254740991 | Yeseach array item | Number of cleanup attempts recorded for this deletion. |
data[].errorCode | string | Noeach array item | Stable diagnostic code when execution or cleanup reports a failure. |
data[].requestedAt | string · format: date-timeValidation 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 item | Cleanup request time as a UTC date-time string. |
data[].completedAt | string · format: date-timeValidation 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 item | Cleanup completion time as a UTC date-time string. |
data[].scope | string · values: "platform_records" | "environment_online_content" | Yeseach array item | Online content scope whose cleanup is acknowledged by this receipt. |
data[].physicalErasure | string · values: "not_verified" | Yeseach array item | Whether physical storage erasure is verified by this receipt. Online cleanup does not prove physical erasure. |
data[].backupErasure | string · values: "operator_managed" | Yeseach array item | Backup cleanup boundary; operator-managed rather than verified by Platform receipts. |
data[].providerErasure | string · values: "provider_managed" | Yeseach array item | Provider-held copy boundary; managed by the provider rather than verified by Platform receipts. |
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.
| Field | Type and constraints | Required | Description |
|---|---|---|---|
error | object · extra fields rejected | Yes | Structured failure information. Inspect the stable code and retain the request ID for investigation. |
error.code | string | Yeswithin error | Stable error code used to distinguish failures programmatically. |
error.message | string | Yeswithin error | Human-readable diagnostic text. |
error.requestId | string | Yeswithin error | Request identifier for correlating diagnostics and support investigations. |
error.details | any | Nowithin error | Optional structured error context. Its shape is specific to the service failure. |
error.loginUrl | string | Nowithin error | Authentication URL supplied when a browser login is required. |
error.registrationOpen | boolean | Nowithin error | Whether new account registration is enabled for this deployment. |
Example
{
"error": {
"code": "platform_balance_insufficient",
"message": "Top up Platform credits before submitting a Run.",
"requestId": "req_example"
}
}Select the right operation
| Goal | Operation | Effect |
|---|---|---|
| Undo a task and later work | Run rollback | Restores a preceding checkpoint; retains charges |
| Clear a Run’s API content | Run content deletion | Erases Platform records; retains workspace and settlement facts |
| Remove an online workspace | Environment deletion | Deletes 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
/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
| Field | Type and constraints | Required | Description |
|---|---|---|---|
path: environmentId | string · min length 1 | Yes | Environment identifier. It must belong to the caller’s account or Project. |
Request example
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.
| Field | Type and constraints | Required | Description |
|---|---|---|---|
error | object · extra fields rejected | Yes | Structured failure information. Inspect the stable code and retain the request ID for investigation. |
error.code | string | Yeswithin error | Stable error code used to distinguish failures programmatically. |
error.message | string | Yeswithin error | Human-readable diagnostic text. |
error.requestId | string | Yeswithin error | Request identifier for correlating diagnostics and support investigations. |
error.details | any | Nowithin error | Optional structured error context. Its shape is specific to the service failure. |
error.loginUrl | string | Nowithin error | Authentication URL supplied when a browser login is required. |
error.registrationOpen | boolean | Nowithin error | Whether new account registration is enabled for this deployment. |
Example
{
"error": {
"code": "platform_balance_insufficient",
"message": "Top up Platform credits before submitting a Run.",
"requestId": "req_example"
}
}