sandpi/ platform

Operate

Audit & exports

Query Platform operations and signed Sandbox0 runtime facts.

On this page

Platform operation facts

GET /v1/audit/events provides 90-day Platform operation facts. They contain only caller/user/API-key identity, Project/Environment/Run IDs, operation ID, route action, phase, outcome, HTTP status and time. Prompts, file bodies, raw errors, tokens and arbitrary request attributes are excluded. Both API and console operations are recorded. X-Operation-Id correlates an API call's attempt/result; a missing result means the outcome is unconfirmed. 202 results mean accepted. Admission is persisted before handler execution; failure to persist a normal response's result returns an audit-unavailable error and may follow an executed operation. Retry with the original idempotency key and reconcile by operation ID.

Filters and pagination

Filter by environmentId, runId, action, startTime and endTime. Use after and response nextCursor for chronological pagination, with limit up to 200. GET /v1/audit/events/export returns one NDJSON page; use X-Next-Cursor as after and a fixed endTime to export a stable window. Export access is recorded. Platform facts are separate from harness transcripts and are not presented as cryptographically tamper-proof.

Platform and runtime boundaries

GET /v1/environments/{environmentId}/audit/events proxies authorized Sandbox0 canonical signed facts, preserving original field names and integrity information. It requires the Sandbox0 enterprise audit feature, sandboxaudit:read, and a working audit backend. Disabled or unavailable auditing is an error, never an empty success. Queries default to the last 15 minutes. Specify startTime/endTime for historical windows and paginate with cursor. Sandbox0 retention follows the deployment configuration, independently of Platform's 90-day ledger. Platform and Sandbox0 operation IDs are separate: time overlap alone is not a causal link. Neither ledger guarantees every guest command/syscall is captured.

Console equivalents use /api/v1/platform/ and browser-cookie authentication. Team admins manage Project retention and deletion; Project API keys have authority within their Project. The console's Data & audit view lists deletion receipts, exports Platform facts and queries signed runtime facts. Environment pages set retention; Run pages request manual content erasure.

Query content-free Platform operation facts

GET /v1/audit/events

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.
query: runIdstringNoFilter receipts or audit facts by this Run identifier within the token’s scope.
query: actionstring · max length 200NoFilter facts by their recorded operation or route action.
query: afterstring · default: "0"
Validation pattern^\d{1,19}$
NoLast processed event ID or pagination cursor. Return only subsequent records; retain it when reconnecting or fetching another page.
query: startTimestring · 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))$
NoBeginning of the UTC query window, expressed as an ISO date-time string.
query: endTimestring · 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))$
NoEnd of the UTC query window. Keep it fixed across pages when exporting a stable window.
query: limitinteger · default: 100; ≥ 1; ≤ 200NoMaximum records returned in this page; inspect nextCursor or the export cursor header before ending pagination.

Request example

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

No request body.

Responses

200 Successful response.
Response body application/json
FieldType and constraintsRequiredDescription
dataobject · extra fields rejectedYesSuccessful result wrapped by the API. The child fields describe its content.
data.itemsarrayYeswithin dataRecords returned by this paginated operation.
data.items[]object · extra fields rejectedYeseach array itemContent-free operation attempt or result, separate from native transcripts and signed Sandbox0 facts.
data.items[].idstringYeseach array itemResource identifier used to read or manage this resource.
data.items[].projectIdstringNoeach array itemTeam Project identifier associated with this resource.
data.items[].actorUserIdstringYeseach array itemUser identity associated with the operation actor.
data.items[].actorKindstring · values: "user" | "api_key" | "service"Yeseach array itemWhether the operation actor is a user, API key or service.
data.items[].apiKeyIdstringNoeach array itemAPI key identity for key-authenticated operations; never the secret token.
data.items[].environmentIdstringNoeach array itemEnvironment identifier. It must belong to the caller’s account or Project.
data.items[].runIdstringNoeach array itemRun identifier within the named Environment and, where applicable, Session.
data.items[].operationIdstringYeseach array itemAudit correlation identifier for this operation attempt or result.
data.items[].actionstringYeseach array itemOperation or route action recorded by the audit ledger.
data.items[].phasestring · values: "attempt" | "result"Yeseach array itemWhether this fact records an attempt or its result.
data.items[].outcomestring · values: "accepted" | "succeeded" | "denied" | "failed" | "unknown"Yeseach array itemRecorded operation outcome; accepted denotes asynchronous admission rather than completion.
data.items[].httpStatusinteger · ≥ -9007199254740991; ≤ 9007199254740991Noeach array itemHTTP response status recorded for the operation result.
data.items[].occurredAtstring · 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 itemAudit fact time as a UTC date-time string.
data.nextCursorstringNowithin dataCursor to send as after when retrieving the next page.
Example
Example
{
  "data": {
    "items": [
      {
        "id": "",
        "actorUserId": "",
        "actorKind": "user",
        "operationId": "",
        "action": "",
        "phase": "attempt",
        "outcome": "accepted",
        "occurredAt": "2026-10-12T01:00:00Z"
      }
    ]
  }
}
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"
  }
}

Export a stable window

Choose a fixed endTime before the first request. Download one NDJSON page at a time, then set after to the returned X-Next-Cursor and keep that same time window until pagination ends. Do not treat one page as a complete export.

Export one page of Platform audit facts as NDJSON

GET /v1/audit/events/export

Up to 200 facts per page. Continue with the X-Next-Cursor response header as the after query value. Export access is audited.

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.
query: runIdstringNoFilter receipts or audit facts by this Run identifier within the token’s scope.
query: actionstring · max length 200NoFilter facts by their recorded operation or route action.
query: afterstring · default: "0"
Validation pattern^\d{1,19}$
NoLast processed event ID or pagination cursor. Return only subsequent records; retain it when reconnecting or fetching another page.
query: startTimestring · 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))$
NoBeginning of the UTC query window, expressed as an ISO date-time string.
query: endTimestring · 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))$
NoEnd of the UTC query window. Keep it fixed across pages when exporting a stable window.
query: limitinteger · default: 100; ≥ 1; ≤ 200NoMaximum records returned in this page; inspect nextCursor or the export cursor header before ending pagination.

Request example

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

No request body.

Responses

200 Successful response.
Response headers
FieldType and constraintsRequiredDescription
X-Next-CursorstringNoContinue with this value as after. Absent on the last page.
Response body application/x-ndjson
FieldType and constraintsRequiredDescription
bodystringYes—
Example
Example
""
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"
  }
}

Query signed runtime facts

Use the Environment runtime audit operation for Sandbox0’s original signed facts. Specify a historical time window explicitly; its default is the last 15 minutes. Follow its cursor, separately from the Platform audit after cursor.

Query Sandbox0 canonical signed audit facts for an authorized Environment

GET /v1/environments/{environmentId}/audit/events

Preserves original Sandbox0 field names and integrity information. Requires the deployment's Sandbox0 audit license, read permission and backend. Backend unavailability is an error, never an empty success. Retention is the Sandbox0 deployment policy. Does not claim every guest syscall is audited. Queries default to the 15 minutes ending at endTime (or now). Supply startTime/endTime for historical windows; paginate with cursor. Unbounded backend scans are not used by default.

Authentication: Platform API bearer token

Parameters and headers
FieldType and constraintsRequiredDescription
query: startTimestring · 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))$
NoBeginning of the query window. Defaults to 15 minutes before endTime.
query: endTimestring · 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))$
NoEnd of the query window. Defaults to now.
query: cursorstring · max length 8192NoOpaque cursor returned by the previous signed Sandbox0 audit page.
query: actionstring · max length 200NoFilter facts by their recorded operation or route action.
query: limitinteger · default: 100; ≥ 1; ≤ 200NoMaximum records returned in this page; inspect nextCursor or the export cursor header before ending pagination.
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/audit/events" \
    -H "Authorization: Bearer $SANDPI_API_TOKEN"

No request body.

Responses

200 Successful response.
Response body application/json
FieldType and constraintsRequiredDescription
dataobjectYesSuccessful result wrapped by the API. The child fields describe its content.
data.{key}anyNoadditional keys—
Example
Example
{
  "data": {}
}
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"
  }
}

Investigate an unconfirmed outcome

Keep the X-Operation-Id and query the affected resource before retrying a mutation. An attempt without a result is not proof that nothing happened. Reuse an existing idempotency key where supported. See errors and retries.