Request flow
There are two stages in the request flow for the AppMetrica Logs API:

Request to prepare data
The AppMetrica Logs API accepts the request and puts it in the queue. If the request is processed successfully, AppMetrica prepares a file for download. In this case, the API returns the HTTP 202 Accepted status. If the request resulted in an error, the API returns the appropriate response status, and the HTTP message body contains the error description.
Note
Requests in the queue are processed sequentially (each subsequent request is executed strictly after the previous one is completed).
While the request is being processed and the file is being prepared, all identical requests (with the same parameters) will return the HTTP 202 Accepted status.
Sample request:
GET /logs/v1/export/installations.json HTTP/1.1
Host: api.appmetrica.yandex.com
Authorization: OAuth <your_token>
where <your_token> is an OAuth token that you can obtain by following this guide.
Response example:
HTTP/1.1 202 Accepted
Content-Type: text/plain
Wait for result
To get compressed data, send the HTTP Accept-Encoding: gzip header.
Request to download data
The request to download data is identical to the request to prepare data. If the request to prepare the file is complete, for the next identical request, the Logs API returns the 200 OK status. The results file is ready to be downloaded.
The file is available for download for 24 hours at the URL of the initial request. For a repeat request after 24 hours has passed, the request is put in the queue for processing and preparing a new file.
You can force regenerating the file using the HTTP Cache-Control header:
- To generate a new file, send the
Cache-Control: no-cacheheader in the request. - To download a file that was generated within the last N seconds, send the
Cache-Control: max-age=Nheader in the request. If the file was created more than N seconds ago, AppMetrica generates a new one. - To download the last generated file (if one exists), don't send the
Cache-Controlheader in the request.
How to improve data availability
Some data shards may be temporarily unavailable during maintenance. If you need to receive samples at specific times and can tolerate a small margin of error in the data, use the skip_unavailable_shards parameter. By default, it's set to false.
When this parameter is set to true, the Logs API returns data only from available shards. Although these samples will be incomplete, the data loss rate won't exceed 1%.
-
Check if the Logs API is available.
-
If your request returns
logs_api_availability_status=disabled, includeskip_unavailable_shards=truein your request to prepare data.If your request returns
logs_api_availability_status=enabled, keep the default value:skip_unavailable_shards=false.
Export data using the AppMetrica interface
In the AppMetrica interface, you can export data to a file. To learn more, see Exporting data to a file.
List of active export requests
To get a list of all active data export requests, make the following request:
GET /logs/v1/export/get_active_queries?application_id={application_id} HTTP/1.1
Host: api.appmetrica.yandex.com
Authorization: OAuth <your_token>
where <your_token> is an OAuth token that you can obtain by following this guide, and {application_id} is the app ID.
Sample request:
GET /logs/v1/export/get_active_queries?application_id=123456
Host: api.appmetrica.yandex.com
Authorization: OAuth <your_token>
Response example:
[
{
"application_id": 123456,
"create_time": "2026-06-26 16:00:41",
"entity": 1,
"output_format": 0,
"request_id": "112233445566778899",
"query": "application_id=123456&date_since=...&date_until=...&date_dimension=default&fields=...",
"status": 0,
"total_progress": 0.125275,
"total_rows_loaded": 0,
"shards_unavailable": 0
}
]
|
Parameter name |
Description |
Sample value |
|
|
App ID. |
|
|
|
Date and time when the request was created. |
|
|
|
Event type. Possible values:
|
|
|
|
Output format:
|
|
|
|
Request ID. |
|
|
|
Request text. |
|
|
|
Current request status. Possible values:
|
|
|
|
Completion rate. Value from 0 to 1. |
|
|
|
Number of exported data rows. |
|
|
|
Indicator/share of unavailable shards. |
|
If there are no active requests, an empty array [] is returned.
Cancel an export request
You can cancel a request to prepare or export data:
POST /logs/v1/export/{request_id}/cancel?application_id={application_id} HTTP/1.1
Host: api.appmetrica.yandex.com
Authorization: OAuth <your_token>
where <your_token> is an OAuth token that you can obtain by following this guide, {request_id} is the ID of the request you want to cancel, and {application_id} is the app ID.
You can find the request ID in the list of active export requests.
Sample request:
POST /logs/v1/export/112233445566778899/cancel?application_id=123456
Host: api.appmetrica.yandex.com
Authorization: OAuth <your_token>
If the cancellation request is successful, it returns the HTTP status 200 OK with the message:
-
Request cancellation has been scheduled:
{"message": "Request cancellation has been scheduled."} -
The request has already been completed and cannot be canceled:
{"message": "The request has already been completed and cannot be canceled."}
If you didn't find the answer you were looking for, you can use the feedback form to submit your question. Please describe the problem in as much detail as possible. Attach a screenshot if possible.