Follow a durable operation
Every long mutation returns an operation with ID, sandbox ID, type, status, step, generation, attempt counters, deadline, retryability, compensation requirement, timestamps, and optional failure/result data.succeeded, surface the failure rather than returning a partial resource as success.
Consume sandbox events
Events use a versioned envelope:sequence. Delivery is at least once, so consumers must deduplicate by event ID and commit their last fully processed sequence. On reconnect, pass after_sequence; after a gap, refetch current resource state.
The catalog covers lifecycle/readiness, executions/processes, snapshots/volumes, policy application, and quota warnings/exceeded events. Do not infer a global ordering across sandboxes or endpoints.
Create and verify a webhook
Create endpoints only at HTTPS destinations. Subscribe to exact event types or supported prefixes such assandbox.snapshot.*:
HMAC-SHA256(timestamp + "." + rawBody), the v1= signature, constant-time equality, and a timestamp tolerance.
- Reject events outside your accepted API versions/types.
- Deduplicate by event ID or delivery ID in durable storage.
- Enqueue work, then return a success response quickly.
- Make handlers idempotent because retries and manual replay can duplicate delivery.
- Never fetch a URL from event data without applying your own validation.
Delivery history and replay
GET /api/v1/webhook-deliveries filters by endpoint or sandbox. Detail includes status, attempt count, next retry, safe response excerpt, error code, and each attempt’s timing/status. States are pending, delivering, succeeded, and dead_letter.
POST /api/v1/webhook-deliveries/{deliveryId}/replay requires an idempotency key and creates a new signed delivery attempt from the original immutable event. Replay is permission-controlled, rate-limited, and audited. It does not create a new domain event.
Repeated failures may disable an endpoint. Fix TLS/DNS/response behavior, rotate a compromised signing secret, then explicitly re-enable according to policy.
Usage and quotas
GET /api/v1/usage accepts start, end, timezone, sandbox_id, and group_by (sandbox, project, team, profile, tag, or product_source). Records contain metric, quantity, unit, exact window, and safe metadata. GET /api/v1/usage/export returns server-generated CSV for the same filters.
Billable meters can include reserved CPU seconds, reserved memory GB-seconds, active/sleeping disk GB-hours, snapshot/artifact storage, public egress, and optional execution/browser units. Price is separate from raw usage. Show an estimate only when the response provides an authoritative complete catalog, currency, and qualification; otherwise show units and quotas without inventing cost.
Audit history
GET /api/v1/audit-events is permission-controlled and cursor-paginated. Filter by actor, action, target type/ID, outcome, source, and time range. Audit entries record actor, action, target, outcome, source, request/correlation ID, and safe change metadata.
Events and audit are not interchangeable: events drive resource integrations, while audit establishes accountable activity including denied or failed actions. Neither may contain secret plaintext, terminal tickets, signed URLs, or internal worker credentials.
API and SDKs
Review endpoint and client conventions.
Troubleshooting
Build a safe diagnostic bundle.