Label Studio subpackage_comments API

The subpackage_comments API from Label Studio — 3 operation(s) for subpackage_comments.

OpenAPI Specification

label-studio-subpackage-comments-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: API Reference subpackage_actions subpackage_comments API
  version: 1.0.0
servers:
- url: http://localhost:8000
tags:
- name: subpackage_comments
paths:
  /api/comments/:
    get:
      operationId: list
      summary: ✨ List comments
      description: "<Card href=\"https://humansignal.com/goenterprise\">\n        <img style=\"pointer-events: none; margin-left: 0px; margin-right: 0px;\" src=\"https://docs.humansignal.com/images/badge.svg\" alt=\"Label Studio Enterprise badge\"/>\n        <p style=\"margin-top: 10px; font-size: 14px;\">\n            This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n        </p>\n    </Card>\nList all comments for a specific annotation ID."
      tags:
      - subpackage_comments
      parameters:
      - name: annotation
        in: query
        required: false
        schema:
          type: integer
      - name: annotators
        in: query
        required: false
        schema:
          type: string
      - name: draft
        in: query
        required: false
        schema:
          type: integer
      - name: expand_created_by
        in: query
        required: false
        schema:
          type: boolean
          default: false
      - name: ordering
        in: query
        description: Which field to use when ordering the results.
        required: false
        schema:
          type: string
      - name: projects
        in: query
        required: false
        schema:
          type: string
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: List of comments
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/MaybeExpandedComment'
    post:
      operationId: create
      summary: ✨ Create comment
      description: "<Card href=\"https://humansignal.com/goenterprise\">\n        <img style=\"pointer-events: none; margin-left: 0px; margin-right: 0px;\" src=\"https://docs.humansignal.com/images/badge.svg\" alt=\"Label Studio Enterprise badge\"/>\n        <p style=\"margin-top: 10px; font-size: 14px;\">\n            This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n        </p>\n    </Card>\nCreate a comment for a specific annotation ID."
      tags:
      - subpackage_comments
      parameters:
      - name: expand_created_by
        in: query
        description: Expand the created_by field
        required: false
        schema:
          type: boolean
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '201':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaybeExpandedComment'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CommentRequest'
  /api/comments/export/:
    get:
      operationId: export
      summary: ✨ Export comments to CSV
      description: "<Card href=\"https://humansignal.com/goenterprise\">\n        <img style=\"pointer-events: none; margin-left: 0px; margin-right: 0px;\" src=\"https://docs.humansignal.com/images/badge.svg\" alt=\"Label Studio Enterprise badge\"/>\n        <p style=\"margin-top: 10px; font-size: 14px;\">\n            This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n        </p>\n    </Card>\nExport comments to CSV file"
      tags:
      - subpackage_comments
      parameters:
      - name: annotation
        in: query
        required: false
        schema:
          type: integer
      - name: annotators
        in: query
        required: false
        schema:
          type: string
      - name: draft
        in: query
        required: false
        schema:
          type: integer
      - name: expand_created_by
        in: query
        required: false
        schema:
          type: boolean
          default: false
      - name: projects
        in: query
        required: false
        schema:
          type: string
      - name: tz
        in: query
        description: Timezone in which to export the data. Format IANA timezone name, e.g. "America/New_York"
        required: false
        schema:
          type: string
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: CSV file with comments
          content:
            application/json:
              schema:
                type: string
                format: binary
  /api/comments/{id}/:
    get:
      operationId: get
      summary: ✨ Get comment
      description: "<Card href=\"https://humansignal.com/goenterprise\">\n        <img style=\"pointer-events: none; margin-left: 0px; margin-right: 0px;\" src=\"https://docs.humansignal.com/images/badge.svg\" alt=\"Label Studio Enterprise badge\"/>\n        <p style=\"margin-top: 10px; font-size: 14px;\">\n            This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n        </p>\n    </Card>\nRetrieve a specific comment by ID for an annotation."
      tags:
      - subpackage_comments
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      - name: expand_created_by
        in: query
        description: Expand the created_by field
        required: false
        schema:
          type: boolean
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaybeExpandedComment'
    delete:
      operationId: delete
      summary: ✨ Delete comment
      description: "<Card href=\"https://humansignal.com/goenterprise\">\n        <img style=\"pointer-events: none; margin-left: 0px; margin-right: 0px;\" src=\"https://docs.humansignal.com/images/badge.svg\" alt=\"Label Studio Enterprise badge\"/>\n        <p style=\"margin-top: 10px; font-size: 14px;\">\n            This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n        </p>\n    </Card>\nDelete a comment by ID"
      tags:
      - subpackage_comments
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      - name: expand_created_by
        in: query
        description: Expand the created_by field
        required: false
        schema:
          type: boolean
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Successful response
    patch:
      operationId: update
      summary: ✨ Update comment
      description: "<Card href=\"https://humansignal.com/goenterprise\">\n        <img style=\"pointer-events: none; margin-left: 0px; margin-right: 0px;\" src=\"https://docs.humansignal.com/images/badge.svg\" alt=\"Label Studio Enterprise badge\"/>\n        <p style=\"margin-top: 10px; font-size: 14px;\">\n            This endpoint is not available in Label Studio Community Edition. [Learn more about Label Studio Enterprise](https://humansignal.com/goenterprise)\n        </p>\n    </Card>\nUpdate a specific comment by ID."
      tags:
      - subpackage_comments
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: string
      - name: expand_created_by
        in: query
        description: Expand the created_by field
        required: false
        schema:
          type: boolean
      - name: Authorization
        in: header
        description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'
        required: true
        schema:
          type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MaybeExpandedComment'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedCommentRequest'
components:
  schemas:
    TrialRoleEnum:
      type: string
      enum:
      - annotator
      - annotator_team_manager
      - business_analyst
      - business_or_data_team_leadership
      - data_engineer_platform_engineer
      - data_scientist
      - other
      description: '* `annotator` - Annotator

        * `annotator_team_manager` - Annotator Team Manager

        * `business_analyst` - Business Analyst

        * `business_or_data_team_leadership` - Business Or Data Team Leadership

        * `data_engineer_platform_engineer` - Data Engineer Platform Engineer

        * `data_scientist` - Data Scientist

        * `other` - Other'
      title: TrialRoleEnum
    OnboardingStateEnum:
      type: string
      enum:
      - not_started
      - signup
      - trial_signup
      - first_tutorial
      - in_app_guidance
      - complete
      description: '* `not_started` - Not Started

        * `signup` - Signup

        * `trial_signup` - Trial Signup

        * `first_tutorial` - First Tutorial

        * `in_app_guidance` - In App Guidance

        * `complete` - Complete'
      title: OnboardingStateEnum
    MaybeExpandedComment:
      oneOf:
      - $ref: '#/components/schemas/Comment'
      - $ref: '#/components/schemas/CommentSerializerWithExpandedUser'
      title: MaybeExpandedComment
    CommentRequest:
      type: object
      properties:
        annotation:
          type:
          - integer
          - 'null'
        classifications:
          oneOf:
          - description: Any type
          - type: 'null'
          description: Classifications applied by a reviewer or annotator
        draft:
          type:
          - integer
          - 'null'
        is_resolved:
          type: boolean
          description: True if the comment is resolved
        region_ref:
          oneOf:
          - description: Any type
          - type: 'null'
          description: Set if this comment is related to a specific part of the annotation. Normally contains region ID and control name.
        text:
          type:
          - string
          - 'null'
          description: Reviewer or annotator comment
      description: 'Comment Serializer with FSM state support.


        Note: The ''state'' field will be populated from the queryset annotation

        if present, preventing N+1 queries. Use .with_state() on your queryset.


        The state field display is controlled by both:

        - fflag_feat_fit_568_finite_state_management (FSM background calculations)

        - fflag_feat_fit_710_fsm_state_fields (state field display in APIs)'
      title: CommentRequest
    LseUser:
      type: object
      properties:
        active_organization:
          type:
          - integer
          - 'null'
        active_organization_meta:
          type: string
        allow_newsletters:
          type:
          - boolean
          - 'null'
          description: Allow sending newsletters to user
        avatar:
          type: string
        custom_hotkeys:
          oneOf:
          - description: Any type
          - type: 'null'
          description: Custom keyboard shortcuts configuration for the user interface
        date_joined:
          type: string
          format: date-time
        email:
          type: string
          format: email
        first_name:
          type: string
        id:
          type: integer
        initials:
          type: string
          default: '?'
        last_activity:
          type: string
          format: date-time
        last_name:
          type: string
        lse_fields:
          $ref: '#/components/schemas/LseFields'
        org_membership:
          type: array
          items:
            $ref: '#/components/schemas/OrganizationMembership'
        organization_membership:
          $ref: '#/components/schemas/OrganizationMembership'
        pause:
          type: string
        phone:
          type: string
        username:
          type: string
      required:
      - active_organization_meta
      - avatar
      - id
      - initials
      - last_activity
      - lse_fields
      - org_membership
      - organization_membership
      - pause
      - username
      description: 'A ModelSerializer that takes additional arguments for

        "fields", "omit" and "expand" in order to

        control which fields are displayed, and whether to replace simple

        values with complex, nested serializations'
      title: LseUser
    PatchedCommentRequest:
      type: object
      properties:
        annotation:
          type:
          - integer
          - 'null'
        classifications:
          oneOf:
          - description: Any type
          - type: 'null'
          description: Classifications applied by a reviewer or annotator
        draft:
          type:
          - integer
          - 'null'
        is_resolved:
          type: boolean
          description: True if the comment is resolved
        region_ref:
          oneOf:
          - description: Any type
          - type: 'null'
          description: Set if this comment is related to a specific part of the annotation. Normally contains region ID and control name.
        text:
          type:
          - string
          - 'null'
          description: Reviewer or annotator comment
      description: 'Comment Serializer with FSM state support.


        Note: The ''state'' field will be populated from the queryset annotation

        if present, preventing N+1 queries. Use .with_state() on your queryset.


        The state field display is controlled by both:

        - fflag_feat_fit_568_finite_state_management (FSM background calculations)

        - fflag_feat_fit_710_fsm_state_fields (state field display in APIs)'
      title: PatchedCommentRequest
    OrganizationMembership:
      type: object
      properties:
        active:
          type: string
        organization_id:
          type: integer
          description: Organization ID
        role:
          type: string
      required:
      - active
      - organization_id
      - role
      title: OrganizationMembership
    LseFields:
      type: object
      properties:
        email_notification_settings:
          type: string
        invite_activated:
          type:
          - boolean
          - 'null'
        invite_expired:
          type: string
        invite_expired_at:
          type: string
        invited_at:
          type:
          - string
          - 'null'
          format: date-time
        invited_by:
          type:
          - integer
          - 'null'
        onboarding_state:
          oneOf:
          - $ref: '#/components/schemas/OnboardingStateEnum'
          - type: 'null'
          description: 'The current stage of user onboarding


            * `not_started` - Not Started

            * `signup` - Signup

            * `trial_signup` - Trial Signup

            * `first_tutorial` - First Tutorial

            * `in_app_guidance` - In App Guidance

            * `complete` - Complete'
        social_auth_finished:
          type:
          - boolean
          - 'null'
          description: Is user finished social authentication
        trial_company:
          type:
          - string
          - 'null'
        trial_experience_labeling:
          type:
          - string
          - 'null'
        trial_license_enterprise:
          type:
          - boolean
          - 'null'
        trial_models_in_production:
          type:
          - string
          - 'null'
        trial_role:
          oneOf:
          - $ref: '#/components/schemas/TrialRoleEnum'
          - type: 'null'
      required:
      - email_notification_settings
      - invite_expired
      - invite_expired_at
      title: LseFields
    Comment:
      type: object
      properties:
        annotation:
          type:
          - integer
          - 'null'
        classifications:
          oneOf:
          - description: Any type
          - type: 'null'
          description: Classifications applied by a reviewer or annotator
        created_at:
          type: string
          format: date-time
          description: Creation time
        created_by:
          type: integer
          description: User who made this comment
        draft:
          type:
          - integer
          - 'null'
        id:
          type: integer
        is_resolved:
          type: boolean
          description: True if the comment is resolved
        project:
          type:
          - integer
          - 'null'
        region_ref:
          oneOf:
          - description: Any type
          - type: 'null'
          description: Set if this comment is related to a specific part of the annotation. Normally contains region ID and control name.
        resolved_at:
          type:
          - string
          - 'null'
          format: date-time
          description: Resolving time
        state:
          type: string
        task:
          type:
          - integer
          - 'null'
        text:
          type:
          - string
          - 'null'
          description: Reviewer or annotator comment
        updated_at:
          type: string
          format: date-time
          description: Last updated time
      required:
      - created_at
      - created_by
      - id
      - project
      - resolved_at
      - state
      - task
      - updated_at
      description: 'Comment Serializer with FSM state support.


        Note: The ''state'' field will be populated from the queryset annotation

        if present, preventing N+1 queries. Use .with_state() on your queryset.


        The state field display is controlled by both:

        - fflag_feat_fit_568_finite_state_management (FSM background calculations)

        - fflag_feat_fit_710_fsm_state_fields (state field display in APIs)'
      title: Comment
    CommentSerializerWithExpandedUser:
      type: object
      properties:
        annotation:
          type:
          - integer
          - 'null'
        classifications:
          oneOf:
          - description: Any type
          - type: 'null'
          description: Classifications applied by a reviewer or annotator
        created_at:
          type: string
          format: date-time
          description: Creation time
        created_by:
          $ref: '#/components/schemas/LseUser'
        draft:
          type:
          - integer
          - 'null'
        id:
          type: integer
        is_resolved:
          type: boolean
          description: True if the comment is resolved
        project:
          type:
          - integer
          - 'null'
        region_ref:
          oneOf:
          - description: Any type
          - type: 'null'
          description: Set if this comment is related to a specific part of the annotation. Normally contains region ID and control name.
        resolved_at:
          type:
          - string
          - 'null'
          format: date-time
          description: Resolving time
        state:
          type: string
        task:
          type:
          - integer
          - 'null'
        text:
          type:
          - string
          - 'null'
          description: Reviewer or annotator comment
        updated_at:
          type: string
          format: date-time
          description: Last updated time
      required:
      - created_at
      - created_by
      - id
      - project
      - resolved_at
      - state
      - task
      - updated_at
      description: 'Comment Serializer with FSM state support.


        Note: The ''state'' field will be populated from the queryset annotation

        if present, preventing N+1 queries. Use .with_state() on your queryset.


        The state field display is controlled by both:

        - fflag_feat_fit_568_finite_state_management (FSM background calculations)

        - fflag_feat_fit_710_fsm_state_fields (state field display in APIs)'
      title: CommentSerializerWithExpandedUser
  securitySchemes:
    Token:
      type: apiKey
      in: header
      name: Authorization
      description: 'The token (or API key) must be passed as a request header. You can find your user token on the User Account page in Label Studio. Example: <br><pre><code class="language-bash">curl https://label-studio-host/api/projects -H "Authorization: Token [your-token]"</code></pre>'