Longhorn Snapshots API

Snapshot operations for volumes including creating, listing, deleting, reverting to, and purging snapshots. Snapshots capture the state of a volume at a point in time and can be used as the basis for backups.

Operations 4

POST /v1/volumes/{volumeName}?action=snapshotCreate Longhorn Create a snapshot #
GET /v1/volumes/{volumeName}?action=snapshotList Longhorn List snapshots for a volume #
POST /v1/volumes/{volumeName}?action=snapshotDelete Longhorn Delete a snapshot #
POST /v1/volumes/{volumeName}?action=snapshotRevert Longhorn Revert a volume to a snapshot #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/longhorn-snapshots-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

longhorn-snapshots-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Longhorn Manager Snapshots API
  description: The Longhorn Manager REST API provides programmatic access to all Longhorn storage management operations.
  version: '1.11'
  contact:
    name: Longhorn Community
    url: https://longhorn.io/community/
servers:
- url: http://{longhornManagerHost}:{longhornManagerPort}
  description: Longhorn Manager API server (in-cluster via service or port-forward)
  variables:
    longhornManagerHost:
      default: longhorn-backend
      description: Hostname or service name for the Longhorn Manager.
    longhornManagerPort:
      default: '9500'
      description: Port on which Longhorn Manager serves the API.
security:
- bearerAuth: []
tags:
- name: Snapshots
  description: Snapshot operations for volumes including creating, listing, deleting, reverting to, and purging snapshots. Snapshots capture the state of a volume at a point in time and can be used as the basis for backups.
paths:
  /v1/volumes/{volumeName}?action=snapshotCreate:
    post:
      operationId: createSnapshot
      summary: Longhorn Create a snapshot
      description: Creates a point-in-time snapshot of a Longhorn volume. The volume must be attached when the snapshot is created. Snapshots are stored in the volume's replica data directories and consume incremental space for changed blocks.
      tags:
      - Snapshots
      parameters:
      - $ref: '#/components/parameters/volumeName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SnapshotCreateInput'
      responses:
        '200':
          description: Snapshot created successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Snapshot'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/volumes/{volumeName}?action=snapshotList:
    get:
      operationId: listSnapshots
      summary: Longhorn List snapshots for a volume
      description: Returns a list of all snapshots for the specified volume. Each entry includes the snapshot name, creation time, size, parent, labels, and whether it has been removed or backed up.
      tags:
      - Snapshots
      parameters:
      - $ref: '#/components/parameters/volumeName'
      responses:
        '200':
          description: Snapshot list retrieved successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SnapshotListOutput'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /v1/volumes/{volumeName}?action=snapshotDelete:
    post:
      operationId: deleteSnapshot
      summary: Longhorn Delete a snapshot
      description: Marks a snapshot for deletion. The snapshot data is reclaimed asynchronously. Deleting a snapshot merges its changed blocks with the next snapshot in the chain. The volume must be attached.
      tags:
      - Snapshots
      parameters:
      - $ref: '#/components/parameters/volumeName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              properties:
                name:
                  type: string
                  description: Name of the snapshot to delete.
      responses:
        '200':
          description: Snapshot deletion initiated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Snapshot'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /v1/volumes/{volumeName}?action=snapshotRevert:
    post:
      operationId: revertSnapshot
      summary: Longhorn Revert a volume to a snapshot
      description: Reverts the contents of a volume to the state captured in a specific snapshot. The volume must be detached before a revert operation. All data written after the snapshot was created will be lost.
      tags:
      - Snapshots
      parameters:
      - $ref: '#/components/parameters/volumeName'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - name
              properties:
                name:
                  type: string
                  description: Name of the snapshot to revert to.
      responses:
        '200':
          description: Volume revert initiated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Snapshot'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  parameters:
    volumeName:
      name: volumeName
      in: path
      required: true
      description: Name of the Longhorn volume.
      schema:
        type: string
  responses:
    NotFound:
      description: The requested resource was not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIError'
    BadRequest:
      description: The request was malformed or contained invalid parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIError'
    Unauthorized:
      description: Authentication credentials are missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/APIError'
  schemas:
    SnapshotListOutput:
      type: object
      description: Output from listing snapshots of a volume.
      properties:
        data:
          type: array
          description: List of snapshot objects.
          items:
            $ref: '#/components/schemas/Snapshot'
    APIError:
      type: object
      description: API error response.
      properties:
        type:
          type: string
          description: Error type identifier.
        status:
          type: integer
          description: HTTP status code.
        code:
          type: string
          description: Machine-readable error code.
        message:
          type: string
          description: Human-readable error message.
    SnapshotCreateInput:
      type: object
      description: Input for creating a volume snapshot.
      properties:
        name:
          type: string
          description: Optional explicit name for the snapshot. Generated if omitted.
        labels:
          type: object
          description: Labels to apply to the new snapshot.
          additionalProperties:
            type: string
    Snapshot:
      type: object
      description: A point-in-time snapshot of a Longhorn volume.
      properties:
        id:
          type: string
          description: Snapshot identifier.
        name:
          type: string
          description: Name of the snapshot.
        created:
          type: string
          description: Timestamp when the snapshot was created.
        size:
          type: string
          description: Size of data stored in this snapshot in bytes.
        parent:
          type: string
          description: Name of the parent snapshot in the chain.
        children:
          type: object
          description: Map of child snapshot names.
        removed:
          type: boolean
          description: Whether this snapshot has been marked for removal.
        usercreated:
          type: boolean
          description: Whether this snapshot was manually created (vs. system-created).
        labels:
          type: object
          description: Labels attached to this snapshot.
          additionalProperties:
            type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Kubernetes service account token for authenticating with the Longhorn Manager API. Typically passed via the Kubernetes API proxy.
externalDocs:
  description: Longhorn Documentation
  url: https://longhorn.io/docs/