---
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-e199590054b0.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-f3a31303cd7b.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"
}
Headers
  • Host: address of the node that provides the API.

  • Authorization: Authorization token about these formats:

    • OAuth <OAuth_token>: For authorization using the OAuth 2.0 protocol. Learn more

    • Bearer <IAM_token>: For authorization using an IAM token, if a Yandex Cloud Organization organization is linked to Tracker. Learn more

  • 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 AdministrationOrganizations and copy the value from the ID field.

Resource
Parameter Description Data type
<issue_id> Key of the issue for which the time entry is being imported. String
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

Use the letter T to separate hours, minutes, and seconds.

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.
  • String for username
  • Number for ID
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. String

Response format

If the request is successful, the API returns a response with code 200 OK.

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

{
        "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"
}
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 Block with issue information. Object
comment Text of the comment to the time entry. The comment will be saved in the Time spent report. String
createdBy Block with information about the entry creator. Object
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 String

Fields of the issue object

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

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

Fields of the updatedBy object

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

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

400
One or more request parameters have an invalid value.
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.
404
The requested object was not found. You may have specified an invalid object ID or key.
422
JSON validation error, the request is rejected.
500
Internal service error. Try again later.
503
The API service is temporarily unavailable.