Toloka Projects API

Create and manage projects that define task interface and instructions.

OpenAPI Specification

toloka-projects-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Toloka Assignments Projects API
  description: The Toloka API lets you build scalable, fully automated human-in-the-loop data-labeling and human-data pipelines on the Toloka crowdsourcing platform. You manage projects, pools, training pools, tasks, task suites, and assignments; collect and review Toloker responses; issue bonuses; manage skills and attachments; track asynchronous operations; and subscribe to event webhooks. Most write operations that touch large batches of tasks or suites run asynchronously and return an Operation you poll to completion.
  termsOfService: https://toloka.ai/legal/terms_of_service/
  contact:
    name: Toloka Support
    email: support@toloka.ai
  version: '1.0'
servers:
- url: https://api.toloka.ai/api
  description: Toloka production API (api.toloka.ai)
- url: https://toloka.dev/api
  description: Toloka production API (toloka.dev)
security:
- OAuthToken: []
tags:
- name: Projects
  description: Create and manage projects that define task interface and instructions.
paths:
  /v1/projects:
    get:
      operationId: getProjects
      tags:
      - Projects
      summary: Get the list of projects
      parameters:
      - $ref: '#/components/parameters/Limit'
      - $ref: '#/components/parameters/SortField'
      - name: status
        in: query
        schema:
          type: string
          enum:
          - ACTIVE
          - ARCHIVED
        description: Filter projects by status.
      responses:
        '200':
          description: A page of projects.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectSearchResult'
    post:
      operationId: createProject
      tags:
      - Projects
      summary: Create a project
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Project'
      responses:
        '201':
          description: The created project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
  /v1/projects/{id}:
    get:
      operationId: getProject
      tags:
      - Projects
      summary: Get a project
      parameters:
      - $ref: '#/components/parameters/PathId'
      responses:
        '200':
          description: The requested project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
    put:
      operationId: updateProject
      tags:
      - Projects
      summary: Edit a project
      parameters:
      - $ref: '#/components/parameters/PathId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Project'
      responses:
        '200':
          description: The updated project.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Project'
  /v1/projects/{id}/archive:
    post:
      operationId: archiveProject
      tags:
      - Projects
      summary: Archive a project
      parameters:
      - $ref: '#/components/parameters/PathId'
      responses:
        '202':
          description: An asynchronous archive operation.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Operation'
components:
  parameters:
    Limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 50
        maximum: 100000
      description: Maximum number of results per page.
    SortField:
      name: sort
      in: query
      schema:
        type: string
      description: Comma-separated sort fields; prefix with `-` for descending.
    PathId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Object identifier.
  schemas:
    ProjectSearchResult:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/Project'
        has_more:
          type: boolean
    Operation:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        type:
          type: string
          description: Operation type, e.g. POOL.OPEN, TASK.BATCH_CREATE.
        status:
          type: string
          enum:
          - PENDING
          - RUNNING
          - SUCCESS
          - FAIL
        submitted:
          type: string
          format: date-time
        started:
          type: string
          format: date-time
        finished:
          type: string
          format: date-time
        progress:
          type: integer
        parameters:
          type: object
          additionalProperties: true
        details:
          type: object
          additionalProperties: true
    Project:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        public_name:
          type: string
        public_description:
          type: string
        private_comment:
          type: string
        task_spec:
          $ref: '#/components/schemas/TaskSpec'
        assignments_issuing_type:
          type: string
          enum:
          - AUTOMATED
          - MAP_SELECTOR
        status:
          type: string
          enum:
          - ACTIVE
          - ARCHIVED
          readOnly: true
        created:
          type: string
          format: date-time
          readOnly: true
      required:
      - public_name
      - public_description
      - task_spec
    TaskSpec:
      type: object
      description: Defines the task input/output schema and the Toloker view.
      properties:
        input_spec:
          type: object
          additionalProperties: true
        output_spec:
          type: object
          additionalProperties: true
        view_spec:
          type: object
          additionalProperties: true
  securitySchemes:
    OAuthToken:
      type: apiKey
      in: header
      name: Authorization
      description: 'Pass your Toloka OAuth token (or API key) in the Authorization header as `Authorization: OAuth <token>` (legacy) or `Authorization: ApiKey <key>`.'