API REFERENCE
Update Snapshot
On this page
/api/sandboxesSet a custom snapshot ID for an account. By default, updates the key owner's account. Pass account_id to target a specific account the API key has access to. This allows accounts to use a specific sandbox snapshot when creating new sandboxes, enabling reproducible environments with pre-configured tools, dependencies, and files.
Authentication
See the authentication guide for API key and account access requirements.
Request
curl --request PATCH \
--url 'https://api.recoupable.dev/api/sandboxes' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{}'Request body required
Snapshot configuration parameters
application/json
snapshotIdstringThe snapshot ID to set for the account. This snapshot will be used as the base environment when creating new sandboxes.
github_repostringThe GitHub repository URL to associate with the account's sandbox environment. Must be a valid URL.
format: uri
account_idstringUUID of the account to update the snapshot for. Only applicable when the authenticated account has access to multiple accounts via organization membership. If not provided, updates the snapshot for the API key's own account.
format: uuid
Responses
200Snapshot ID updated successfully+
application/json
account_idstringrequiredThe account ID this snapshot belongs to
format: uuid
snapshot_idstringrequiredThe snapshot ID that was set for the account
expires_atstringrequiredWhen the snapshot expires
format: date-time
github_repostringrequirednullableThe GitHub repository URL associated with the sandbox
created_atstringrequirednullableWhen the snapshot record was created
format: date-time
400Bad request - invalid snapshot ID+
application/json
errorstringrequiredError message describing what went wrong
401Unauthorized - invalid or missing API key+
application/json
errorstringrequiredError message describing what went wrong
403Forbidden - account_id is not a member of the organization or account tried to use an account_id they don't have access to+
application/json
errorstringrequiredError message describing what went wrong
Full specification
Download the OpenAPI file for complete schemas, constraints, and examples.
Download content.jsonView operation source
{
"description": "Set a custom snapshot ID for an account. By default, updates the key owner's account. Pass account_id to target a specific account the API key has access to. This allows accounts to use a specific sandbox snapshot when creating new sandboxes, enabling reproducible environments with pre-configured tools, dependencies, and files.",
"requestBody": {
"description": "Snapshot configuration parameters",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateSnapshotRequest"
}
}
}
},
"responses": {
"200": {
"description": "Snapshot ID updated successfully",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/UpdateSnapshotResponse"
}
}
}
},
"400": {
"description": "Bad request - invalid snapshot ID",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SandboxErrorResponse"
}
}
}
},
"401": {
"description": "Unauthorized - invalid or missing API key",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SandboxErrorResponse"
}
}
}
},
"403": {
"description": "Forbidden - account_id is not a member of the organization or account tried to use an account_id they don't have access to",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/SandboxErrorResponse"
}
}
}
}
}
}