Create multiple task suites

To create multiple task suites, send a POST request to the /task-suites resource. You can send a maximum of 100,000 requests of this kind per minute and 2,000,000 requests per day.

Request

POST /api/v1/task-suites ?
  [async_mode=<true/false>]
& [skip_invalid_items=<true/false>]
& [allow_defaults=<true/false>]
& [open_pool=<true/false>]
& [operation_id=<operation ID>]

Host: https://sandbox.toloka.yandex.ru
Authorization: OAuth <OAuth token>
Content-Type: application/JSON

[{task suite 1}, {task suite 2},... {task suite n}]

Request parameters:

Parameter

Description

Data type

Required

async_mode

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 the created task suites. Maximum of 5000 task suites per request.

The default value is false.

Boolean

No

skip_invalid_items

Validation parameters for JSON objects:

  • true — Create the task suites that passed validation. Skip the rest of the task suites.

  • 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.

Boolean

No

allow-defaults

Overlap settings:

The default value is false.

Boolean

No

open_pool

Open the pool immediately after creating a task suite, if the pool is closed. The default value is false.

Boolean

No

operation_id

Operation ID for asynchronous loading of task suites (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 task suites.

The ID should conform to the RFC4122 standard.

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

String

No

Response

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

  • Information about the operation (async_mode=true).

  • The task suites (async_mode=false).

{
  "id": "26e130ad3652443a3dc5094791e48ef9",
  "type": "TASK_SUITE.BATCH.CREATE",
  "status": "FAIL",
  "submitted": "2015-12-13T23:32:01",
  "started": "2015-12-13T23:33:00",
  "finished": "2015-12-13T23:34:12",
  "details": {
    "success_count": 0,
    "failed_count": 2
  }
}
Key descriptions

Key

Value

Data type

id

Operation ID.

String

type

Operation type:

  • POOL.OPEN — Opening a pool.

  • POOL.CLOSE — Closing a pool.

  • PROJECT.ARCHIVE — Archiving a project.

  • POOL.ARCHIVE — Archiving a pool.

  • TASK_SUITE.BATCH_CREATE — Creating multiple task suites.

String

status

The status of the operation:

  • PENDING — Not started yet.

  • RUNNING — In progress.

  • SUCCESS — Completed sucessfully.

  • FAIL — Not completed.

String

submitted

The UTC date and time the request was sent, in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

started

The UTC date and time the operation started, in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

finished

The UTC date and time the operation was completed, in ISO 8601 format: YYYY-MM-DDThh:mm:ss[.sss].

String

details. success_count

The number of uploaded task suites.

Number

details. failed_count

The number of task suites that didn't upload.

Number