Toloka User Restrictions API

Restrict Tolokers from a pool, project, or all projects.

OpenAPI Specification

toloka-user-restrictions-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Toloka Assignments User Restrictions 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: User Restrictions
  description: Restrict Tolokers from a pool, project, or all projects.
paths:
  /v1/user-restrictions:
    post:
      operationId: createUserRestriction
      tags:
      - User Restrictions
      summary: Restrict a Toloker
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserRestriction'
      responses:
        '201':
          description: The created restriction.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserRestriction'
components:
  schemas:
    UserRestriction:
      type: object
      properties:
        id:
          type: string
          readOnly: true
        user_id:
          type: string
        scope:
          type: string
          enum:
          - ALL_PROJECTS
          - PROJECT
          - POOL
          - SYSTEM
        project_id:
          type: string
        pool_id:
          type: string
        private_comment:
          type: string
        will_expire:
          type: string
          format: date-time
      required:
      - user_id
      - scope
  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>`.'