---
metadata:
  - name: generator
    content: Diplodoc Platform v5.70.0
vcsPath: >-
  motorway/magacg/support/docs/src/ru-x-ai/methods/post-api-flights-tasks-addbulk-v1.md
alternate:
  - href: >-
      https://yamagistrali.ru/docs/ru-x-ai/methods/post-api-flights-tasks-addbulk-v1.md
    type: text/markdown
    title: Markdown version
  - href: https://yamagistrali.ru/docs/ru-x-ai/llms.txt
    rel: describedby
---
<div class="openapi">

# Добавить задачи в рейс

<!-- markdownlint-disable-file -->

[Порядок работы для агента](https://yamagistrali.ru/docs/ru-x-ai/concepts/agent-workflow.md) · [Методы API и схема OpenAPI](https://yamagistrali.ru/docs/ru-x-ai/methods/index.md).

## Назначение

Добавьте задачи заказов в рейс и задайте порядок погрузки и выгрузки. В `data.tasks[].taskId` передавайте `transferOrderTaskID` из карточки заказа. Сохраните идентификаторы задач рейса из `data.ids`.

> Блоки запроса и ответов ниже сгенерированы из OpenAPI. Подстановки вроде `example` показывают структуру JSON. Для вызова возьмите значения из сценария, справочников или предыдущих ответов API.

## Request

<div class="openapi__requests">

<div class="openapi__request__wrapper" style="--method: var(--dc-openapi-methods-post);margin-bottom: 12px">

<div class="openapi__request">

POST {.openapi__method}
```text translate=no
https://partner-test-yamagistrali.ru/api/flights/tasks/addBulk/v1
```

</div>

Тестовый стенд

</div>

</div>

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "data": {
    "tasks": [
      {
        "externalId": "example",
        "flightId": "example",
        "loadingOrder": 0,
        "taskId": "example",
        "unloadingOrder": 0
      }
    ]
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_data_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [FlightTasksAddBulkV1Request](https://yamagistrali.ru/docs/ru-x-ai/methods/post-api-flights-tasks-addbulk-v1.md#entity-FlightTasksAddBulkV1Request)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "tasks": [
    {
      "externalId": "example",
      "flightId": "example",
      "loadingOrder": 0,
      "taskId": "example",
      "unloadingOrder": 0
    }
  ]
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### FlightTasksAddBulkV1FlightTask {#entity-FlightTasksAddBulkV1FlightTask}

#|
|| **Name** | **Description** ||
||

_externalId_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_flightId_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_loadingOrder_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer
{.table-cell}
||
||

_taskId_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_unloadingOrder_{.json-schema-reset .json-schema-property .json-schema-required}
{.table-cell}|
**Type**: integer
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "externalId": "example",
  "flightId": "example",
  "loadingOrder": 0,
  "taskId": "example",
  "unloadingOrder": 0
}
```

{% endcut %}

</div>

<div class="openapi-entity">

### FlightTasksAddBulkV1Request {#entity-FlightTasksAddBulkV1Request}

#|
|| **Name** | **Description** ||
||

_tasks_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [FlightTasksAddBulkV1FlightTask](https://yamagistrali.ru/docs/ru-x-ai/methods/post-api-flights-tasks-addbulk-v1.md#entity-FlightTasksAddBulkV1FlightTask)[] &#124; null

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  {
    "externalId": "example",
    "flightId": "example",
    "loadingOrder": 0,
    "taskId": "example",
    "unloadingOrder": 0
  }
]
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "tasks": [
    {
      "externalId": "example",
      "flightId": "example",
      "loadingOrder": 0,
      "taskId": "example",
      "unloadingOrder": 0
    }
  ]
}
```

{% endcut %}

</div>

## Responses

<div class="openapi__response__code__200">

## 200 OK

OK

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "data": {
    "ids": [
      "example"
    ]
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_data_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [FlightTasksAddBulkV1Response](https://yamagistrali.ru/docs/ru-x-ai/methods/post-api-flights-tasks-addbulk-v1.md#entity-FlightTasksAddBulkV1Response)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "ids": [
    "example"
  ]
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### FlightTasksAddBulkV1Response {#entity-FlightTasksAddBulkV1Response}

#|
|| **Name** | **Description** ||
||

_ids_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string[] &#124; null

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
[
  "example"
]
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "ids": [
    "example"
  ]
}
```

{% endcut %}

</div>

</div>

<div class="openapi__response__code__400">

## 400 Bad Request

Bad Request

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error": {
    "info": {},
    "message": "example",
    "message_code": "example"
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_error_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [Error](https://yamagistrali.ru/docs/ru-x-ai/methods/post-api-flights-tasks-addbulk-v1.md#entity-Error)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "info": {},
  "message": "example",
  "message_code": "example"
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

<div class="openapi-entity">

### Error {#entity-Error}

#|
|| **Name** | **Description** ||
||

_info_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: object

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{}
```

{% endcut %}
{.table-cell}
||
||

_message_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
||

_message_code_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: string

_Example:_{.json-schema-reset .json-schema-example} `example`
{.table-cell}
||
|#{.json-schema-properties}

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "info": {},
  "message": "example",
  "message_code": "example"
}
```

{% endcut %}

</div>

</div>

<div class="openapi__response__code__403">

## 403 Forbidden

Forbidden

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error": {
    "info": {},
    "message": "example",
    "message_code": "example"
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_error_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [Error](https://yamagistrali.ru/docs/ru-x-ai/methods/post-api-flights-tasks-addbulk-v1.md#entity-Error)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "info": {},
  "message": "example",
  "message_code": "example"
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

<div class="openapi__response__code__500">

## 500 Internal Server Error

Internal Server Error

<div class="openapi-entity">

### Body

{% cut "application/json" %}

```json translate=no
{
  "error": {
    "info": {},
    "message": "example",
    "message_code": "example"
  }
}
```

{% endcut %}

#|
|| **Name** | **Description** ||
||

_error_{.json-schema-reset .json-schema-property}
{.table-cell}|
**Type**: [Error](https://yamagistrali.ru/docs/ru-x-ai/methods/post-api-flights-tasks-addbulk-v1.md#entity-Error)

{% cut "**Example**" %}{.json-schema-example}

```json translate=no
{
  "info": {},
  "message": "example",
  "message_code": "example"
}
```

{% endcut %}
{.table-cell}
||
|#{.json-schema-properties}

</div>

</div>

</div>

[*Deprecated]: No longer supported, please use an alternative and newer version.