Get a list of bans

Attention

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

Gets the list of Toloker bans.

Request

Tip

Try our new API reference: more parameter details, request/response examples, and code samples in various programming languages, including the Toloka-Kit usage samples.

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

Headers

TitleOverview
AuthorizationA token for account authorization. Add OAuth as a prefix.

Query parameters

Query parameters are specified in the link after the question mark and separated by &.

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

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.
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 parameterslimit, 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:

Production version
Sandbox
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>

Response

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

Contains a list of bans.
has_more

boolean

Shows whether the list is complete.

Acceptable values:

  • true — Not all elements are included in the output due to restrictions in the limit parameter.

    You can get the rest of the results by using the _lt(e) and _gt(e) parameters.

    Learn more about standard query parameters.

  • false — The output contains all the items.

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
Bonuses
Messages for Tolokers
Various parameters
Libraries