RecoupGet a Free AuditFree Audit

API REFERENCE

Update Snapshot

On this page
PATCH/api/sandboxes

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.

Authentication

See the authentication guide for API key and account access requirements.

Request

cURL
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

snapshotIdstring

The snapshot ID to set for the account. This snapshot will be used as the base environment when creating new sandboxes.

github_repostring

The GitHub repository URL to associate with the account's sandbox environment. Must be a valid URL.

format: uri

account_idstring

UUID 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_idstringrequired

The account ID this snapshot belongs to

format: uuid

snapshot_idstringrequired

The snapshot ID that was set for the account

expires_atstringrequired

When the snapshot expires

format: date-time

github_repostringrequirednullable

The GitHub repository URL associated with the sandbox

created_atstringrequirednullable

When the snapshot record was created

format: date-time

400Bad request - invalid snapshot ID

application/json

errorstringrequired

Error message describing what went wrong

401Unauthorized - invalid or missing API key

application/json

errorstringrequired

Error 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

errorstringrequired

Error message describing what went wrong

Full specification

Download the OpenAPI file for complete schemas, constraints, and examples.

Download content.json
View operation source
json
{
  "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"
          }
        }
      }
    }
  }
}