---
agentTools:
  projectIndex: https://dblab.readme.io/llms.txt
---

# Retrieve a snapshot

Retrieves the information for the specified snapshot.

# OpenAPI definition

```json
{
  "openapi": "3.0.1",
  "info": {
    "title": "DBLab API",
    "description": "This page provides the OpenAPI specification for the Database Lab (DBLab) API, previously recognized as the DLE API (Database Lab Engine API).",
    "contact": {
      "name": "DBLab API Support",
      "url": "https://postgres.ai/contact",
      "email": "api@postgres.ai"
    },
    "license": {
      "name": "Apache 2.0",
      "url": "https://github.com/postgres-ai/database-lab-engine/blob/dle-4-0/LICENSE"
    },
    "version": "4.0.0"
  },
  "externalDocs": {
    "description": "DBLab Docs",
    "url": "https://gitlab.com/postgres-ai/docs/tree/master/docs/database-lab"
  },
  "servers": [
    {
      "url": "https://demo.dblab.dev/api",
      "description": "DBLab 4.0 demo server (with DB branching support); token: 'demo-token'",
      "x-examples": {
        "Verification-Token": "demo-token"
      }
    },
    {
      "url": "https://demo.aws.postgres.ai:446/api",
      "description": "DBLab 3.x demo server; token: 'demo-token'",
      "x-examples": {
        "Verification-Token": "demo-token"
      }
    },
    {
      "url": "{scheme}://{host}:{port}/{basePath}",
      "description": "Any DBLab accessed locally / through SSH port forwarding",
      "variables": {
        "scheme": {
          "enum": [
            "https",
            "http"
          ],
          "default": "http",
          "description": "'http' for local connections and SSH port forwarding; 'https' for everything else."
        },
        "host": {
          "default": "localhost",
          "description": "where DBLab server is installed. Use 'localhost' to work locally or when SSH port forwarding is used."
        },
        "port": {
          "default": "2346",
          "description": "Port to access DBLab UI or API. Originally, '2345' is used for direct work with API and '2346' – with UI. However, with UI, API is also available, at ':2346/api'."
        },
        "basePath": {
          "default": "api",
          "description": "basePath value to access API. Use empty when working with API port (2345 by default), or '/api' when working with UI port ('2346' by default)."
        }
      },
      "x-examples": {
        "Verification-Token": "custom_example_token"
      }
    }
  ],
  "paths": {
    "/branch/snapshot/{id}": {
      "get": {
        "tags": [
          "Snapshots"
        ],
        "summary": "Retrieve a snapshot",
        "description": "Retrieves the information for the specified snapshot.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "ID of the branch snapshot",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Verification-Token",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/SnapshotDetails"
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "*/*": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "detail": {
            "type": "string"
          },
          "hint": {
            "type": "string"
          }
        }
      },
      "SnapshotDetails": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "parent": {
            "type": "string"
          },
          "child": {
            "type": "string"
          },
          "branch": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "root": {
            "type": "string"
          },
          "dataStateAt": {
            "type": "string",
            "format": "date-time"
          },
          "message": {
            "type": "string"
          }
        }
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 103,
      "1": 236,
      "2": 195,
      "3": 137,
      "4": 242,
      "5": 110,
      "6": 73,
      "7": 49,
      "8": 9,
      "9": 223,
      "10": 39,
      "11": 159
    }
  }
}
```