Bluesky Content Labels API

Operations for managing content labelers and label subscriptions.

OpenAPI Specification

bluesky-content-labels-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Bluesky Social Actor Profiles Content 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: Content Labels
  description: Operations for managing content labelers and label subscriptions.
paths:
  /xrpc/app.bsky.labeler.getServices:
    get:
      operationId: labelerGetServices
      summary: Bluesky Get information about a list of labeler services.
      description: '*This endpoint is part of the Bluesky application Lexicon APIs (`app.bsky.*`). Public endpoints which don''t require authentication can be made directly against the public Bluesky AppView API: https://public.api.bsky.app. Authenticated requests are usually made to the user''s PDS, with automatic service proxying. Authenticated requests can be used for both public and non-public endpoints.*


        *To learn more about calling atproto API endpoints like this one, see the [API Hosts and Auth](/docs/advanced-guides/api-directory) guide.*


        Get information about a list of labeler services.'
      tags:
      - Content Labels
      x-microcks-operation:
        delay: 100
        dispatcher: FALLBACK
        dispatcherRules: ''
      security:
      - Bearer: []
      parameters:
      - name: dids
        in: query
        required: true
        schema:
          type: array
          items:
            type: string
            format: did
        example:
        - did:plc:example123abc
      - name: detailed
        in: query
        required: false
        schema:
          type: boolean
        example: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                required:
                - views
                properties:
                  views:
                    type: array
                    items:
                      oneOf:
                      - $ref: '#/components/schemas/AppBskyLabelerDefsLabelerView'
                      - $ref: '#/components/schemas/AppBskyLabelerDefsLabelerViewDetailed'
              examples:
                LabelerGetServicesResponse200Example:
                  $ref: '#/components/examples/LabelerGetServicesResponse200Example'
        '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:
    AppBskyGraphDefsListViewBasic:
      type: object
      required:
      - uri
      - cid
      - name
      - purpose
      properties:
        uri:
          type: string
          format: at-uri
        cid:
          type: string
          format: cid
        name:
          type: string
          minLength: 1
          maxLength: 64
        purpose:
          $ref: '#/components/schemas/AppBskyGraphDefsListPurpose'
        avatar:
          type: string
          format: uri
        listItemCount:
          type: integer
          minimum: 0
        labels:
          type: array
          items:
            $ref: '#/components/schemas/ComAtprotoLabelDefsLabel'
        viewer:
          $ref: '#/components/schemas/AppBskyGraphDefsListViewerState'
        indexedAt:
          type: string
          format: date-time
    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.
    ComAtprotoLabelDefsLabelValueDefinitionStrings:
      type: object
      description: Strings which describe the label in the UI, localized into a specific language.
      required:
      - lang
      - name
      - description
      properties:
        lang:
          type: string
          description: The code of the language these strings are written in.
          format: language
        name:
          type: string
          description: A short human-readable name for the label.
          maxLength: 640
        description:
          type: string
          description: A longer description of what the label means and why it might be applied.
          maxLength: 100000
    ComAtprotoLabelDefsLabelValue:
      type: string
      enum:
      - '!hide'
      - '!no-promote'
      - '!warn'
      - '!no-unauthenticated'
      - dmca-violation
      - doxxing
      - porn
      - sexual
      - nudity
      - nsfl
      - gore
    AppBskyActorDefsProfileView:
      type: object
      required:
      - did
      - handle
      properties:
        did:
          type: string
          format: did
        handle:
          type: string
          format: handle
        displayName:
          type: string
          maxLength: 640
        description:
          type: string
          maxLength: 2560
        avatar:
          type: string
          format: uri
        associated:
          $ref: '#/components/schemas/AppBskyActorDefsProfileAssociated'
        indexedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
        viewer:
          $ref: '#/components/schemas/AppBskyActorDefsViewerState'
        labels:
          type: array
          items:
            $ref: '#/components/schemas/ComAtprotoLabelDefsLabel'
    AppBskyActorDefsProfileAssociatedChat:
      type: object
      required:
      - allowIncoming
      properties:
        allowIncoming:
          type: string
          enum:
          - all
          - none
          - following
    AppBskyLabelerDefsLabelerViewDetailed:
      type: object
      required:
      - uri
      - cid
      - creator
      - policies
      - indexedAt
      properties:
        uri:
          type: string
          format: at-uri
        cid:
          type: string
          format: cid
        creator:
          $ref: '#/components/schemas/AppBskyActorDefsProfileView'
        policies:
          $ref: '#/components/schemas/AppBskyLabelerDefsLabelerPolicies'
        likeCount:
          type: integer
          minimum: 0
        viewer:
          $ref: '#/components/schemas/AppBskyLabelerDefsLabelerViewerState'
        indexedAt:
          type: string
          format: date-time
        labels:
          type: array
          items:
            $ref: '#/components/schemas/ComAtprotoLabelDefsLabel'
    AppBskyActorDefsViewerState:
      type: object
      description: Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.
      properties:
        muted:
          type: boolean
        mutedByList:
          $ref: '#/components/schemas/AppBskyGraphDefsListViewBasic'
        blockedBy:
          type: boolean
        blocking:
          type: string
          format: at-uri
        blockingByList:
          $ref: '#/components/schemas/AppBskyGraphDefsListViewBasic'
        following:
          type: string
          format: at-uri
        followedBy:
          type: string
          format: at-uri
        knownFollowers:
          $ref: '#/components/schemas/AppBskyActorDefsKnownFollowers'
    AppBskyActorDefsProfileAssociated:
      type: object
      properties:
        lists:
          type: integer
        feedgens:
          type: integer
        starterPacks:
          type: integer
        labeler:
          type: boolean
        chat:
          $ref: '#/components/schemas/AppBskyActorDefsProfileAssociatedChat'
    AppBskyActorDefsKnownFollowers:
      type: object
      description: The subject's followers whom you also follow
      required:
      - count
      - followers
      properties:
        count:
          type: integer
        followers:
          type: array
          items:
            $ref: '#/components/schemas/AppBskyActorDefsProfileViewBasic'
          maxItems: 5
    AppBskyActorDefsProfileViewBasic:
      type: object
      required:
      - did
      - handle
      properties:
        did:
          type: string
          format: did
        handle:
          type: string
          format: handle
        displayName:
          type: string
          maxLength: 640
        avatar:
          type: string
          format: uri
        associated:
          $ref: '#/components/schemas/AppBskyActorDefsProfileAssociated'
        viewer:
          $ref: '#/components/schemas/AppBskyActorDefsViewerState'
        labels:
          type: array
          items:
            $ref: '#/components/schemas/ComAtprotoLabelDefsLabel'
        createdAt:
          type: string
          format: date-time
    AppBskyGraphDefsListPurpose:
      oneOf:
      - $ref: '#/components/schemas/AppBskyGraphDefsModlist'
      - $ref: '#/components/schemas/AppBskyGraphDefsCuratelist'
      - $ref: '#/components/schemas/AppBskyGraphDefsReferencelist'
    AppBskyLabelerDefsLabelerView:
      type: object
      required:
      - uri
      - cid
      - creator
      - indexedAt
      properties:
        uri:
          type: string
          format: at-uri
        cid:
          type: string
          format: cid
        creator:
          $ref: '#/components/schemas/AppBskyActorDefsProfileView'
        likeCount:
          type: integer
          minimum: 0
        viewer:
          $ref: '#/components/schemas/AppBskyLabelerDefsLabelerViewerState'
        indexedAt:
          type: string
          format: date-time
        labels:
          type: array
          items:
            $ref: '#/components/schemas/ComAtprotoLabelDefsLabel'
    AppBskyLabelerDefsLabelerViewerState:
      type: object
      properties:
        like:
          type: string
          format: at-uri
    AppBskyLabelerDefsLabelerPolicies:
      type: object
      required:
      - labelValues
      properties:
        labelValues:
          type: array
          items:
            $ref: '#/components/schemas/ComAtprotoLabelDefsLabelValue'
        labelValueDefinitions:
          type: array
          items:
            $ref: '#/components/schemas/ComAtprotoLabelDefsLabelValueDefinition'
    AppBskyGraphDefsCuratelist:
      type: string
      format: token
      description: A list of actors used for curation purposes such as list feeds or interaction gating.
    AppBskyGraphDefsReferencelist:
      type: string
      format: token
      description: A list of actors used for only for reference purposes such as within a starter pack.
    ComAtprotoLabelDefsLabelValueDefinition:
      type: object
      description: Declares a label value and its expected interpretations and behaviors.
      required:
      - identifier
      - severity
      - blurs
      - locales
      properties:
        identifier:
          type: string
          description: The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+).
          maxLength: 100
        severity:
          type: string
          description: How should a client visually convey this label? 'inform' means neutral and informational; 'alert' means negative and warning; 'none' means show nothing.
          enum:
          - inform
          - alert
          - none
        blurs:
          type: string
          description: What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing.
          enum:
          - content
          - media
          - none
        defaultSetting:
          type: string
          description: The default setting for this label.
          default: warn
          enum:
          - ignore
          - warn
          - hide
        adultOnly:
          type: boolean
          description: Does the user need to have adult content enabled in order to configure this label?
        locales:
          type: array
          items:
            $ref: '#/components/schemas/ComAtprotoLabelDefsLabelValueDefinitionStrings'
    AppBskyGraphDefsModlist:
      type: string
      format: token
      description: A list of actors to apply an aggregate moderation action (mute/block) on.
    AppBskyGraphDefsListViewerState:
      type: object
      properties:
        muted:
          type: boolean
        blocked:
          type: string
          format: at-uri
  examples:
    LabelerGetServicesResponse200Example:
      summary: Successful response for labelerGetServices
      value:
        views:
        - uri: at://did:plc:example123/app.bsky.feed.post/abc123
          cid: bafyreiabc123example
          creator:
            did: {}
            handle: {}
            displayName: {}
            description: {}
            avatar: {}
            associated: {}
            indexedAt: {}
            createdAt: {}
          indexedAt: '2024-01-15T12:00:00.000Z'
          likeCount: 50
          viewer:
            like: {}
          labels: []
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer