---
title: "Export AI Request Logs"
method: POST
path: "/users/{userId}/ai/request-logs/exports"
tags: ["AI"]
---

# Export AI Request Logs

`POST /users/{userId}/ai/request-logs/exports`

## Request

- Base URL: `https://api.crowdin.com/api/v2`
- URL: `https://api.crowdin.com/api/v2/users/{userId}/ai/request-logs/exports`
- Auth: none declared
- TypeScript: <https://skmtc.dev/crowdin/apis/crowdin-api-v2/docs/users/:userId/ai/request-logs/exports/post.ts> (a function with typed inputs; its response is checked against the schema)

**Required scopes:** `ai.request-log` (Read only).

Starts an [asynchronous operation](#section/Introduction/Asynchronous-Operations) that builds a file with the AI request logs matching the filters, and returns its `identifier`. Poll [Check AI Request Logs Export Status](#operation/api.ai.requestLogs.exports.get) until `status` is `finished`, then call [Download AI Request Logs Export](#operation/api.ai.requestLogs.exports.download) for a link to the file.

Passing no filters exports every log entry of the organization, newest first. Columns and value formatting are identical to [List AI Request Logs](#operation/api.ai.requestLogs.getMany).

## Path parameters

- `userId` integer, required

## Request body

- AiRequestLogExportForm
  - `format` 'csv': Format of the exported file. One of: `csv`. Default is `csv`
  - `requestId` string: Filter results to the log entry with this request identifier
  - `projectId` integer: Filter results to requests made in this project. Get via [List Projects](#operation/api.projects.getMany)
  - `userId` integer: Filter results to requests attributed to this user. Get via [List Users](#operation/api.users.getMany)
  - `aiProviderId` integer: Filter results to requests served by this AI provider. Get via [List AI Providers](#operation/api.ai.providers.getMany)
  - `model` string: Filter results to requests made with this AI model
  - `sourceAction` 'ai_proxy' | 'ai_gateway' | 'ai_translate_strings' | 'ai_file_translate' | 'ai_prompt_completion' | 'pre_translate:manual' | 'pre_translate:workflow' | 'ai_alignment' | 'qa_check' | 'ai_suggestion' | 'advisor': Filter results to requests produced by this feature or channel
  - `promptAction` string: Filter results to requests made for this prompt action, e.g. `pre_translate`, `qa_check`, `advisor_context_review`, or a `custom:`-prefixed value
  - `statuses` string[]: Filter results to requests in any of these statuses
  - `tokenName` string: Filter results to requests authenticated with a personal access token of this name
  - `oauthClientId` string: Filter results to requests authenticated by the OAuth application with this `client_id`
  - `systemCredentials` boolean: If `true`, only requests that used system-provided credentials are exported
  - `isAutoTriggered` boolean: If `true`, only requests triggered automatically rather than by an interactive user action are exported
  - `createdAfter` string, date-time: Filter results to requests logged after this date, in ISO 8601 format
  - `createdBefore` string, date-time: Filter results to requests logged before this date, in ISO 8601 format

## Response `201`

Export was queued

- AiRequestLogExportResource: Base schema of resource container. Container is a wrapper object that contains payload in required `data` property and provides space for adding any other metadata.
  - `data` AiRequestLogExport, required: AI Request Logs Export
    - `identifier` string: ID of the export, to be passed to the status and download operations
    - `status` 'created' | 'in_progress' | 'canceled' | 'failed' | 'finished': Export status. The file is ready only once it is `finished`
    - `progress` integer: Share of the matching log entries already written, in percent. Capped at `99` while the file is being built, so `100` is reached only together with `status` `finished`
    - `attributes` object: The export request as it was accepted
      - `format` 'csv': Format of the exported file
      - `filters` object: The filters the export was requested with. Empty when the export covers every log entry of the organization
    - `createdAt` string, date-time: Date the export was requested, in ISO 8601 format
    - `updatedAt` string, date-time: Date the export last changed, in ISO 8601 format
    - `startedAt` string, date-time, nullable: Date the export started building the file, in ISO 8601 format. `null` while the export is still queued
    - `finishedAt` string, date-time, nullable: Date the export reached a final status, in ISO 8601 format. `null` until then
    - `eta` string, nullable: Human-readable time the export has been running, measured to `finishedAt` once it is set and to the current time before that. `null` until the export starts

## Other responses

- `400`: Invalid Request Parameters
- `401`: Unauthorized
- `403`: Forbidden
- `404`: User with specified id was not found
- `405`: Method Not Allowed

---

[API](https://skmtc.dev/crowdin/apis/crowdin-api-v2.md) - [All operations](https://skmtc.dev/crowdin/apis/crowdin-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/crowdin/apis/crowdin-api-v2/revisions/27aae7751699?raw)
