> ## Documentation Index
> Fetch the complete documentation index at: https://docs.continuouslabs.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Simulation Snapshot

> Saves a running Simulation's current state, or its state after an earlier recorded step when you set at_step, and returns the Snapshot once the state is stored. Saving does not change the Simulation. Create Simulations from the Snapshot with snapshot_id; it outlives its Simulation. A stopped Simulation returns 409 simulation_stopped. Reuse the Idempotency-Key to retry safely.



## OpenAPI

````yaml /openapi/simulation.yaml post /v1/simulation-snapshots
openapi: 3.1.0
info:
  description: >-
    Build Simulators from OpenAPI, WSDL or GraphQL documents, create Simulations
    from them, and build Worlds that run Simulations together. Authenticate
    every request with an API key sent as a Bearer token.
  title: Continuous Simulation API
  version: v1
servers:
  - description: Continuous production API.
    url: https://api.continuouslabs.ai
security: []
tags:
  - description: >-
      Build Simulators from OpenAPI, WSDL or GraphQL documents, check or cancel
      a build, clone Simulators into other workspaces, and rename and delete
      Simulators.
    name: simulators
    x-group: Simulators
  - description: >-
      Create Simulations from ready Simulators or Snapshots, then rename, stop,
      start, and delete them.
    name: simulations
    x-group: Simulations
  - description: >-
      Save a running Simulation's state as a Snapshot, create Simulations from
      it, and rename and delete it.
    name: simulation-snapshots
    x-group: Simulation Snapshots
  - description: >-
      Build Worlds from one or more Simulators, rename them, and start or stop
      their Simulations together.
    name: worlds
    x-group: Worlds
  - description: >-
      Store connections to real systems: a base URL, the header that carries the
      credential, and its value. The API never returns a value.
    name: credentials
    x-group: Credentials
paths:
  /v1/simulation-snapshots:
    post:
      tags:
        - simulation-snapshots
      summary: Create Simulation Snapshot
      description: >-
        Saves a running Simulation's current state, or its state after an
        earlier recorded step when you set at_step, and returns the Snapshot
        once the state is stored. Saving does not change the Simulation. Create
        Simulations from the Snapshot with snapshot_id; it outlives its
        Simulation. A stopped Simulation returns 409 simulation_stopped. Reuse
        the Idempotency-Key to retry safely.
      operationId: create-simulation-snapshot
      parameters:
        - description: >-
            Optional key for retrying this create safely. A retry with the same
            key and request returns the original result with its status; the
            same key with a different request returns 409 idempotency_conflict.
            Without a key, each request creates a new resource.
          in: header
          name: Idempotency-Key
          schema:
            maxLength: 256
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateSimulationSnapshotRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimulationSnapshot'
          description: Created
        '400':
          content:
            application/problem+json:
              examples:
                bad_request_body:
                  $ref: '#/components/examples/bad_request_body'
              schema:
                $ref: '#/components/schemas/Error'
          description: Bad Request
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          content:
            application/problem+json:
              examples:
                auth_forbidden_simulation:
                  $ref: '#/components/examples/auth_forbidden_simulation'
              schema:
                $ref: '#/components/schemas/Error'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              examples:
                simulation_not_found:
                  $ref: '#/components/examples/simulation_not_found'
              schema:
                $ref: '#/components/schemas/Error'
          description: Not Found
        '408':
          $ref: '#/components/responses/RequestTimeout'
        '409':
          content:
            application/problem+json:
              examples:
                clock_conflict:
                  $ref: '#/components/examples/clock_conflict'
                idempotency_conflict:
                  $ref: '#/components/examples/idempotency_conflict'
                simulation_observation_external:
                  $ref: '#/components/examples/simulation_observation_external'
                simulation_stopped:
                  $ref: '#/components/examples/simulation_stopped'
              schema:
                $ref: '#/components/schemas/Error'
          description: Conflict
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '422':
          content:
            application/problem+json:
              examples:
                validation_idempotency_key:
                  $ref: '#/components/examples/validation_idempotency_key'
                validation_snapshot_step:
                  $ref: '#/components/examples/validation_snapshot_step'
              schema:
                $ref: '#/components/schemas/Error'
          description: Unprocessable Entity
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          content:
            application/problem+json:
              examples:
                auth_provider_unavailable:
                  $ref: '#/components/examples/auth_provider_unavailable'
                internal_unavailable:
                  $ref: '#/components/examples/internal_unavailable'
                simulation_environment_offline_request:
                  $ref: '#/components/examples/simulation_environment_offline_request'
              schema:
                $ref: '#/components/schemas/Error'
          description: Service Unavailable
      security:
        - apiKeyAuth: []
components:
  schemas:
    CreateSimulationSnapshotRequest:
      additionalProperties: false
      examples:
        - at_step: 42
          name: before-refund
          simulation_id: sim_01J8Z5X4K7M2N9P0Q1R2S3T4V6
      properties:
        at_step:
          description: >-
            Completed step to save the state after. Omission saves the latest
            state.
          format: int64
          maximum: 9007199254740991
          minimum: 0
          type: integer
        name:
          description: Snapshot name.
          maxLength: 128
          minLength: 1
          type: string
        simulation_id:
          description: ID of the running Simulation to save.
          minLength: 1
          pattern: ^sim_[0-9A-HJKMNP-TV-Z]{26}$
          type: string
      required:
        - simulation_id
        - name
      type: object
    SimulationSnapshot:
      additionalProperties: false
      examples:
        - at_step: 42
          created_at: '2026-01-15T12:00:00Z'
          current_time: '2024-01-03T00:00:00Z'
          id: sns_01J8Z5X4K7M2N9P0Q1R2S3T4VC
          name: before-refund
          simulation_id: sim_01J8Z5X4K7M2N9P0Q1R2S3T4V8
          simulator_id: smr_01J8Z5X4K7M2N9P0Q1R2S3T4V5
          start_time: '2024-01-01T00:00:00Z'
      properties:
        at_step:
          description: >-
            Completed step the Snapshot saved, or null for the state that was
            latest when it was saved.
          format: int64
          type:
            - integer
            - 'null'
        created_at:
          description: Snapshot creation time.
          format: date-time
          type: string
        current_time:
          description: >-
            Simulated time of the saved state, where a Simulation created from
            the Snapshot starts.
          format: date-time
          type: string
        id:
          description: Snapshot ID.
          pattern: ^sns_[0-9A-HJKMNP-TV-Z]{26}$
          type: string
        name:
          description: Snapshot name. The ID is its identity, and names need not be unique.
          maxLength: 128
          type: string
        simulation_id:
          description: >-
            ID of the Simulation the Snapshot saved, or null once that
            Simulation is deleted.
          pattern: ^sim_[0-9A-HJKMNP-TV-Z]{26}$
          type:
            - string
            - 'null'
        simulator_id:
          description: >-
            ID of the Simulator a Simulation created from the Snapshot runs, at
            the digest its source pinned.
          pattern: ^smr_[0-9A-HJKMNP-TV-Z]{26}$
          type: string
        start_time:
          description: Initial simulated time of a Simulation created from the Snapshot.
          format: date-time
          type: string
      required:
        - id
        - name
        - simulation_id
        - simulator_id
        - at_step
        - start_time
        - current_time
        - created_at
      type: object
    Error:
      additionalProperties: false
      properties:
        code:
          description: Stable machine-readable error code.
          minLength: 1
          type: string
        detail:
          description: Safe human-readable error detail.
          minLength: 1
          type: string
        validation:
          $ref: '#/components/schemas/SpecificationValidation'
          description: >-
            Safe specification diagnostics for a rejected build request, when
            available.
      required:
        - validation
        - code
        - detail
      type: object
    SpecificationValidation:
      additionalProperties: false
      properties:
        issues:
          description: Specification validation problems. At most 20 are returned.
          items:
            $ref: '#/components/schemas/SpecificationIssue'
          maxItems: 20
          type: array
      required:
        - issues
      type:
        - object
        - 'null'
    SpecificationIssue:
      additionalProperties: false
      properties:
        code:
          description: Stable validation rule code.
          type: string
        kind:
          description: >-
            Whether the input is invalid, unsupported, incomplete, or has no
            specific diagnosis.
          enum:
            - invalid
            - unsupported
            - incomplete
            - unknown
          type: string
        location:
          description: Readable endpoint or field affected by this issue.
          maxLength: 512
          type: string
        message:
          description: What needs attention at this location.
          type: string
        operation:
          description: >-
            Affected operation ID or method and path, when available. Empty for
            document-level issues.
          maxLength: 243
          type: string
        suggestion:
          description: How to correct or address the problem.
          type: string
      required:
        - code
        - operation
        - location
        - kind
        - message
        - suggestion
      type: object
  examples:
    bad_request_body:
      value:
        code: bad_request
        detail: request body is invalid
        validation: null
    auth_forbidden_simulation:
      value:
        code: auth_forbidden
        detail: >-
          The Simulation with ID "sim_01J8Z5X4K7M2N9P0Q1R2S3T4V6" belongs to
          another workspace.
        validation: null
    simulation_not_found:
      value:
        code: simulation_not_found
        detail: No Simulation was found with ID "sim_01J8Z5X4K7M2N9P0Q1R2S3T4V6".
        validation: null
    clock_conflict:
      value:
        code: clock_conflict
        detail: A clock advance is active.
        validation: null
    idempotency_conflict:
      value:
        code: idempotency_conflict
        detail: >-
          The Idempotency-Key was already used with a different request. Use a
          new Idempotency-Key.
        validation: null
    simulation_observation_external:
      value:
        code: simulation_observation_external
        detail: >-
          The Simulation with ID "sim_01J8Z5X4K7M2N9P0Q1R2S3T4V6" runs in a
          customer environment. Continuous does not read or copy its state, so
          this operation is unavailable.
        validation: null
    simulation_stopped:
      value:
        code: simulation_stopped
        detail: >-
          The Simulation with ID "sim_01J8Z5X4K7M2N9P0Q1R2S3T4V6" is stopped.
          Start it before you retry this request.
        validation: null
    validation_idempotency_key:
      value:
        code: validation
        detail: Idempotency-Key must contain between 1 and 256 bytes
        validation: null
    validation_snapshot_step:
      value:
        code: validation
        detail: at_step does not identify a recorded step
        validation: null
    auth_provider_unavailable:
      value:
        code: auth_provider_unavailable
        detail: >-
          The authentication provider is unavailable. Retry the request after a
          short delay.
        validation: null
    internal_unavailable:
      value:
        code: internal_unavailable
        detail: >-
          The service is temporarily unavailable. Retry the request after a
          short delay.
        validation: null
    simulation_environment_offline_request:
      value:
        code: simulation_environment_offline
        detail: >-
          The runtime environment is offline. Retry the request once it
          reconnects.
        validation: null
    auth_invalid:
      value:
        code: auth_invalid
        detail: The authentication credential is invalid.
        validation: null
    auth_missing:
      value:
        code: auth_invalid
        detail: Authentication credentials are required.
        validation: null
    request_timeout:
      value:
        code: request_timeout
        detail: >-
          The request body was not received before the timeout. Retry the
          request.
        validation: null
    payload_too_large:
      value:
        code: payload_too_large
        detail: The request body exceeds the maximum allowed size.
        validation: null
    unsupported_media_type:
      value:
        code: unsupported_media_type
        detail: The request Content-Type is not supported.
        validation: null
    internal:
      value:
        code: internal
        detail: The server encountered an unexpected error.
        validation: null
  responses:
    Unauthorized:
      content:
        application/problem+json:
          examples:
            auth_invalid:
              $ref: '#/components/examples/auth_invalid'
            auth_missing:
              $ref: '#/components/examples/auth_missing'
          schema:
            $ref: '#/components/schemas/Error'
      description: Unauthorized
    RequestTimeout:
      content:
        application/problem+json:
          examples:
            request_timeout:
              $ref: '#/components/examples/request_timeout'
          schema:
            $ref: '#/components/schemas/Error'
      description: Request Timeout
    PayloadTooLarge:
      content:
        application/problem+json:
          examples:
            payload_too_large:
              $ref: '#/components/examples/payload_too_large'
          schema:
            $ref: '#/components/schemas/Error'
      description: Request Entity Too Large
    UnsupportedMediaType:
      content:
        application/problem+json:
          examples:
            unsupported_media_type:
              $ref: '#/components/examples/unsupported_media_type'
          schema:
            $ref: '#/components/schemas/Error'
      description: Unsupported Media Type
    InternalServerError:
      content:
        application/problem+json:
          examples:
            internal:
              $ref: '#/components/examples/internal'
          schema:
            $ref: '#/components/schemas/Error'
      description: Internal Server Error
  securitySchemes:
    apiKeyAuth:
      bearerFormat: Continuous API key
      description: >-
        Use a Continuous API key. Send it in the Authorization header as a
        Bearer token.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.