Block access to tasks

Attention

The toloka.yandex.com domain will be disabled starting April 1, 2023. Please use the toloka.dev domain for API requests.

Blocks a Toloker from accessing tasks.

Request

Production version
Sandbox
PUT https://toloka.dev/api/v1/user-restrictions
Authorization: OAuth <OAuth token>
Content-Type: application/JSON

Headers

TitleOverview
AuthorizationA token for account authorization. Add OAuth as a prefix.
Content-TypeSpecifies the data format in the request body.

Request body

{
"scope": "PROJECT",
"user_id": "f25a5f41-94e8-49bf-977f-3611087a16b3",
"project_id": "10",
"private_comment": "Many mistakes",
"will_expire": "2016-04-10T18:08:07"
}
ParameterOverview
scope

string | required

The scope of the ban:

  • ALL_PROJECTS — All the requester's projects.
  • PROJECT — A single project (specify the project_id).
  • POOL — A pool (specify the pool_id).
user_idstring | required

Toloker ID.
project_idstring | required if

Required if scope=PROJECT.

The ID of the project that is blocked.
pool_idstring | required if

Required if scope=POOL.

The ID of the pool that is blocked.
private_commentstring

Comments with the reason for blocking access.

Maximum length: 499 characters.
will_expirestring

The UTC date and time when access will be restored. It uses ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

Response

Contains the ban ID and parameters, and the date when access was blocked.

{
"scope": "PROJECT",
"user_id": "f25a5f41-94e8-49bf-977f-3611087a16b3",
"project_id": "10",
"private_comment": "Many mistakes",
"will_expire": "2016-04-10T18:08:07",
"id": "54",
"created": "2016-03-28T18:08:07"
}
ParameterOverview
scope

string

The scope of the ban:

  • ALL_PROJECTS — All the requester's projects.
  • PROJECT — A single project (specify the project_id).
  • POOL — A pool (specify the pool_id).
user_idstring

Toloker ID.
project_idstring

Required if scope=PROJECT.

The ID of the project that is blocked.
pool_idstring

Specified if scope=POOL.

The ID of the pool that is blocked.
private_commentstring

Comments with the reason for blocking access.

Maximum length: 499 characters.
will_expirestring

The UTC date and time when access will be restored. It uses ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].
createdstring

The UTC date and time of the ban, in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].
idstring

ID of the ban.
Contact support
Toloka API
OverviewAccessing the APIRate limiting
Quick start
Reference
Project
Pools
Training
Subscriptions to events
Toloker selection
Ways to upload tasks
Tasks
Task suites
Tracking operations
Getting responses
Checking completed tasks
Rewards
Messages for Tolokers
Various parameters
Libraries