---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.kz/routing/doc/en/delivery/functions/courier-breaks.md
  - https://yandex.kz/routing/doc/kk/delivery/functions/courier-breaks.md
  - https://yandex.kz/routing/doc/ru/delivery/functions/courier-breaks.md
  - href: en/delivery/functions/courier-breaks.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
title: RouteQ — functions — courier breaks
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.kz/routing/doc/en/llms.txt


# Courier breaks

You can set courier breaks during route [planning](https://yandex.kz/routing/doc/en/vrp/properties-of-vehicles-rest-schedule.md#rest-schedule), after the route has been exported to Track & Trace, and even when the courier is already en route. Breaks aren't displayed on the [map](https://yandex.kz/routing/doc/en/delivery/interface/map.md), but are considered when [ETA is calculated](https://yandex.kz/routing/doc/en/delivery/functions/eta.md).

## Add a break {#add-break}

To add breaks to the courier's route, send a POST request to the [work_breaks](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/addsWorkBreaks) resource.

In the request, specify `company_id` and `route_id`.

In the request body, specify:
* `rest_duration_s`: Break duration in seconds (the minimum value is 1).
* `work_time_range_till_rest`: Working hours before break, in the following format: [D.]HH[:MM[:SS]] - [D.]HH[:MM[:SS]].

#### Query {#add-request}

cURL
  
  ```html
  curl -H "Content-Type: application/json" -H "Authorization: OAuth <your-token>" -X POST -d @<Path_to_file_in_UTF-8_encoding> https://courier.yandex.ru/api/v1/companies/<your-company-id>/routes/<route-id>/work_breaks
  ```

File

  ```json
   {
     "work_time_range_till_rest": "01:00:00-01:30:00",
     "rest_duration_s": 3600
    },{
     "work_time_range_till_rest": "02:30:00-03:00:00",
     "rest_duration_s": 1800
    }
  ```

#### Result {#add-result}

```json
 {
  "break_id": 1,
  "sequence_pos": 0,
  "work_time_range_till_rest": "01:00:00 - 01:30:00",
  "rest_duration_s": 1800
 },
{
  "break_id": 2,
  "sequence_pos": 1,
  "work_time_range_till_rest": "02:30:00 - 03:00:00",
  "rest_duration_s": 1800
 }
```

## Get break information {#get-break}

To get information about courier breaks on the route, send a GET request to the resource [work_breaks](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/getsWorkBreaks). The following break statuses are available:

* `planned`
* `started`
* `finished`

#### Query {#get-request}

cURL

```html
curl -H "Content-Type: application/json" -H "Authorization: OAuth <your-token>" -X GET -d https://courier.yandex.ru/api/v1/companies/<your-company-id>/routes/<route-id>/work_breaks
```

#### Result {#get-result}

```json
    {
        "id": 1,
        "sequence_pos": 0,
        "work_time_range_till_rest": "01:00:00 - 01:30:00",
        "rest_duration_s": 3600,
        "status": "planned",
        "start_at": 1769743980
    },
    {
        "id": 2,
        "sequence_pos": 1,
        "work_time_range_till_rest": "02:30:00 - 03:00:00",
        "rest_duration_s": 1800,
        "status": "planned",
        "start_at": 1769802180
    }
```

## Delete a break {#delete-break}

To delete a break, send a DELETE request to the resource [work_breaks](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/deletesWorkBreak).

#### Query {#delete-request}

cURL
  
```html
curl -H "Content-Type: application/json" -H "Authorization: OAuth <your-token>" -X DELETE -d https://courier.yandex.ru/api/v1/companies/<your-company-id>/routes/<route-id>/work_breaks/<break-id>
```

#### Result {#delete-result}

```json
{
    "id": 1,
    "sequence_pos": 0
}
```

## Possible business case {#example}

**Objective**

You need to add several breaks for a courier after they've started moving along the route and track how this affects the [estimated arrival time](https://yandex.kz/routing/doc/en/delivery/functions/eta.md) (`estimated_service_time`) for the orders.

**Implementation**

1. To get up-to-date information about the route, send a request to the [route-info](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/getsRouteInfo) resource. For order `id` = `410522528`, the ETA is 16:38.

    {% cut "Sample request" %}

    cURL

    ```html
    curl -H "Content-Type: application/json" -H "Authorization: OAuth <your-token>" -X GET -d https://courier.yandex.ru/api/v1/companies/<your-company-id>/route-info?route_id=<route-id>
    ```

    {% endcut %}

2. Schedule two 10-minute breaks:

     * First break is no later than after 40 minutes of work.  
     * Second break is no later than after 70 minutes of work.

    To do this, send a request to the [work_breaks](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/addsWorkBreaks) resource and set the working hours before a break and the duration of breaks (in seconds).

    {% cut "Sample request" %}

    ```json
    {
        "work_time_range_till_rest": "00:30:00-00:40:00",
        "rest_duration_s": 600
    },{
        "work_time_range_till_rest": "01:00:00-01:10:00",
        "rest_duration_s": 600
    }
    ```

    {% endcut %}

    {% cut "Sample response" %}

    ```json
    {
        "id": 4974223,
        "sequence_pos": 0
    },{
        "id": 4974224,
        "sequence_pos": 1
    }
    ```

    {% endcut %}

3. To see how the estimated time of arrival has changed, resend the request to the [route-info](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/getsRouteInfo) resource. For order `id` = `410522528`, the new ETA is 16:50 (the order will be delivered after the break).

4. To check the current status of breaks, send a request to the [work_breaks](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/getsWorkBreaks) resource.

    {% cut "Sample response" %}

    ```json
    {
        "id": 4974223,
        "sequence_pos": 0,
        "work_time_range_till_rest": "00:30:00 - 00:40:00",
        "rest_duration_s": 600,
        "status": "started",
        "start_at": 1770039360
    },{
        "id": 4974224,
        "sequence_pos": 1,
        "work_time_range_till_rest": "01:00:00 - 01:10:00",
        "rest_duration_s": 600,
        "status": "planned",
        "start_at": 1770044160
    }
    ```

    {% endcut %}

<!-- source: en/delivery/_includes/feedback.md -->
<a href="../feedback">
  <span class="button">Contact support</span>
</a>



[//]: # (Version without HTML\: \[Contact support\]\(../../../feedback.md\))
<!-- endsource: en/delivery/_includes/feedback.md -->
