Hugging Face Transformers discussions API

The following endpoints manage discussions.

OpenAPI Specification

hugging-face-transformers-discussions-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Hub API Endpoints agentic-provisioning discussions API
  version: 0.0.1
  description: 'We have open endpoints that you can use to retrieve information from the Hub as well as perform certain actions such as creating model, dataset or Space repos. We offer a wrapper Python client, [`huggingface_hub`](https://github.com/huggingface/huggingface_hub), and a JS client, [`huggingface.js`](https://github.com/huggingface/huggingface.js), that allow easy access to these endpoints. We also provide [webhooks](https://huggingface.co/docs/hub/webhooks) to receive real-time incremental info about repos. Enjoy!


    The base URL for those endpoints below is `https://huggingface.co`. For example, to construct the `/api/models` call below, one can call the URL [https://huggingface.co/api/models](https://huggingface.co/api/models).


    If you''re an Agent, you might prefer the [markdown version OpenAPI spec](https://huggingface.co/.well-known/openapi.md).

    '
servers:
- url: https://huggingface.co
  description: Hub
security:
- bearerAuth: []
tags:
- name: discussions
  x-displayName: Discussions
  description: The following endpoints manage discussions.
paths:
  /api/blog/{slug}/comment:
    post:
      summary: Create a new comment
      tags:
      - discussions
      requestBody:
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                comment:
                  type: string
                  minLength: 1
                  maxLength: 65536
              required:
              - comment
      responses:
        '201':
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  newMessage:
                    type: object
                    properties:
                      id:
                        type: string
                      createdAt:
                        type: string
                        format: date-time
                        pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$
                      author:
                        allOf:
                        - anyOf:
                          - type: object
                            properties:
                              _id:
                                type: string
                                minLength: 24
                                maxLength: 24
                                pattern: ^[0-9a-f]{24}$
                              avatarUrl:
                                type: string
                              fullname:
                                type: string
                              name:
                                type: string
                              isHf:
                                type: boolean
                              isHfAdmin:
                                type: boolean
                              isMod:
                                type: boolean
                              followerCount:
                                type: number
                              type:
                                const: org
                              plan:
                                enum:
                                - team
                                - enterprise
                                - plus
                                - academia
                              isUserFollowing:
                                type: boolean
                            required:
                            - _id
                            - avatarUrl
                            - fullname
                            - name
                            - isHf
                            - isHfAdmin
                            - isMod
                            - type
                            additionalProperties: false
                          - type: object
                            properties:
                              _id:
                                type: string
                                minLength: 24
                                maxLength: 24
                                pattern: ^[0-9a-f]{24}$
                              avatarUrl:
                                type: string
                              fullname:
                                type: string
                              name:
                                type: string
                              isHf:
                                type: boolean
                              isHfAdmin:
                                type: boolean
                              isMod:
                                type: boolean
                              followerCount:
                                type: number
                              type:
                                const: user
                              isPro:
                                type: boolean
                              isUserFollowing:
                                type: boolean
                              primaryOrg:
                                type: object
                                properties:
                                  avatarUrl:
                                    type: string
                                  fullname:
                                    type: string
                                  name:
                                    type: string
                                  type:
                                    const: org
                                  isHf:
                                    type: boolean
                                  isFollowing:
                                    type: boolean
                                  plan:
                                    enum:
                                    - team
                                    - enterprise
                                    - plus
                                    - academia
                                  details:
                                    type: string
                                  hasPrivateMembersList:
                                    type: boolean
                                  userRole:
                                    anyOf:
                                    - enum:
                                      - admin
                                      - write
                                      - contributor
                                      - read
                                      - no_access
                                    - description: Custom role name
                                      type: string
                                  numUsers:
                                    type: number
                                required:
                                - avatarUrl
                                - fullname
                                - name
                                - type
                                - isHf
                                additionalProperties: false
                            required:
                            - _id
                            - avatarUrl
                            - fullname
                            - name
                            - isHf
                            - isHfAdmin
                            - isMod
                            - type
                            - isPro
                            additionalProperties: false
                        - type: object
                          properties:
                            isOwner:
                              type: boolean
                            isOrgMember:
                              type: boolean
                            oauthApp:
                              type: object
                              properties:
                                imageUrl:
                                  type: string
                                imageData:
                                  type: object
                                  properties:
                                    emoji:
                                      type: string
                                    colorFrom:
                                      type: string
                                    colorTo:
                                      type: string
                                  required:
                                  - emoji
                                  - colorFrom
                                  - colorTo
                                  additionalProperties: false
                                url:
                                  type: string
                                name:
                                  type: string
                              required:
                              - name
                              additionalProperties: false
                          additionalProperties: false
                      type:
                        const: comment
                      data:
                        type: object
                        properties:
                          edited:
                            type: boolean
                          hidden:
                            type: boolean
                          hiddenBy:
                            type: string
                          hiddenReason:
                            enum:
                            - Spam
                            - Abuse
                            - Graphic Content
                            - Resolved
                            - Off-Topic
                            - Low Quality
                          latest:
                            type: object
                            properties:
                              raw:
                                type: string
                              html:
                                type: string
                              updatedAt:
                                type: string
                                format: date-time
                                pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$
                              author:
                                anyOf:
                                - type: object
                                  properties:
                                    _id:
                                      type: string
                                      minLength: 24
                                      maxLength: 24
                                      pattern: ^[0-9a-f]{24}$
                                    avatarUrl:
                                      type: string
                                    fullname:
                                      type: string
                                    name:
                                      type: string
                                    isHf:
                                      type: boolean
                                    isHfAdmin:
                                      type: boolean
                                    isMod:
                                      type: boolean
                                    followerCount:
                                      type: number
                                    type:
                                      const: org
                                    plan:
                                      enum:
                                      - team
                                      - enterprise
                                      - plus
                                      - academia
                                    isUserFollowing:
                                      type: boolean
                                  required:
                                  - _id
                                  - avatarUrl
                                  - fullname
                                  - name
                                  - isHf
                                  - isHfAdmin
                                  - isMod
                                  - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    _id:
                                      type: string
                                      minLength: 24
                                      maxLength: 24
                                      pattern: ^[0-9a-f]{24}$
                                    avatarUrl:
                                      type: string
                                    fullname:
                                      type: string
                                    name:
                                      type: string
                                    isHf:
                                      type: boolean
                                    isHfAdmin:
                                      type: boolean
                                    isMod:
                                      type: boolean
                                    followerCount:
                                      type: number
                                    type:
                                      const: user
                                    isPro:
                                      type: boolean
                                    isUserFollowing:
                                      type: boolean
                                    primaryOrg:
                                      type: object
                                      properties:
                                        avatarUrl:
                                          type: string
                                        fullname:
                                          type: string
                                        name:
                                          type: string
                                        type:
                                          const: org
                                        isHf:
                                          type: boolean
                                        isFollowing:
                                          type: boolean
                                        plan:
                                          enum:
                                          - team
                                          - enterprise
                                          - plus
                                          - academia
                                        details:
                                          type: string
                                        hasPrivateMembersList:
                                          type: boolean
                                        userRole:
                                          anyOf:
                                          - enum:
                                            - admin
                                            - write
                                            - contributor
                                            - read
                                            - no_access
                                          - description: Custom role name
                                            type: string
                                        numUsers:
                                          type: number
                                      required:
                                      - avatarUrl
                                      - fullname
                                      - name
                                      - type
                                      - isHf
                                      additionalProperties: false
                                  required:
                                  - _id
                                  - avatarUrl
                                  - fullname
                                  - name
                                  - isHf
                                  - isHfAdmin
                                  - isMod
                                  - type
                                  - isPro
                                  additionalProperties: false
                            required:
                            - raw
                            - html
                            - updatedAt
                            additionalProperties: false
                          numEdits:
                            type: number
                          editors:
                            type: array
                            items:
                              type: string
                          editorAvatarUrls:
                            type: array
                            items:
                              type: string
                          reactions:
                            type: array
                            items:
                              type: object
                              properties:
                                reaction:
                                  enum:
                                  - πŸ”₯
                                  - πŸš€
                                  - πŸ‘€
                                  - ❀️
                                  - πŸ€—
                                  - 😎
                                  - βž•
                                  - 🧠
                                  - πŸ‘
                                  - 🀝
                                  - πŸ˜”
                                  - 🀯
                                users:
                                  type: array
                                  items:
                                    type: string
                                count:
                                  type: number
                              required:
                              - reaction
                              - users
                              - count
                              additionalProperties: false
                          identifiedLanguage:
                            type: object
                            properties:
                              language:
                                type: string
                              probability:
                                type: number
                            required:
                            - language
                            - probability
                            additionalProperties: false
                          relatedEventId:
                            type: string
                          isReport:
                            type: boolean
                          parentCommentId:
                            type: string
                        required:
                        - edited
                        - hidden
                        - latest
                        - numEdits
                        - editors
                        - editorAvatarUrls
                        - reactions
                        additionalProperties: false
                    required:
                    - id
                    - createdAt
                    - type
                    - data
                    additionalProperties: false
                required:
                - newMessage
                additionalProperties: false
          description: New comment created
      parameters:
      - name: slug
        in: path
        required: true
        schema:
          type: string
  /api/blog/{slug}/comment/{commentId}/reply:
    post:
      summary: Create a new comment
      tags:
      - discussions
      requestBody:
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                comment:
                  type: string
                  minLength: 1
                  maxLength: 65536
              required:
              - comment
      responses:
        '201':
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  newMessage:
                    type: object
                    properties:
                      id:
                        type: string
                      createdAt:
                        type: string
                        format: date-time
                        pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$
                      author:
                        allOf:
                        - anyOf:
                          - type: object
                            properties:
                              _id:
                                type: string
                                minLength: 24
                                maxLength: 24
                                pattern: ^[0-9a-f]{24}$
                              avatarUrl:
                                type: string
                              fullname:
                                type: string
                              name:
                                type: string
                              isHf:
                                type: boolean
                              isHfAdmin:
                                type: boolean
                              isMod:
                                type: boolean
                              followerCount:
                                type: number
                              type:
                                const: org
                              plan:
                                enum:
                                - team
                                - enterprise
                                - plus
                                - academia
                              isUserFollowing:
                                type: boolean
                            required:
                            - _id
                            - avatarUrl
                            - fullname
                            - name
                            - isHf
                            - isHfAdmin
                            - isMod
                            - type
                            additionalProperties: false
                          - type: object
                            properties:
                              _id:
                                type: string
                                minLength: 24
                                maxLength: 24
                                pattern: ^[0-9a-f]{24}$
                              avatarUrl:
                                type: string
                              fullname:
                                type: string
                              name:
                                type: string
                              isHf:
                                type: boolean
                              isHfAdmin:
                                type: boolean
                              isMod:
                                type: boolean
                              followerCount:
                                type: number
                              type:
                                const: user
                              isPro:
                                type: boolean
                              isUserFollowing:
                                type: boolean
                              primaryOrg:
                                type: object
                                properties:
                                  avatarUrl:
                                    type: string
                                  fullname:
                                    type: string
                                  name:
                                    type: string
                                  type:
                                    const: org
                                  isHf:
                                    type: boolean
                                  isFollowing:
                                    type: boolean
                                  plan:
                                    enum:
                                    - team
                                    - enterprise
                                    - plus
                                    - academia
                                  details:
                                    type: string
                                  hasPrivateMembersList:
                                    type: boolean
                                  userRole:
                                    anyOf:
                                    - enum:
                                      - admin
                                      - write
                                      - contributor
                                      - read
                                      - no_access
                                    - description: Custom role name
                                      type: string
                                  numUsers:
                                    type: number
                                required:
                                - avatarUrl
                                - fullname
                                - name
                                - type
                                - isHf
                                additionalProperties: false
                            required:
                            - _id
                            - avatarUrl
                            - fullname
                            - name
                            - isHf
                            - isHfAdmin
                            - isMod
                            - type
                            - isPro
                            additionalProperties: false
                        - type: object
                          properties:
                            isOwner:
                              type: boolean
                            isOrgMember:
                              type: boolean
                            oauthApp:
                              type: object
                              properties:
                                imageUrl:
                                  type: string
                                imageData:
                                  type: object
                                  properties:
                                    emoji:
                                      type: string
                                    colorFrom:
                                      type: string
                                    colorTo:
                                      type: string
                                  required:
                                  - emoji
                                  - colorFrom
                                  - colorTo
                                  additionalProperties: false
                                url:
                                  type: string
                                name:
                                  type: string
                              required:
                              - name
                              additionalProperties: false
                          additionalProperties: false
                      type:
                        const: comment
                      data:
                        type: object
                        properties:
                          edited:
                            type: boolean
                          hidden:
                            type: boolean
                          hiddenBy:
                            type: string
                          hiddenReason:
                            enum:
                            - Spam
                            - Abuse
                            - Graphic Content
                            - Resolved
                            - Off-Topic
                            - Low Quality
                          latest:
                            type: object
                            properties:
                              raw:
                                type: string
                              html:
                                type: string
                              updatedAt:
                                type: string
                                format: date-time
                                pattern: ^((\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\d|3[01])|(0[469]|11)-(0[1-9]|[12]\d|30)|(02)-(0[1-9]|1\d|2[0-8])))T([01]\d|2[0-3]):[0-5]\d:[0-5]\d(\.\d+)?(Z)$
                              author:
                                anyOf:
                                - type: object
                                  properties:
                                    _id:
                                      type: string
                                      minLength: 24
                                      maxLength: 24
                                      pattern: ^[0-9a-f]{24}$
                                    avatarUrl:
                                      type: string
                                    fullname:
                                      type: string
                                    name:
                                      type: string
                                    isHf:
                                      type: boolean
                                    isHfAdmin:
                                      type: boolean
                                    isMod:
                                      type: boolean
                                    followerCount:
                                      type: number
                                    type:
                                      const: org
                                    plan:
                                      enum:
                                      - team
                                      - enterprise
                                      - plus
                                      - academia
                                    isUserFollowing:
                                      type: boolean
                                  required:
                                  - _id
                                  - avatarUrl
                                  - fullname
                                  - name
                                  - isHf
                                  - isHfAdmin
                                  - isMod
                                  - type
                                  additionalProperties: false
                                - type: object
                                  properties:
                                    _id:
                                      type: string
                                      minLength: 24
                                      maxLength: 24
                                      pattern: ^[0-9a-f]{24}$
                                    avatarUrl:
                                      type: string
                                    fullname:
                                      type: string
                                    name:
                                      type: string
                                    isHf:
                                      type: boolean
                                    isHfAdmin:
                                      type: boolean
                                    isMod:
                                      type: boolean
                                    followerCount:
                             

# --- truncated at 32 KB (395 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/hugging-face-transformers/refs/heads/main/openapi/hugging-face-transformers-discussions-api-openapi.yml