---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
  - property: og:type
    content: article
  - property: article:section
    content: API reference
  - property: og:title
    content: Create employee absences
  - property: article:tag
    content: Technical instructions
alternate:
  - https://yandex.ru/support/tracker/en/api-ref/gaps/post-gaps.md
  - https://yandex.ru/support/tracker/ru/api-ref/gaps/post-gaps.md
  - href: en/api-ref/gaps/post-gaps.md
    type: text/markdown
    title: Markdown version
  - href: ../../llms.txt
    type: text/markdown
    title: llms.txt
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/support/tracker/en/llms.txt


# Create employee absences

Use this request to create records about employee absences (vacations, sick leaves, on-duty shifts, and others). Absences are displayed on user avatars and the resource chart in portfolios and projects.

<div class="request_example method_post yfm-clipboard">
    <p>POST</p>
    <pre><code>https://api.tracker.yandex.net/v3/gaps</code></pre>
    <button class="yfm-clipboard-button"><svg width="16" height="16" viewBox="0 0 24 24" class="yfm-clipboard-icon" data-animation="15">
    <path fill="currentColor" d="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z"></path>
    <path stroke="currentColor" fill="transparent" strokewidth="1.5" d="M9.5 13l3 3l5 -5" visibility="hidden">
        <animate id="visibileAnimation-15" attributeName="visibility" from="hidden" to="visible" dur="0.2s" fill="freeze" begin=""></animate>
        <animate id="hideAnimation-15" attributeName="visibility" from="visible" to="hidden" dur="1s" begin="visibileAnimation-15.end+1" fill="freeze"></animate>
    </path>
</svg>
</button>
</div>

<!-- source: en/api-ref/_assets/style/methods.md -->

<!-- endsource: en/api-ref/_assets/style/methods.md -->

## Request format {#query}

Before executing the request, [get access to the API](https://yandex.ru/support/tracker/en/api-ref/access.md).

<!-- source: en/api-ref/_includes/query-admin.md -->
{% note info "" %}

You need [Administrator](https://yandex.ru/support/tracker/en/role-model.md#admin) rights to run this request.

{% endnote %}
<!-- endsource: en/api-ref/_includes/query-admin.md -->

To create a record about employee absences, use an HTTP request with the `POST` method. In the request body, specify the parameters in JSON format.

```json translate=no
POST /v3/gaps
Host: api.tracker.yandex.net
Authorization: OAuth <OAuth-token>
Content-Type: application/json
X-Org-ID or X-Cloud-Org-ID: <organization_ID>

{
  "gaps": [
    {
      "id": "<absence_ID>",
      "user": "<user_login>",
      "workflow": "<absence_type>",
      "from": "<start_date>",
      "to": "<end_date>",
      "fullDay": true,
      "workInAbsence": false
    }
  ]
}
```

<!-- source: en/api-ref/_includes/headings.md -->
{% cut "Headers" %}

* `Host`: address of the node that provides the API.

* <!-- source: en/api-ref/_includes/authorization.md -->
  `Authorization`: Authorization token about these formats:

    - `OAuth <OAuth_token>`: For authorization using the OAuth 2.0 protocol. [Learn more](https://yandex.ru/support/tracker/en/api-ref/access.md#about_OAuth)

    - `Bearer <IAM_token>`: For authorization using an IAM token, if a Yandex Identity Hub organization is linked to Tracker. [Learn more](https://yandex.ru/support/tracker/en/api-ref/access.md#iam-token)
  <!-- endsource: en/api-ref/_includes/authorization.md -->


* <!-- source: en/api-ref/_includes/org-id.md -->
  `X-Org-ID` or `X-Cloud-Org-ID`: Organization ID.

  - Use the `X-Org-ID` header if a Tracker organization is linked to Yandex 360 for Business.

  - Use the `X-Cloud-Org-ID` header if a Tracker organization is linked to Yandex Identity Hub.

  To get the organization ID, go to **Administration** → [**Organizations**](https://tracker.yandex.com/admin/orgs) and copy the value from the **ID** field. {#find-id}
  <!-- endsource: en/api-ref/_includes/org-id.md -->


{% endcut %}
<!-- endsource: en/api-ref/_includes/headings.md -->

{% cut "Request body parameters" %}

**Required parameters**

Parameter | Description | Data type
----- | ----- | -----
gaps | Array of absence records. The maximum number of elements is 100 | Array of objects

**Array object fields** `gaps`

**Required parameters**

Parameter | Description | Data type
----- | ----- | -----
user | User login or ID | String
workflow | Absence type. Possible values: `vacation`, `paid_day_off`, `illness`, `absence` (general), `trip` (business trip), `conference_trip`, `conference`, `learning`, `maternity`, `duty`. The up-to-date list is available via the `GET /v3/gaps/workflows` request | String
from | Absence start date and time in ISO 8601 format. Must be less than `to` | String
to | Absence end date and time in ISO 8601 format. Must be greater than `from` | String

**Additional parameters**

Parameter | Description | Data type
----- | ----- | -----
id | Absence ID. If not provided, it is generated automatically. The maximum length is 128 characters | String
fullDay | Full-day flag. The default value is `false` | Boolean
workInAbsence | Working during absence flag. The default value is `false` | Boolean

{% endcut %}

> Example: Create two absences for different users
>
> - The HTTP POST method is used.
> - For the `username1` user, a full-day vacation from July 1 to July 15, 2026, is created with the explicitly specified ID `68340a1f2b4c1a3d5e7f9011`.
> - For the `username2` user, a business trip from July 10 to July 20, 2026, is created, and the ID will be generated automatically.
>
> ```json translate=no
> POST /v3/gaps
> Host: api.tracker.yandex.net
> Authorization: OAuth y0__xAbc******
> X-Org-ID: 1234******
>
>{
>  "gaps": [
>    {
>      "id": "68340a1f2b4c1a3d5e7f9011",
>      "user": "username1",
>      "workflow": "vacation",
>      "from": "2026-07-01T00:00:00.000Z",
>      "to": "2026-07-15T00:00:00.000Z",
>      "fullDay": true,
>      "workInAbsence": false
>    },
>    {
>      "user": "username2",
>      "workflow": "trip",
>      "from": "2026-07-10T00:00:00.000Z",
>      "to": "2026-07-20T00:00:00.000Z"
>    }
>  ]
>}
> ```

## Response format {#answer}

{% list tabs %}

- Request executed successfully

    <!-- source: en/api-ref/_includes/answer-200.md -->
    If the request is successful, the API returns a response with code `200 OK`.
    <!-- endsource: en/api-ref/_includes/answer-200.md -->

    The response body contains the results in JSON format. Only actually saved records are returned (outdated records are not included).

    ```json translate=no
    {
      "gaps": [
        {
          "id": "68340a1f2b4c1a3d5e7f9011",
          "user": {
            "self": "https://api.tracker.yandex.net/v3/users/1234567890123456",
            "uid": 1234567890123456,
            "login": "username1",
            "trackerUid": 1234567890123456,
            "passportUid": 1234567890,
            "cloudUid": "ajehs6sinuiii1234567",
            "firstName": "John",
            "lastName": "Smith",
            "display": "John Smith",
            "email": "username@example.com",
            "external": false,
            "dismissed": false,
            "firstLoginDate": "2024-04-10T10:15:47.272+0000",
            "lastLoginDate": "2026-07-23T08:11:01.861+0000",
            "sources": [
              "directory"
            ]
          },
          "workflow": "vacation",
          "from": "2026-07-01T00:00:00.000+0000",
          "to": "2026-07-15T00:00:00.000+0000",
          "fullDay": true,
          "workInAbsence": false
        },
        {
          "id": "68340a1f2b4c1a3d5e7f9012",
          "user": {
            "self": "https://api.tracker.yandex.net/v3/users/9876543210987654",
            "uid": 9876543210987654,
            "login": "username2",
            "trackerUid": 9876543210987654,
            "passportUid": 9876543210,
            "cloudUid": "ajehs6sinuiii9876543",
            "firstName": "John",
            "lastName": "Smith",
            "display": "Sam Brown",
            "email": "username@example.com",
            "external": false,
            "dismissed": false,
            "firstLoginDate": "2024-03-05T09:00:00.000+0000",
            "lastLoginDate": "2026-07-22T17:30:00.000+0000",
            "sources": [
              "directory"
            ]
          },
          "workflow": "trip",
          "from": "2026-07-10T00:00:00.000+0000",
          "to": "2026-07-20T00:00:00.000+0000",
          "fullDay": false,
          "workInAbsence": false
        }
      ]
    }
    ```

    {% cut "Response parameters" %}

    Parameter | Description | Data type
    ----- | ----- | -----
    gaps | Array of saved absence records | Array of objects

    **Array object fields** `gaps`

    Parameter | Description | Data type
    ----- | ----- | -----
    id | Absence record ID | String
    [user](#user) | Object with information about the user | Object
    workflow | Absence type | String
    from | Absence start date and time in ISO 8601 format | String
    to | Absence end date and time in ISO 8601 format | String
    fullDay | Full-day flag | Boolean
    workInAbsence | Working during absence flag | Boolean

    **Object fields** `user` {#user}

    Parameter | Description | Data type
    ----- | ----- | -----
    self | Address of the API resource that contains information about the user | String
    uid | Unique user ID | Number
    login | User login | String
    trackerUid | User ID in Tracker | Number
    passportUid | Unique user account ID in Yandex ID | Number
    cloudUid | Unique user ID in Yandex Identity Hub | String
    firstName | User first name | String
    lastName | User last name | String
    display | User display name | String
    email | User email address | String
    external | External user flag | Boolean
    dismissed | Dismissed employee flag | Boolean
    firstLoginDate | Date and time of the user's first login to the system | String
    lastLoginDate | Date and time of the user's last login to the system | String
    sources | User data sources. Possible values: `directory` — profile obtained from the organization's corporate directory; `tracker` — user added directly to Tracker | Array of strings

    {% endcut %}

- Request executed with an error

    If the request was not processed successfully, the API returns a response with an error code:

    <!-- source: en/api-ref/_includes/answer-error-401.md -->
    401
    :   The user is not authorized. Make sure that actions described in the [API access](https://yandex.ru/support/tracker/en/api-ref/access.md) section are performed.
    <!-- endsource: en/api-ref/_includes/answer-error-401.md -->

    <!-- source: en/api-ref/_includes/answer-error-403.md -->
    403
    :   You are not authorized to perform this action. You can check what rights you have in the Tracker interface. The same rights are required to perform an action via the API and interface.
    <!-- endsource: en/api-ref/_includes/answer-error-403.md -->

    <!-- source: en/api-ref/_includes/answer-error-422.md -->
    422
    :   JSON validation error, the request is rejected.
    <!-- endsource: en/api-ref/_includes/answer-error-422.md -->

    {% note info "" %}

    The `422` code is returned in the following cases:
    - The request contains duplicate `id` values.
    - The `from` value is greater than or equal to `to`.
    - The user is not found.
    - The number of elements in the `gaps` array exceeds 100.

    {% endnote %}

    <!-- source: en/api-ref/_includes/answer-error-500.md -->
    500
    :   Internal service error. Try again later.
    <!-- endsource: en/api-ref/_includes/answer-error-500.md -->

{% endlist %}