Bluesky Labels API

Operations for content labeling and moderation.

OpenAPI Specification

bluesky-labels-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Bluesky Social Actor Profiles Labels API
  description: "The Bluesky Social API provides programmatic access to the Bluesky social network built on the AT Protocol. \n\nThis API enables developers to:\n- Manage user profiles and preferences\n- Create, read, and interact with posts and feeds\n- Handle social graph operations (follows, blocks, mutes)\n- Process notifications and conversations\n- Moderate content and manage labels\n- Synchronize repository data\n\nAuthentication is handled via Bearer tokens. Public endpoints can be accessed directly at https://public.api.bsky.app, while authenticated requests should be made to the user's Personal Data Server (PDS).\n\nFor more information, visit the [Bluesky API Documentation](https://docs.bsky.app)."
  version: 1.0.0
  contact:
    name: Bluesky Support
    url: https://bsky.app
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
- url: https://bsky.social/xrpc
  description: Bluesky Social PDS
- url: https://public.api.bsky.app/xrpc
  description: Public Bluesky AppView API (unauthenticated endpoints)
tags:
- name: Labels
  description: Operations for content labeling and moderation.
paths:
  /xrpc/com.atproto.label.queryLabels:
    get:
      operationId: labelQueryLabels
      summary: Bluesky Find labels relevant to the provided AT-URI patterns.
      description: '*To learn more about calling atproto API endpoints like this one, see the [API Hosts and Auth](/docs/advanced-guides/api-directory) guide.*


        Find labels relevant to the provided AT-URI patterns. Public endpoint for moderation services, though may return different or additional results with auth.'
      tags:
      - Labels
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: ''
      security:
      - Bearer: []
      parameters:
      - name: uriPatterns
        in: query
        description: List of AT URI patterns to match (boolean 'OR'). Each may be a prefix (ending with '*'; will match inclusive of the string leading to '*'), or a full URI.
        required: true
        schema:
          type: array
          items:
            type: string
        example:
        - example-uriPatterns
      - name: sources
        in: query
        description: Optional list of label sources (DIDs) to filter on.
        required: false
        schema:
          type: array
          items:
            type: string
            format: did
        example:
        - did:plc:example123abc
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          minimum: 1
          maximum: 250
          default: 50
        example: 50
      - name: cursor
        in: query
        required: false
        schema:
          type: string
        example: eyJsYXN0SWQiOiIxMjM0NTYifQ
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - labels
                properties:
                  cursor:
                    type: string
                  labels:
                    type: array
                    items:
                      $ref: '#/components/schemas/ComAtprotoLabelDefsLabel'
              examples:
                LabelQueryLabelsResponse200Example:
                  $ref: '#/components/examples/LabelQueryLabelsResponse200Example'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                required:
                - error
                - message
                properties:
                  error:
                    type: string
                    enum:
                    - InvalidRequest
                    - ExpiredToken
                    - InvalidToken
                  message:
                    type: string
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                type: object
                required:
                - error
                - message
                properties:
                  error:
                    const: AuthMissing
                  message:
                    type: string
components:
  schemas:
    ComAtprotoLabelDefsLabel:
      type: object
      description: Metadata tag on an atproto resource (eg, repo or record).
      required:
      - src
      - uri
      - val
      - cts
      properties:
        ver:
          type: integer
        src:
          type: string
          description: DID of the actor who created this label.
          format: did
        uri:
          type: string
          description: AT URI of the record, repository (account), or other resource that this label applies to.
          format: uri
        cid:
          type: string
          description: Optionally, CID specifying the specific version of 'uri' resource this label applies to.
          format: cid
        val:
          type: string
          description: The short string name of the value or type of this label.
          maxLength: 128
        neg:
          type: boolean
          description: If true, this is a negation label, overwriting a previous label.
        cts:
          type: string
          description: Timestamp when this label was created.
          format: date-time
        exp:
          type: string
          description: Timestamp at which this label expires (no longer applies).
          format: date-time
        sig:
          type: string
          format: byte
          description: Signature of dag-cbor encoded label.
  examples:
    LabelQueryLabelsResponse200Example:
      summary: Successful response for labelQueryLabels
      value:
        labels:
        - src: did:plc:example123abc
          uri: https://example.com/resource
          val: example-val
          cts: '2024-01-15T12:00:00.000Z'
          ver: 50
          cid: bafyreiabc123example
          neg: true
          exp: '2024-01-15T12:00:00.000Z'
        cursor: eyJsYXN0SWQiOiIxMjM0NTYifQ
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer