PhotoPrism Stacks API

The Stacks API from PhotoPrism — 2 operation(s) for stacks.

Business capability
Photo & Image Libraries AE-170.30

Operations 2

POST /api/v1/photos/{uid}/files/{fileuid}/primary sets the primary file for a photo #
POST /api/v1/photos/{uid}/files/{fileuid}/unstack removes a file from an existing photo stack #

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/photoprism:photoprism-stacks-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

photoprism-stacks-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  contact: {}
  description: 'API request bodies and responses are usually JSON-encoded, except for binary data and some of the OAuth2 endpoints. Note that the `Content-Type` header must be set to `application/json` for this, as the request may otherwise fail with error 400.

    When clients have a valid access token, e.g. obtained through the `POST /api/v1/session` or `POST /api/v1/oauth/token` endpoint, they can use a standard Bearer Authorization header to authenticate their requests. Submitting the access token with a custom `X-Auth-Token` header is supported as well.'
  title: PhotoPrism Stacks API
  version: v1
servers:
- url: https://demo.photoprism.app
security:
- BearerAuth: []
tags:
- name: Stacks
paths:
  /api/v1/photos/{uid}/files/{fileuid}/primary:
    post:
      operationId: PhotoPrimary
      parameters:
      - description: photo uid
        in: path
        name: uid
        required: true
        schema:
          type: string
      - description: file uid
        in: path
        name: fileuid
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/entity.Photo'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
      summary: sets the primary file for a photo
      tags:
      - Stacks
  /api/v1/photos/{uid}/files/{fileuid}/unstack:
    post:
      operationId: PhotoUnstack
      parameters:
      - description: photo uid
        in: path
        name: uid
        required: true
        schema:
          type: string
      - description: file uid
        in: path
        name: fileuid
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/entity.Photo'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
      summary: removes a file from an existing photo stack
      tags:
      - Stacks
components:
  schemas:
    time.Duration:
      format: int64
      type: integer
    entity.PhotoLabel:
      properties:
        Label:
          $ref: '#/components/schemas/entity.Label'
        LabelID:
          type: integer
        LabelSrc:
          type: string
        NSFW:
          type: integer
        PhotoID:
          type: integer
        Topicality:
          type: integer
        Uncertainty:
          type: integer
      type: object
    entity.Label:
      properties:
        CreatedAt:
          type: string
        CustomSlug:
          type: string
        DeletedAt:
          type: string
        Description:
          type: string
        Favorite:
          type: boolean
        ID:
          type: integer
        NSFW:
          type: boolean
        Name:
          type: string
        Notes:
          type: string
        PhotoCount:
          type: integer
        Priority:
          type: integer
        PublishedAt:
          type: string
        Slug:
          type: string
        Thumb:
          type: string
        ThumbSrc:
          type: string
        UID:
          type: string
        UpdatedAt:
          type: string
      type: object
    entity.Lens:
      properties:
        Description:
          type: string
        ID:
          type: integer
        Make:
          type: string
        Model:
          type: string
        Name:
          type: string
        Notes:
          type: string
        Slug:
          type: string
        Type:
          type: string
      type: object
    entity.Details:
      properties:
        Artist:
          type: string
        ArtistSrc:
          type: string
        Copyright:
          type: string
        CopyrightSrc:
          type: string
        CreatedAt:
          type: string
        Keywords:
          type: string
        KeywordsSrc:
          type: string
        License:
          type: string
        LicenseSrc:
          type: string
        Notes:
          type: string
        NotesSrc:
          type: string
        PhotoID:
          type: integer
        Software:
          type: string
        SoftwareSrc:
          type: string
        Subject:
          type: string
        SubjectSrc:
          type: string
        UpdatedAt:
          type: string
      type: object
    i18n.Response:
      properties:
        code:
          type: integer
        details:
          type: string
        error:
          type: string
        message:
          type: string
        messageId:
          type: string
        messageParams:
          items: {}
          type: array
      type: object
    entity.Place:
      properties:
        City:
          type: string
        Country:
          type: string
        CreatedAt:
          type: string
        District:
          type: string
        Favorite:
          type: boolean
        Keywords:
          type: string
        Label:
          type: string
        PhotoCount:
          type: integer
        PlaceID:
          type: string
        State:
          type: string
        UpdatedAt:
          type: string
      type: object
    entity.File:
      properties:
        AspectRatio:
          type: number
        Chroma:
          type: integer
        Codec:
          type: string
        ColorProfile:
          type: string
        Colors:
          type: string
        CreatedAt:
          type: string
        CreatedIn:
          type: integer
        DeletedAt:
          type: string
        Diff:
          type: integer
        Duration:
          $ref: '#/components/schemas/time.Duration'
        Error:
          type: string
        FPS:
          type: number
        FileType:
          type: string
        Frames:
          type: integer
        HDR:
          type: boolean
        Hash:
          type: string
        Height:
          type: integer
        InstanceID:
          type: string
        Luminance:
          type: string
        MainColor:
          type: string
        MediaID:
          type: string
        MediaType:
          type: string
        MediaUTC:
          type: integer
        Mime:
          type: string
        Missing:
          type: boolean
        ModTime:
          type: integer
        Name:
          type: string
        Orientation:
          type: integer
        OrientationSrc:
          type: string
        OriginalName:
          type: string
        Pages:
          type: integer
        PhotoUID:
          type: string
        Portrait:
          type: boolean
        Primary:
          type: boolean
        Projection:
          type: string
        PublishedAt:
          type: string
        Root:
          type: string
        Sidecar:
          type: boolean
        Size:
          type: integer
        Software:
          type: string
        TakenAt:
          type: string
        TimeIndex:
          type: string
        UID:
          type: string
        UpdatedAt:
          type: string
        UpdatedIn:
          type: integer
        Video:
          type: boolean
        Watermark:
          type: boolean
        Width:
          type: integer
      type: object
    entity.Cell:
      properties:
        Category:
          type: string
        CreatedAt:
          type: string
        ID:
          type: string
        Name:
          type: string
        Place:
          $ref: '#/components/schemas/entity.Place'
        Postcode:
          type: string
        Street:
          type: string
        UpdatedAt:
          type: string
      type: object
    entity.Photo:
      properties:
        Albums:
          items:
            $ref: '#/components/schemas/entity.Album'
          type: array
        Altitude:
          type: integer
        Camera:
          $ref: '#/components/schemas/entity.Camera'
        CameraID:
          type: integer
        CameraSerial:
          type: string
        CameraSrc:
          type: string
        Caption:
          type: string
        CaptionSrc:
          type: string
        Cell:
          $ref: '#/components/schemas/entity.Cell'
        CellAccuracy:
          type: integer
        CellID:
          type: string
        CheckedAt:
          type: string
        Color:
          type: integer
        Country:
          type: string
        CreatedAt:
          type: string
        CreatedBy:
          type: string
        Day:
          type: integer
        DeletedAt:
          type: string
        Description:
          type: string
        DescriptionSrc:
          type: string
        Details:
          $ref: '#/components/schemas/entity.Details'
        DocumentID:
          type: string
        Duration:
          $ref: '#/components/schemas/time.Duration'
        EditedAt:
          type: string
        EstimatedAt:
          type: string
        Exposure:
          type: string
        FNumber:
          type: number
        Faces:
          type: integer
        Favorite:
          type: boolean
        FocalLength:
          type: integer
        IndexedAt:
          type: string
        Iso:
          type: integer
        Lat:
          type: number
        Lens:
          $ref: '#/components/schemas/entity.Lens'
        LensID:
          type: integer
        Lng:
          type: number
        Month:
          type: integer
        Name:
          type: string
        OriginalName:
          type: string
        Panorama:
          type: boolean
        Path:
          type: string
        Place:
          $ref: '#/components/schemas/entity.Place'
        PlaceID:
          type: string
        PlaceSrc:
          type: string
        Private:
          type: boolean
        PublishedAt:
          type: string
        Quality:
          type: integer
        Resolution:
          type: integer
        Scan:
          type: boolean
        Stack:
          type: integer
        TakenAt:
          type: string
        TakenAtLocal:
          type: string
        TakenSrc:
          type: string
        TimeZone:
          type: string
        Title:
          type: string
        TitleSrc:
          type: string
        Type:
          type: string
        TypeSrc:
          type: string
        UID:
          type: string
        UpdatedAt:
          type: string
        Year:
          type: integer
        files:
          items:
            $ref: '#/components/schemas/entity.File'
          type: array
        id:
          type: integer
        labels:
          items:
            $ref: '#/components/schemas/entity.PhotoLabel'
          type: array
      type: object
    entity.Camera:
      properties:
        Description:
          type: string
        ID:
          type: integer
        Make:
          type: string
        Model:
          type: string
        Name:
          type: string
        Notes:
          type: string
        Slug:
          type: string
        Type:
          type: string
      type: object
    entity.Album:
      properties:
        Caption:
          type: string
        Category:
          type: string
        Country:
          type: string
        CreatedAt:
          type: string
        CreatedBy:
          type: string
        Day:
          type: integer
        DeletedAt:
          type: string
        Description:
          type: string
        Favorite:
          type: boolean
        Filter:
          type: string
        ID:
          type: integer
        Location:
          type: string
        Month:
          type: integer
        Notes:
          type: string
        Order:
          type: string
        ParentUID:
          type: string
        Path:
          type: string
        Private:
          type: boolean
        PublishedAt:
          type: string
        Slug:
          type: string
        State:
          type: string
        Template:
          type: string
        Thumb:
          type: string
        ThumbSrc:
          type: string
        Title:
          type: string
        Type:
          type: string
        UID:
          type: string
        UpdatedAt:
          type: string
        Year:
          type: integer
      type: object
  securitySchemes:
    BearerAuth:
      in: header
      name: Authorization
      type: apiKey
externalDocs:
  description: Learn more ›
  url: https://docs.photoprism.app/developer-guide/api/