---
metadata:
  - name: generator
    content: Diplodoc Platform v5.47.3
alternate:
  - https://yandex.com.tr/support/tracker/en/api-ref/import/import-worklogs.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.com.tr/support/tracker/en/llms.txt

```
---
title: "Import time entries"
description: "This article describes how to import time entries."
---

# Import time entries

Use the request to import time spent on an issue into Tracker.

<div class="request_example method_post yfm-clipboard">
    <p>POST</p>
    <pre><code>https://api.tracker.yandex.net/v3/issues/&lt;issue_id>/worklogs/_import</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>

{% include [style-methods](../../_assets/style/methods.md) %}

{% note warning "" %}
{% if audience == "external"%}

Only an [administrator](https://yandex.com/support/tracker/role-model.html) can make this request.

{% else %}

Before making the request, ensure the user has permission to modify the issue where you're importing the time entry.

{% include [import-access](../../_includes/api/import-access.md) %}

{% endif %}

{% endnote %}

## Request format {#query}

To import a time entry, use an HTTP request with the `POST` method. The time entry parameters are passed in the request body in JSON format:

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

{
  "duration": "PT1H",
  "createdAt": "2025-02-18T16:35:41.740+0000",
  "createdBy": "username",
  "start": "2025-02-18T16:35:41.740+0000"
}
```

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

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

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

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

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


* <!-- source: en/_includes/api/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 Cloud Organization.

  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/_includes/api/org-id.md -->


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

{% cut "Resource" %}

Parameter | Description | Data type
--- | --- | ---
\<issue_id\> | Key of the issue for which the time entry is being imported. | String

{% endcut %}

{% cut "Request body parameters" %}

**Required parameters**

Parameter | Description | Data type
-------- | -------- | ----------
duration | Time spent, in the ```PnYnMnDTnHnMnS, PnW``` format compliant with ISO 8601. {% if place == 'site' %}[ISO 8601 text](http://dotat.at/tmp/ISO_8601-2004_E.pdf){% endif %}<br><br>Use the letter T to separate hours, minutes, and seconds.<br><br>For example, the value `P6W` corresponds to an interval of 6 weeks (30 working days), `PT300M` to 300 minutes (5 hours), and `P0Y0M30DT2H10M25S` to an interval of 30 days, 2 hours, 10 minutes, and 25 seconds. | String
createdAt | Date and time when the time entry was created, in the `YYYY-MM-DDThh:mm:ss.sss±hhmm` format. You can specify a time within the interval from the issue creation to its last update for which you're importing the time entry. | String
createdBy | Username or user ID who created the time entry. | <ul><li>String for username</li><li>Number for ID</li></ul>
start | Date and time when work on the issue started, in the `YYYY-MM-DDThh:mm:ss.sss±hhmm` format. | String

**Additional parameters**

Parameter | Description | Data type
-------- | -------- | ----------
comment | Text of the comment to the time entry. The comment will be saved in the [**Time spent report**](https://yandex.com/support/tracker/user/reports.html#time-spent-report). | String

{% endcut %}

## Response format {#answer}

{% list tabs %}

- Successful request

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

    The response body contains the parameters of the time entry in JSON format:

    ```json translate=no
    {
            "self": "https://api.tracker.yandex.net/v3/issues/ISSUE-1/worklog/37",
            "id": 37,
            "version": 1,
            "issue": {
                "self": "https://api.tracker.yandex.net/v3/issues/ISSUE-1",
                "id": "66e4********************",
                "key": "ISSUE-1",
                "display": "My issue 1"
            },
            "comment": "My comment",
            "createdBy": {
                "self": "https://api.tracker.yandex.net/v3/users/80***************",
                "id": "80***************",
                "display": "Username",
                "cloudUid": "aj***************",
                "passportUid": 196******
            },
            "updatedBy": {
                "self": "https://api.tracker.yandex.net/v3/users/80***************",
                "id": "80***************",
                "display": "Username",
                "cloudUid": "aj***************",
                "passportUid": 196******
            },
            "createdAt": "2025-02-18T16:35:41.740+0000",
            "updatedAt": "2025-02-18T16:35:41.740+0000",
            "start": "2025-02-18T16:35:41.740+0000",
            "duration": "P1DT1H"
    }
    ```
    {% cut "Response parameters" %}

    Parameter | Description | Data type
    -------- | -------- | ----------
    self | Address of the API resource that contains information about the time entry. | String
    id | Time entry ID. | Number
    version | Time entry version. | Number
    [issue](#issue) | Block with issue information. | Object
    comment | Text of the comment to the time entry. The comment will be saved in the [**Time spent report**](https://yandex.com/support/tracker/user/reports.html#time-spent-report). | String
    [createdBy](#createdBy) | Block with information about the entry creator. | Object
    [updatedBy](#updatedBy) | Block with information about the last user who modified the entry. | Object
    createdAt | Date and time when the time entry was created. | String
    updatedAt | Date and time when the time entry was modified. | String
    start | Date and time when work on the issue started, in the `YYYY-MM-DDThh:mm:ss.sss±hhmm` format. | String
    duration | Time spent, in the `PnYnMnDTnHnMnS, PnW` format compliant with ISO 8601. {% if place == 'site' %}[ISO 8601 text](http://dotat.at/tmp/ISO_8601-2004_E.pdf){% endif %} | String

    **Fields of the `issue` object** {#issue}

    Parameter | Description | Data type
    -------- | -------- | ----------
    self | Address of the API resource that contains information about the issue. | String
    id | Address of the API resource that contains information about the issue. | String
    key | Issue key. | String
    display | Display name of the issue. | String

    **Fields of the `createdBy` object** {#createdBy}

    Parameter | Description | Data type
    -------- | -------- | ----------
    self | Link to the user. | String
    id | User ID. | String
    display | Display name of the user. | String
    passportUid | Unique ID of the user account{% if audience == "external" %} in the Yandex 360 for Business organization and Yandex ID{% endif %}. | Number
    {% if audience == "external" %}cloudUid | Unique user ID in Yandex Cloud Organization. | String{% endif %}

    **Fields of the `updatedBy` object** {#updatedBy}

    Parameter | Description | Data type
    -------- | -------- | ----------
    self | Link to the user. | String
    id | User ID. | String
    display | Display name of the user. | String
    passportUid | Unique ID of the user account{% if audience == "external" %} in the Yandex 360 for Business organization and Yandex ID{% endif %}. | Number
    {% if audience == "external" %}cloudUid | Unique user ID in Yandex Cloud Organization. | String{% endif %}

    {% endcut %}

- Request completed with an error

    If the request could not be processed successfully, the response message contains information about the errors that occurred:

    <!-- source: en/_includes/api/answer-error-400.md -->
    400
    :   One or more request parameters have an invalid value.
    <!-- endsource: en/_includes/api/answer-error-400.md -->

    <!-- source: en/_includes/api/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/_includes/api/answer-error-403.md -->

    <!-- source: en/_includes/api/answer-error-404.md -->
    404
    :   The requested object was not found. You may have specified an invalid object ID or key.
    <!-- endsource: en/_includes/api/answer-error-404.md -->

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

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

    <!-- source: en/_includes/api/answer-error-503.md -->
    503
    :   The API service is temporarily unavailable.
    <!-- endsource: en/_includes/api/answer-error-503.md -->

{% endlist %}

```