Toloka documentation

Get a list of bans

Warning

We recommend that you use the toloka.dev domain for API requests. The toloka.yandex.com domain is still supported but it will be deprecated soon.

Gets the list of Toloker bans.

Request

GET https://toloka.dev/api/v1/user-restrictions
Authorization: OAuth <OAuth token>
GET https://sandbox.toloka.dev/api/v1/user-restrictions
Authorization: OAuth <OAuth token>

Headers

Title Overview
Authorization A token for account authorization. Add OAuth as a prefix.

Query parameters

Specified in the link after the question mark; separated by &.

Parameter

Overview

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).
  • SYSTEM — Users that performed the requester's tasks but were banned on the platform.

user_id

string

Toloker ID.

project_id

string | mandatory if

Required if scope=PROJECT.

The ID of the project that is blocked.

pool_id

string | mandatory if

Required if scope=POOL.

The ID of the pool that is blocked.

sort

string

Parameters to sort by:

  • id — The ID.
  • created — The creation date in UTC using ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

To learn how to configure sorting, see Sorting the list of objects.

Standard query parameters

limit, id_gt, id_gte, id_lt, id_lte, created_gt, created_gte, created_lt, created_lte.

Query example

To get the list of bans in parts (for example, 10 bans at a time), use a combination of parameters in requests:

GET https://toloka.dev/api/v1/user-restrictions?sort=id&limit=10
Authorization: OAuth <OAuth token>
GET https://toloka.dev/api/v1/user-restrictions?sort=id&limit=10&id_gt=<id last ban from the answer to the previous query>
Authorization: OAuth <OAuth token>
GET https://sandbox.toloka.dev/api/v1/user-restrictions?sort=id&limit=10
Authorization: OAuth <OAuth token>
GET https://sandbox.toloka.dev/api/v1/user-restrictions?sort=id&limit=10&id_gt=<id last ban from the answer to the previous query>
Authorization: OAuth <OAuth token>

Response

Contains a list of bans in the items array:

{"items" : [{ban parameters 1}, {ban parameters 2}, ... {ban parameters n}], "has_more": true}