Open or close a training pool

To make tasks available to users, you need to open the training pool. Send a POST request to the /trainings/<training pool ID>/open resource.

To close a pool and stop assigning tasks, send a POST request to the /trainings/<training pool ID>/close resource. When you send requests, an operation is created. To track the progress of the operation, send a request to the /operations resource.

Note. If the current training pool status is the same as the requested status, an empty response with status 204 is returned.

Request

Open a training:

POST /api/v1/trainings/<training pool ID>/open
Host: https://sandbox.toloka.yandex.com
Authorization: OAuth <OAuth token>

Close a training:

POST /api/v1/trainings/<training pool ID>/close
Host: https://sandbox.toloka.yandex.com
Authorization: OAuth <OAuth token>

Response

Contains information about the operation:

{
  "id": "52829015-033f-4c3a-a7cc-0d7eff235663",
  "type": "TRAINING.OPEN",
  "status": "SUCCESS",
  "submitted": "2021-02-26T10:13:32.921",
  "started": "2021-02-26T10:13:32.921",
  "finished": "2021-02-26T10:13:32.921",
  "progress": 100,
  "parameters": {
    "training_id": "123456"
  },
  "details": {}
}
Key descriptions
Key Value Data type
id
Operation ID. String
type
Operation type:
  • TRAINING.OPEN — Open a training pool.
  • TRAINING.CLOSE — Close a training pool.
  • TRAINING.CLONE — Clone a training pool.
  • TRAINING.ARCHIVE — Archive a training pool.
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
progress
The percentage of the operation completed. Number
parameters.training_id
ID of the training pool. String
details
Details of the operation completion. JSON
Key Value Data type
id
Operation ID. String
type
Operation type:
  • TRAINING.OPEN — Open a training pool.
  • TRAINING.CLOSE — Close a training pool.
  • TRAINING.CLONE — Clone a training pool.
  • TRAINING.ARCHIVE — Archive a training pool.
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
progress
The percentage of the operation completed. Number
parameters.training_id
ID of the training pool. String
details
Details of the operation completion. JSON