Skip to content

API for logs export to S3/SFTP $

Description

This section describes API methods for setting up raw logs export to your S3 or SFTP storage.

Successful responses and validation errors are returned in JSON format.

Attention!

  1. One storage is set up per account — S3 or SFTP. If the service is not enabled, you cannot save or enable the export — a response with status code 402 will be returned.
  2. When saving the settings, access to the storage is checked: an empty test.txt file is uploaded to it (in S3 — to the bucket root, in SFTP — to the folder directory or to the user's home directory), and then the file is deleted. If such a file already exists, it will be overwritten and deleted.
  3. API responses contain the storage access parameters, including the password and the secret key.

Log files export

Logs are exported as separate files, each file covers an interval of period minutes. Intervals are counted from the beginning of the hour in UTC.

The file path is based on the interval end time (UTC), numbers are written without leading zeros:

<year>/<month>/<day>/<hour>/<minute>.log.gz

Example of a file path for the interval 2026-10-29 07:00–08:00 UTC (period: 60):

2026/10/29/8/0.log.gz

Example of a file path for the interval 2026-10-29 07:00–07:05 UTC (period: 5):

2026/10/29/7/5.log.gz

Features

  • A file is a gzip archive with a log file, the log file format is described in the Log file record description section
  • A file for an interval is exported about an hour after the interval ends, the first files after enabling the export appear in about 1–2 hours
  • If there were no requests during an interval, a file without records is exported
  • In S3 files are saved from the bucket root, in SFTP — to the folder directory or to the user's home directory if the folder is not set. Missing directories are created automatically
  • A new export interval takes effect from the next hour
  • If a file could not be uploaded to the storage, the upload is retried automatically, and the status field returns fail
  • Logs for the time when the export was disabled or the service was not paid are not exported. You can get them via the Getting logs API

API for logs export to S3/SFTP

  • Required headers: CDN-AUTH-TOKEN (authorization token, see Authorization)
  • Successful response Content-Type: application/json