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


# Custom route fields

If you need to track route information that doesn't fit in the standard fields, you can create custom fields `custom_fields`.

{% note warning %}

This feature is only available in the API.

{% endnote %}

To add and delete fields, contact support. You can also ask which custom fields have already been added.

When working with custom fields, note the following:

- You can only apply fields to a route if they have been added in the company settings.
- The user determines the field format and content on their own.
- No more than 10 fields can be added for one company.
- The maximum length of the field, including the name and value, is 255 characters.
- If you delete a field, it will still remain in previously created routes.
- If you [edit a route](#patch-fields), only the fields in the request will be saved. All other fields are deleted from the route.

Custom fields are displayed:

- In the **Map** section.
    
    {% cut "Example" %}
    
    ![](../_images/custom-field-map.png)
    
    {% endcut %}
    
- In the courier card.
    
    {% cut "Example" %}
    
    ![](../_images/custom-field-info.png)
    
    {% endcut %}
    
- In the **Courier performance report**.
    
    {% cut "Example" %}
    
    ![](../_images/custom-field-report.png)
    
    {% endcut %}
    

## Creating a route {#post-fields}

To create a route with custom fields:

1. Contact support and tell them the names of the fields to add. For example, `route_type` and `route_priority`.
1. Send a POST request to the [routes](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/addsARoute) resource. Go to the `custom_fields` array element. Enter the name in the `key` field and the value in the `value` field. In the sample request below, we'll enter the value `intercity` for `route_type` and `0` for `route_priority`.
    

#### Query

cURL

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

File

```json
{
    "courier_number": "Courier 1",
    "date": "2022-05-12",
    "number": "add-custom-fields",
    "depot_number": "111",
    "route_start": "8:00:00",
    "route_finish": "19:00:00",
    "custom_fields": [
        {
            "key": "route_type",
            "value": "intercity"
        },
        {
            "key": "route_priority",
            "value": "0"
        }
    ]
}

```

#### Result

```json
{
    "id": <route-id>,
    "company_id": <company-id>,
    "courier_id": <courier-id>,
    "car_id": null,
    "custom_fields": [
        {
            "key": "route_type",
            "value": "intercity"
        },
        {
            "key": "route_priority",
            "value": "0"
        }
    ],
    "depot_id": <depot-id>,
    "number": "add-custom-fields",
    "date": "2022-05-12",
    "imei": null,
    "rented_courier_id": null,
    "courier_violated_route": false,
    "routing_mode": "driving",
    "tracking_start_h": null,
    "route_start": "08:00:00",
    "route_finish": "19:00:00",
    "imei_str": null
}
```

## Editing a route {#patch-fields}

To change custom field values, send a PATCH request to the [routes](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/editsRoute) resource. For example, you can leave only the `route_priority` field with the value `1` in the route.

#### Query

cURL

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

File

```json
{
    "courier_number": "Courier 1",
    "date": "2022-05-12",
    "number": "add-custom-fields",
    "depot_number": "111",
    "route_start": "8:00:00",
    "route_finish": "19:00:00",
    "custom_fields": [
        {
            "key": "route_priority",
            "value": "1"
        }
    ]
}
```

#### Result

```json
{
    "id": <route-id>,
    "company_id": <company-id>,
    "courier_id": <courier-id>,
    "car_id": null,
    "custom_fields": [
        {
            "key": "route_priority",
            "value": "1"
        }
    ],
    "depot_id": <depot-id>,
    "number": "add-custom-fields",
    "date": "2022-05-12",
    "imei": null,
    "rented_courier_id": null,
    "courier_violated_route": false,
    "routing_mode": "driving",
    "tracking_start_h": null,
    "route_start": "08:00:00",
    "route_finish": "19:00:00",
    "imei_str": null
}
```

## Getting a route {#get-fields}

To get routes with custom field values, send a GET request to the [routes](https://yandex.ru/routing/doc/en/delivery/redoc/index.html#operation/getsMultipleRoutes) resource.

#### Query

cURL

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

#### Result

```json
[
    {
        "id": <route-id>,
        "company_id": <company-id>,
        "courier_id": <courier-id>,
        "car_id": null,
        "custom_fields": [
            {
                "key": "route_priority",
                "value": "1"
            }
        ],
        "depot_id": <depot-id>,
        "number": "add-custom-fields",
        "date": "2022-05-12",
        "imei": null,
        "rented_courier_id": null,
        "courier_violated_route": false,
        "routing_mode": "driving",
        "tracking_start_h": null,
        "route_start": "08:00:00",
        "route_finish": "19:00:00",
        "imei_str": null
    }
]
```

<!-- 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 -->


