PhotoPrism Labels API

The Labels API from PhotoPrism — 7 operation(s) for labels.

Business capability
Photo & Image Libraries AE-170.30

Operations 9

POST /api/v1/batch/labels/delete deletes multiple labels #
GET /api/v1/labels finds and returns labels as JSON #
PUT /api/v1/labels/{uid} updates label name #
DELETE /api/v1/labels/{uid}/like removes favorite flag from a label #
POST /api/v1/labels/{uid}/like sets favorite flag for a label #
GET /api/v1/labels/{uid}/t/{token}/{size} returns a label cover image #
POST /api/v1/photos/{uid}/label adds a label to a photo #
DELETE /api/v1/photos/{uid}/label/{id} removes a label from a photo #
PUT /api/v1/photos/{uid}/label/{id} changes a photo label #

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-labels-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-labels-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 Labels API
  version: v1
servers:
- url: https://demo.photoprism.app
security:
- BearerAuth: []
tags:
- name: Labels
paths:
  /api/v1/batch/labels/delete:
    post:
      operationId: BatchLabelsDelete
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
        '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'
        '413':
          description: Request Entity Too Large
          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: deletes multiple labels
      tags:
      - Labels
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/form.Selection'
        description: Label Selection
        required: true
  /api/v1/labels:
    get:
      operationId: SearchLabels
      parameters:
      - description: maximum number of results
        in: query
        name: count
        required: true
        schema:
          type: integer
          maximum: 100000
          minimum: 1
      - description: search result offset
        in: query
        name: offset
        schema:
          type: integer
          maximum: 100000
          minimum: 0
      - description: show all
        in: query
        name: all
        schema:
          type: boolean
      - description: search query
        in: query
        name: q
        schema:
          type: string
      responses:
        '200':
          description: OK
          headers:
            X-Count:
              description: The actual number of labels returned
              schema:
                type: number
            X-Limit:
              description: The limit of the number of labels to be returned
              schema:
                type: number
            X-Offset:
              description: The offset that was used
              schema:
                type: number
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/search.Label'
                type: array
        '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'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
      summary: finds and returns labels as JSON
      tags:
      - Labels
  /api/v1/labels/{uid}:
    put:
      operationId: UpdateLabel
      parameters:
      - description: Label UID
        in: path
        name: uid
        required: true
        schema:
          type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/entity.Label'
        '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'
        '413':
          description: Request Entity Too Large
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/i18n.Response'
      summary: updates label name
      tags:
      - Labels
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/form.Label'
        description: Label Name
        required: true
  /api/v1/labels/{uid}/like:
    delete:
      operationId: DislikeLabel
      parameters:
      - description: Label UID
        in: path
        name: uid
        required: true
        schema:
          type: string
      responses:
        '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'
      summary: removes favorite flag from a label
      tags:
      - Labels
    post:
      operationId: LikeLabel
      parameters:
      - description: Label UID
        in: path
        name: uid
        required: true
        schema:
          type: string
      responses:
        '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'
      summary: sets favorite flag for a label
      tags:
      - Labels
  /api/v1/labels/{uid}/t/{token}/{size}:
    get:
      description: Returns a generic placeholder icon when a cover file is assigned to the label; request the picture from /api/v1/t/{hash}/{token}/{size} instead, using its hash. Covers are always served inline; use the download endpoints to obtain a file.
      operationId: LabelCover
      parameters:
      - description: Label UID
        in: path
        name: uid
        required: true
        schema:
          type: string
      - description: user-specific security token provided with session or 'public' when running PhotoPrism in public mode
        in: path
        name: token
        required: true
        schema:
          type: string
      - description: cover image size; larger sizes are reduced
        in: path
        name: size
        required: true
        schema:
          type: string
          enum:
          - tile_50
          - tile_100
          - left_224
          - right_224
          - tile_224
          - tile_500
          - fit_720
      responses:
        '200':
          description: OK
          content:
            image/jpeg:
              schema:
                type: string
                format: binary
            image/svg+xml:
              schema:
                type: string
                format: binary
        '403':
          description: Forbidden
          content:
            image/jpeg:
              schema:
                type: string
                format: binary
            image/svg+xml:
              schema:
                type: string
                format: binary
      summary: returns a label cover image
      tags:
      - Labels
  /api/v1/photos/{uid}/label:
    post:
      operationId: AddPhotoLabel
      parameters:
      - description: photo uid
        in: path
        name: uid
        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'
        '413':
          description: Request Entity Too Large
          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: adds a label to a photo
      tags:
      - Labels
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/form.Label'
        description: label properties
        required: true
  /api/v1/photos/{uid}/label/{id}:
    delete:
      operationId: RemovePhotoLabel
      parameters:
      - description: photo uid
        in: path
        name: uid
        required: true
        schema:
          type: string
      - description: label id
        in: path
        name: id
        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 label from a photo
      tags:
      - Labels
    put:
      operationId: UpdatePhotoLabel
      parameters:
      - description: photo uid
        in: path
        name: uid
        required: true
        schema:
          type: string
      - description: label id
        in: path
        name: id
        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'
        '413':
          description: Request Entity Too Large
          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: changes a photo label
      tags:
      - Labels
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/form.PhotoLabel'
        description: assignment uncertainty and optional label name
        required: true
components:
  schemas:
    form.PhotoLabel:
      properties:
        Label:
          $ref: '#/components/schemas/form.PhotoLabelName'
        Uncertainty:
          type: integer
      type: object
    search.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
        Slug:
          type: string
        Thumb:
          type: string
        ThumbSrc:
          type: string
        UID:
          type: string
        UpdatedAt:
          type: string
      type: object
    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
    form.Label:
      properties:
        Description:
          type: string
        Favorite:
          type: boolean
        Name:
          type: string
        Notes:
          type: string
        Priority:
          type: integer
        Thumb:
          type: string
        ThumbSrc:
          type: string
        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
    form.PhotoLabelName:
      properties:
        Name:
          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
    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
    i18n.Response:
      properties:
        code:
          type: integer
        details:
          type: string
        error:
          type: string
        message:
          type: string
        messageId:
          type: string
        messageParams:
          items: {}
          type: array
      type: object
    form.Selection:
      properties:
        albums:
          items:
            type: string
          type: array
        all:
          type: boolean
        files:
          items:
            type: string
          type: array
        labels:
          items:
            type: string
          type: array
        photos:
          items:
            type: string
          type: array
        places:
          items:
            type: string
          type: array
        subjects:
          items:
            type: string
          type: array
      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/