Experimental
This API is experimental. Features, interfaces, and behavior may change.
Hosted API
Docker Sandboxes API
API v1 · 60 operations · 188 named schemas
Overview
Use this API to create sandboxes, run processes, work with files, and manage sandbox resources. Start with a kit through the SDK, or use the HTTP operations here directly.
Management requests use an Authorization bearer token. File and process requests go to the sandbox endpoint in core.endpoint.uri and require a short-lived scoped endpoint credential, not the management token. The SDK obtains that credential for you. Each operation also checks its declared permissions. Direct Unix socket access uses the operating system's socket access controls instead of HTTP authentication. Interactive WebSocket operations describe their supported credential transports separately.
The Docker Cloud API base URL is https://connect.docker.com/sandboxes. Append each /v1 path without removing the base URL's path prefix. For sandbox endpoint operations, use the sandbox endpoint as the base URL instead.
Operations list their success and error responses. A 202 response means work is still in progress; read the resource until it reaches the expected state. Errors contain a stable code, a message, and optional details. Inspect the code as well as the HTTP status.
Send the current ETag in If-Match when an operation requires it. Operations that accept Idempotency-Key use that HTTP header to identify retries: the same key and payload return the first result; a different payload fails. Keys are retained for at least 24 hours.
Lists use pageSize and pageToken. Continue with nextPageToken until it is empty. Supported filters and ordering are listed on each operation. Resource names contain immutable identifiers; displayName is a label. A 64-bit integer is returned as a JSON string; inputs accept a number or a string.
Connecting to the Docker Sandboxes API
bearer
sandboxBearer
sandboxWebSocketBearer
https://connect.docker.com/sandboxesFiles
Processes
Credentials
Images
MCP gateways
Network policies
Sandboxes
Secrets
Snapshots
Volumes
Operations
/v1/files List lists directory entries by path ascending.
DELETE/v1/files Remove deletes a path.
GET/v1/files/content ReadFile returns raw file content over HTTP; Stat exposes file metadata.
PUT/v1/files/content WriteFile accepts raw content with path and mode query parameters.
PUT/v1/files/directories Mkdir creates a directory.
GET/v1/files/download Download streams file headers, bytes, and per-file errors.
POST/v1/files/move Move renames or moves a path.
GET/v1/files/stat Stat reads metadata for one path.
POST/v1/files/upload Upload streams one or more files.
POST/v1/identity/exchange ExchangeDockerCredential consumes an identity token once for the authenticated owner.
GET/v1/images ListImages lists images in the caller's owner scope.
POST/v1/images CreateImage registers pushed OCI content or disk content derived from a snapshot or sandbox.
GET/v1/images/{image} GetImage reads one image by its resource name.
DELETE/v1/images/{image} DeleteImage deletes an image; deleting an already absent image succeeds.
GET/v1/images/{image}/pull-spec GetImagePullSpec returns short-lived pull material through registry-transfer support.
GET/v1/mcp-servers/{mcpServer}/authorization GetMcpAuthorization reads the owner-scoped flow, including its pending URL, under mcp.write.
POST/v1/mcp-servers/{mcpServer}/authorization/authorize AuthorizeMcpServer authorizes credentials for one named upstream.
GET/v1/network-policies GetNetworkPolicies returns effective and exact views of the same installed generation.
GET/v1/policy-logs ListPolicyLogEntries lists observed policy decisions.
GET/v1/processes ListProcesses lists processes in creation order.
POST/v1/processes CreateProcess starts a durable interactive process and returns its resource name.
POST/v1/processes/exec Exec runs one command to completion.
GET/v1/processes/{process} GetProcess reads one process by its endpoint-scoped resource name.
GET/v1/processes/{process}/interact Interact binds the complete process name from the path to the first Attach frame.
GET/v1/processes/{process}/output ReadOutput returns one page of retained output after a stream_sequence, the same cursor Interact resumes from, so a REST client can read what a process printed.
POST/v1/processes/{process}/signal Signal sends one signal to an existing process.
GET/v1/sandboxes ListSandboxes lists sandboxes in the caller's owner scope.
POST/v1/sandboxes CreateSandbox admits a sandbox.
GET/v1/sandboxes/{sandbox} GetSandbox reads one sandbox by its resource name.
DELETE/v1/sandboxes/{sandbox} DeleteSandbox returns the deleting resource while work remains, or an empty message when absent.
PATCH/v1/sandboxes/{sandbox} UpdateSandbox changes only the display label under the observed etag.
POST/v1/sandboxes/{sandbox}/endpoint-credentials CreateEndpointCredential grants short-lived access to one sandbox endpoint.
GET/v1/sandboxes/{sandbox}/mcp-gateway GetMcpGateway reads gateway state for the sandbox.
POST/v1/sandboxes/{sandbox}/mcp-gateway/servers AddMcpGatewayServer adds one server to an existing ready gateway.
POST/v1/sandboxes/{sandbox}/mcp-gateway/start StartMcpGateway ensures a gateway exists for the sandbox.
POST/v1/sandboxes/{sandbox}/mcp-gateway/stop StopMcpGateway stops or detaches the gateway and succeeds when already absent.
GET/v1/sandboxes/{sandbox}/network-policies GetNetworkPolicies returns effective and exact views of the same installed generation.
GET/v1/sandboxes/{sandbox}/policy-logs ListPolicyLogEntries lists observed policy decisions.
GET/v1/sandboxes/{sandbox}/ports ListPorts lists currently published ports for one sandbox.
POST/v1/sandboxes/{sandbox}/ports CreatePort makes one sandbox port reachable outside the sandbox.
GET/v1/sandboxes/{sandbox}/ports/{port} GetPort reads one published port by its resource name.
DELETE/v1/sandboxes/{sandbox}/ports/{port} DeletePort withdraws one published port.
POST/v1/sandboxes/{sandbox}/renew-timeout RenewSandboxTimeout sets a TTL when timeout renewal is supported.
POST/v1/sandboxes/{sandbox}/snapshots CreateSnapshot checkpoints a running sandbox; a stopped source is rejected.
POST/v1/sandboxes/{sandbox}/ssh-certificates IssueSSHCert signs a caller-held public key for sandbox SSH access.
POST/v1/sandboxes/{sandbox}/start StartSandbox starts a stopped sandbox; a backend that preserved memory resumes it.
POST/v1/sandboxes/{sandbox}/stop StopSandbox stops a running sandbox; a backend advertising memory preservation hibernates it.
GET/v1/secrets ListSecrets lists secret metadata in the caller's owner scope.
POST/v1/secrets CreateSecret stores new secret material.
GET/v1/secrets/{secret} GetSecret reads one secret's metadata; material is never returned.
PUT/v1/secrets/{secret} UpdateSecret replaces secret metadata and material.
DELETE/v1/secrets/{secret} DeleteSecret deletes a secret; deleting an already absent secret succeeds.
GET/v1/snapshots ListSnapshots lists snapshots in the caller's owner scope.
GET/v1/snapshots/{snapshot} GetSnapshot reads one snapshot by its resource name.
DELETE/v1/snapshots/{snapshot} DeleteSnapshot deletes a snapshot; deleting an already absent snapshot succeeds.
POST/v1/snapshots/{snapshot}/restore RestoreSnapshot forks a new sandbox from a snapshot.
GET/v1/volumes ListVolumes lists volumes in the caller's owner scope.
POST/v1/volumes CreateVolume creates a persistent volume.
GET/v1/volumes/{volume} GetVolume reads one volume by its resource name.
DELETE/v1/volumes/{volume} DeleteVolume deletes a volume; deleting an already absent volume succeeds.Schemas
AddMcpGatewayServerResponseAppliedKitAttachmentModeAttributedRuleBadRequestBadRequestErrorDetailBadRequestFieldViolationCaptureModeCreateImageRequestCreatePortRequestPortInputCreateProcessRequestCreateSandboxRequestCreateSecretRequestCreateVolumeRequestCredentialFenceReceiptCustomInjectionCustomSecretMaterialDebugInfoDebugInfoErrorDetailDeleteSecretResponseDurationEffectiveCoreLifecycleEffectiveFeaturesEffectiveManagedVolumesEffectiveNetworkPolicyEffectiveTimeoutsEffectiveVolumeAttachmentEndpointAuthenticationEndpointAuthenticationSchemeEndpointCredentialEndpointCredentialTransportErrorErrorCodeErrorDetailErrorInfoErrorInfoErrorDetailEtagMismatchEtagMismatchErrorDetailExactDestinationExactDestinationKindExactNetworkPolicyExactPolicyConstantExactPolicyNodeExactPolicyOperandsExactPolicyOriginExactPolicySourceExchangeCompositionCredentialResponseExecRequestExecResponseFeatureOptionsFileErrorFileHeaderFileInfoFileTypeFilesDownloadRequestFilesDownloadResponseFilesListResponseFilesMkdirRequestFilesMkdirResponseFilesMoveRequestFilesMoveResponseFilesReadFileRequestFilesReadFileResponseFilesRemoveResponseFilesStatResponseFilesUploadRequestFilesUploadResponseFilesWriteFileRequestFilesWriteFileResponseGetNetworkPoliciesResponseHelpHelpErrorDetailHelpLinkIdentityExchangeServiceExchangeDockerCredentialRequestImageImageBlobRefImageFromImageImagePullSpecImagePushTargetImageSourceImageStatusImageSummaryInteractRequestIssueSSHCertResponseKitArtifactInputKitFieldDispositionKitFieldOutcomeKitFieldOutcomeReportKitFieldOutcomeReportErrorDetailKitFieldReasonKitInputKitRefKitStartupKitStartupCommandListImagesResponseListPolicyLogEntriesResponseListPortsResponseListProcessesResponseListSandboxesResponseListSecretsResponseListSnapshotsResponseListVolumesResponseLocalizedMessageLocalizedMessageErrorDetailManagedVolumeOptionsMcpAuthorizationMcpAuthorizationStatusMcpConfigurationModeMcpConfigurationOutcomeMcpConfigurationReportMcpConfigurationReportErrorDetailMcpConfiguredServerMcpCreateSpecMcpGatewayMcpGatewayStateMcpServerMcpServerTypeNetworkPolicyNetworkPolicyModeOAuthConfigOAuthRefreshMaterialOutputRetentionPermissionPlatformPolicyDecisionPolicyDomainPolicyLayerPolicyLogEntryPortPreconditionFailurePreconditionFailureErrorDetailPreconditionFailureViolationProcessProcessAttachProcessChunkProcessExitedProcessHeartbeatProcessOutputProcessSignalProcessStateProtocolPtyConfigPublishedPortQuotaFailureQuotaFailureErrorDetailQuotaFailureViolationRawImageStartupReadOutputResponseReceiptKindRequestInfoRequestInfoErrorDetailResourceInfoResourceInfoErrorDetailResourcesRetryInfoRetryInfoErrorDetailSandboxSandboxCoreSandboxEndpointSandboxEndpointProtocolSandboxStatusSecretSecretTypeSignalResponseSnapshotSnapshotStatusSnapshotSummaryStartupArgvStartupExecutionStopMcpGatewayResponseStopMemoryOutcomeStoredSecretOptionsStreamTypeTerminalSizeTimeoutActionTimeoutOptionsTimestampTokenSecretMaterialUnknownErrorDetailUpdateSecretBodyValidationFieldPathValidationFieldPathElementValidationFieldTypeValidationViolationValidationViolationsValidationViolationsErrorDetailVolumeVolumeAttachment