Get a list of bans

  1. Request
  2. Headers
  3. Query parameters
  4. Query example
  5. Response

Gets the list of user bans.

Request

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

Headers

Title Overview
authorization A token for account authorization. Add OAuth as a prefix.
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

User ID.

project_id

string | required if

Required if scope=PROJECT.

The ID of the project that is blocked.

pool_id

string | required if

Required if scope=POOL.

The ID of the pool that is blocked.

sort

string

Parameters for sorting in ascending order:

  • id — The ID.

  • created — Date of creation, in UTC in the format YYYY-MM-DD.

You can set multiple comma-separated parameters.

To change the sorting direction to descending, add the minus sign before the parameter. For example, sort=-id.

Standard query parameters limit, id_gt, id_gte, id_lt, id_lte, created_gt, created_gte, created_lt, created_lte

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

User ID.

project_id

string | required if

Required if scope=PROJECT.

The ID of the project that is blocked.

pool_id

string | required if

Required if scope=POOL.

The ID of the pool that is blocked.

sort

string

Parameters for sorting in ascending order:

  • id — The ID.

  • created — Date of creation, in UTC in the format YYYY-MM-DD.

You can set multiple comma-separated parameters.

To change the sorting direction to descending, add the minus sign before the parameter. For example, sort=-id.

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.yandex.com/api/v1/user-restrictions?sort=id&limit=10
Authorization: OAuth <OAuth token>
GET https://toloka.yandex.com/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}