Label Studio subpackage_projects.subpackage_projects/roles API

The subpackage_projects.subpackage_projects/roles API from Label Studio — 3 operation(s) for subpackage_projects.subpackage_projects/roles.

OpenAPI Specification

label-studio-subpackage-projects-subpackage-projects-roles-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: API Reference subpackage_actions subpackage_projects.subpackage_projects/roles API
  version: 1.0.0
servers:
- url: http://localhost:8000
tags:
- name: subpackage_projects.subpackage_projects/roles
paths:
  /api/projects/roles/:
    get:
      operationId: list
      summary: ✨ List project roles for current user
      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>\n\n        List project roles for requested IDs for the current user\n        "
      tags:
      - subpackage_projects.subpackage_projects/roles
      parameters:
      - name: ids
        in: query
        required: false
        schema:
          type: integer
      - name: ordering
        in: query
        description: Which field to use when ordering the results.
        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: ''
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProjectRole'
    post:
      operationId: add
      summary: ✨ Create project role for user
      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>\n\n        Create project role for user allowing the user the same access level provided by organization role.\n        "
      tags:
      - subpackage_projects.subpackage_projects/roles
      parameters:
      - 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: Role created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectRole'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectRoleRequest'
  /api/projects/roles/{id}/:
    delete:
      operationId: remove
      summary: ✨ Remove project role for user
      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>\n\n        Remove project role for user allowing the user the same access level provided by organization role.\n        "
      tags:
      - subpackage_projects.subpackage_projects/roles
      parameters:
      - name: id
        in: path
        description: A unique integer value identifying this project role.
        required: true
        schema:
          type: integer
      - 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
  /api/projects/{id}/roles:
    get:
      operationId: get
      summary: ✨ List project roles
      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>\n\n        List users and their project level roles for a given project.\n        If user is not listed here and is a member of the project then they would behave as assigned role in organization.\n        "
      tags:
      - subpackage_projects.subpackage_projects/roles
      parameters:
      - name: id
        in: path
        required: true
        schema:
          type: integer
      - 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:
                type: array
                items:
                  $ref: '#/components/schemas/ProjectRole'
components:
  schemas:
    Role9e7Enum:
      type: string
      enum:
      - OW
      - AD
      - MA
      - RE
      - AN
      - DI
      - 'NO'
      description: '* `OW` - Owner

        * `AD` - Administrator

        * `MA` - Manager

        * `RE` - Reviewer

        * `AN` - Annotator

        * `DI` - Deactivated

        * `NO` - Not Activated'
      title: Role9e7Enum
    ProjectRole:
      type: object
      properties:
        id:
          type: integer
        project:
          type: integer
        role:
          $ref: '#/components/schemas/Role9e7Enum'
        user:
          type: integer
      required:
      - id
      - project
      - role
      - user
      title: ProjectRole
    ProjectRoleRequest:
      type: object
      properties:
        project:
          type: integer
        role:
          $ref: '#/components/schemas/Role9e7Enum'
        user:
          type: integer
      required:
      - project
      - role
      - user
      title: ProjectRoleRequest
  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>'