Create one or multiple task suites

Attention

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

Creates one or multiple task suites.

Restriction

You can add a maximum of 100,000 tasks per minute and a maximum of 2,000,000 tasks per day. Refer to the Rate limiting section for the complete list of the request limitations in Toloka API.

Request

Production version
Sandbox
POST https://toloka.dev/api/v1/task-suites
Authorization: OAuth <OAuth token>
Content-Type: application/JSON
// one task suite {task suite parameters}
// or multiple task suites [{task suite 1}, {task suite 2},... {task suite N}]

Headers

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

Query parameters

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

ParameterOverview
async_mode

boolean

Mode for request processing:

  • true — Asynchronous. Creates an asynchronous operation that runs in the background. The response contains information about the operation (start and  completion time, status).
  • false — Synchronous. The response contains information about one or multiple task suites created.

    The default value is false.
allow_defaults

boolean

Overlap settings:

skip_invalid_items

boolean

Validation parameters for JSON objects:

  • true — Create the task suites that passed validation.
  • false — If at least one of the task suites didn't pass validation, stop the operation and don't create the task suites.

    The default value is false.
open_poolboolean

Open the pool immediately after the operation is completed, if the pool is closed. The default value is false.
operation_idstring

Operation ID for asynchronously loading one or more task suites (if async_mode=true).

We recommend sending the ID in the POST request to avoid accidental errors, such as creating the operation multiple times for the same task suites.

The ID should conform to the RFC4122 standard.

You can use this ID in the future to get information about the operation.

Request body

{
"id": "63614047-38c3-4ad4-8a86-99c5c651a9b8",
"pool_id": "1",
"tasks": [
{
"id": "49a333ea-2728-4c1c-ab1f-8ab1bfe4ee7e",
"origin_task_id": "e3da7fe1-828d-4d9c-b49d-42c0eb5fcfde",
"input_values": {
"image_url": "www.image1.ru"
},
"known_solutions": [
{
"correctness_weight": 0.95,
"output_values": {
"colour": "black"
}
},
{
"correctness_weight": 0.7,
"output_values": {
"colour": "gray"
}
}
],
"message_on_unknown_solution": "The elephant is black"
},
{
"input_values": {
"image_url": "www.image2.ru"
},
"known_solutions": [
{
"correctness_weight": 1,
"output_values": {
"colour": "white"
}
}
],
"message_on_unknown_solution": "The elephant is white"
}
],
"overlap": 5,
"infinite_overlap": false,
"remaining_overlap": 3,
"reserved_for": [],
"unavailable_for": [],
"issuing_order_override": 3,
"mixed": true,
"automerged": false,
"created": "2016-04-18T12:43:04.988"
}
ParameterOverview
pool_idstring | required

The ID of the pool that tasks are uploaded to.
tasks[]array of object | required

Data for the tasks.
tasks[].input_values

object | required

Input data for a task. List of pairs:

"<ID of field 1>": "<value of field 1>",
"<ID of field 2>": "<value of field 2>",
...
"<ID of field N>": "<value of field N>"
overlapinteger | required if

Required if the parameter is not used when creating a task suite allow_defaults=true, and the overlap is not specified in the pool parameters (in the defaults.​default_​overlap_for_​new_task_suites key).

Task suite overlap.
longitudefloat | required if

Required if tasks are selected on the map. Otherwise, not used.

The longitude of the point on the map for the task suite.
latitudefloat | required if

Required if tasks are selected on the map. Otherwise, not used.

The latitude of the point on the map for the task suite.
tasks[].known_solutionsobject

Responses and hints for control tasks and training tasks.
tasks[].known_solutions.output_values

object

Correct responses in a task (for control tasks). If multiple correct responses are possible, define output_values for each possible response and set the weight for the correct response (the correctness_weight key).

"<ID of field 1>": "<correct response>",
"<ID of field 2>": "<correct response>",
...
"<ID of field N>": "<correct response N>"
tasks[].known_solutions.correctness_weightfloat

The weight of a correct response. Allows you to set multiple versions of correct responses and rank them by correctness. For example, if a correct response is weighted 0.5, it counts as half of a mistake for the Toloker. The more correct the response in correctValues, the higher its weight.
tasks[].message_on_unknown_solutionstring

Hint for the task (for training tasks).
infinite_overlap

boolean | required

Assigning a task suite with infinite overlap. This option is used, for instance, for suites of training tasks when you want to assign them to all Tolokers:

  • true — Use infinite overlap.
  • false — Use the overlap that is set for the task suite or pool.
reserved_for[]array of strings

IDs of Tolokers who will have access to the task suites.
unavailable_for[]array of strings

IDs of Tolokers who shouldn't have access to the task suite.
issuing_order_overridefloat

The priority of a task suite among other suites in the pool. Defines the order in which task suites are assigned to Tolokers. The larger the parameter value, the higher the priority.

This parameter can be used if the pool has issue_task_suites_in_creation_order: true.

Allowed values: from -99999.99999 to 99999.99999.

The default value is 0.
mixed

boolean

Type of operation for creating a task suite:

  • true — Automatically with the "smart mixing" option (for more information, see the documentation).
  • false — Manually.

Response

One task suite
Multiple task suites
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