Create multiple tasks

Attention

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

Creates multiple tasks.

You can add a maximum of 100,000 tasks per minute and a maximum of 2,000,000 tasks per day.

Request

Production version
Sandbox
POST https://toloka.dev/api/v1/tasks
Authorization: OAuth <OAuth token>
Content-Type: application/JSON
[{task 1}, {task 2},... {task 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, number of task suites).
  • false — Synchronous. The response contains information about one or more created tasks. Maximum of 5000 tasks per request.

    The default value is false.
allow_defaults

boolean

Overlap settings:

  • true — Use the overlap that is set in the pool parameters (in the defaults.default_overlap_for_new_tasks key).
  • false — Use the overlap that is set in the task parameters (in the overlap field).

    The default value is false.
skip_invalid_items

boolean

Validation parameters for JSON objects:

  • true — Create the tasks that passed validation. Skip the rest of the tasks (errors will be listed in the response to the request).
  • false — If one or more tasks didn't pass validation, stop the operation and don't create any tasks.

    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 a scheduled upload of one or more tasks (if async_mode=true is set).

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

The ID should conform to the RFC4122 standard.

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

Response

Depending on the async_mode value in the request, the response contains:

Data for the tasks (async_mode=false)
Information about the operation (async_mode=true)
{
"items": {
"0": {
"id": "f432cac2-7184-47a3-8220-12ce362cb208",
"pool_id": "21",
"input_values": {
"image": "http://images.com/1.png"
},
"overlap": 3,
"created": "2016-09-29T18:04:00"
}
},
"validation_errors": {
"1": {
"input_values.image": {
"code": "VALUE_REQUIRED",
"message": "Value must be present and not equal to null"
}
}
}
}
ParameterOverview
itemsobject

An object with the created tasks.
<n>object

Sequential number of the task in the array when created (starting from 0).
idstring

Task ID.
pool_idstring

The ID of the pool that the task is uploaded to.
overlapstring

Task suite overlap.
createdstring

The UTC date and time when the task suite was created, in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].
validation_errorsobject

An object with errors in tasks. Returned if the request has the parameter skip_invalid_items=true.
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