Delete v1sandboxes logs
DeleteSandboxLogs deletes a sandbox’s stored logs: the stored stdout and stderr history that ListSandboxLogs serves. Only an ended sandbox’s logs can be deleted. The creating user, or a caller with the sandbox_admin action in the sandbox’s organization, can delete them; a caller who cannot see the sandbox gets the same error as GetSandbox.
From the moment the call returns, ListSandboxLogs refuses the sandbox with CWSANDBOX_LOGS_DELETED; a page already being served may still complete. Under normal load, while the service is healthy, the lines are removed from log storage within 24 hours of the request; the storage’s object store and backups follow on the managed storage service’s own schedule. The delete covers the stored history this API serves, not copies in node-local files or in CoreWeave’s internal operational logging. DeleteSandbox stops a sandbox and leaves its stored logs readable; it does not delete them.
The call is idempotent: repeating it returns the first call’s deleted_at. It also succeeds for an ended sandbox whose logs were never stored or have expired.
Errors:
- FAILED_PRECONDITION (CWSANDBOX_SANDBOX_NOT_TERMINAL): the sandbox has not ended. Stop it, then retry.
- FAILED_PRECONDITION (CWSANDBOX_LOGS_NOT_ENABLED): stored logs are not enabled for the organization.
- RESOURCE_EXHAUSTED (CWSANDBOX_LOG_QUERY_LIMIT_EXCEEDED) with RetryInfo: the organization made more than 10 deletes in the current second, or too many stored-log calls are in flight. Retry after the delay.
- UNAVAILABLE (CWSANDBOX_LOG_BACKEND_UNAVAILABLE) with RetryInfo: the stored-log backend is unavailable. Retry after the delay.
- UNAVAILABLE (CWSANDBOX_FEATURE_FLAG_UNAVAILABLE): whether stored logs are enabled could not be determined. Retry later.
- UNAVAILABLE (CWSANDBOX_BACKEND_UNAVAILABLE) with RetryInfo: the sandbox’s stored-log state could not be read. Retry after the delay.
- UNIMPLEMENTED (CWSANDBOX_NOT_IMPLEMENTED): the deployment does not serve stored logs.