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

# Create snapshot

> Create a persistent snapshot from the sandbox's current state. Snapshots can be used to create new sandboxes and persist beyond the original sandbox's lifetime.



## OpenAPI

````yaml /openapi-public.yml post /sandboxes/{sandboxID}/snapshots
openapi: 3.1.0
info:
  title: E2B API
  version: 0.1.0
  description: >-
    Complete E2B developer API. Platform endpoints are served on api.e2b.app.
    Sandbox endpoints (envd) are served on the shared sandbox host
    (sandbox.e2b.app); target a specific sandbox with the E2b-Sandbox-Id and
    E2b-Sandbox-Port headers.
servers:
  - url: https://api.e2b.app
    description: E2B Platform API
security: []
tags:
  - name: Sandboxes
  - name: Templates
  - name: Tags
  - name: Volumes
  - name: Envd
  - name: Filesystem
  - name: Process
  - name: Teams
paths:
  /sandboxes/{sandboxID}/snapshots:
    servers:
      - url: https://api.e2b.app
        description: E2B Platform API
    post:
      tags:
        - Sandboxes
      summary: Create snapshot
      description: >-
        Create a persistent snapshot from the sandbox's current state. Snapshots
        can be used to create new sandboxes and persist beyond the original
        sandbox's lifetime.
      operationId: postSandboxSnapshots
      parameters:
        - $ref: '#/components/parameters/sandboxID'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SandboxSnapshotRequest'
      responses:
        '201':
          description: Snapshot created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnapshotInfo'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '404':
          $ref: '#/components/responses/404'
        '500':
          $ref: '#/components/responses/500'
      security:
        - ApiKeyAuth: []
components:
  parameters:
    sandboxID:
      name: sandboxID
      in: path
      required: true
      schema:
        type: string
  schemas:
    SandboxSnapshotRequest:
      type: object
      properties:
        name:
          type: string
          description: >-
            Optional name for the snapshot template. If a snapshot template with
            this name already exists, a new build will be assigned to the
            existing template instead of creating a new one.
    SnapshotInfo:
      type: object
      required:
        - snapshotID
        - names
      properties:
        snapshotID:
          type: string
          description: >-
            Identifier of the snapshot template including the tag. Uses
            namespace/alias when a name was provided (e.g.
            team-slug/my-snapshot:default), otherwise falls back to the raw
            template ID (e.g. abc123:default).
        names:
          type: array
          items:
            type: string
          description: >-
            Full names of the snapshot template including team namespace and tag
            (e.g. team-slug/my-snapshot:v2)
    Error:
      required:
        - code
        - message
      properties:
        code:
          type: integer
          format: int32
          description: Error code
        message:
          type: string
          description: Error
      type: object
  responses:
    '400':
      description: Bad request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '401':
      description: Authentication error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '404':
      description: Not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    '500':
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key

````