---
title: "Export agent usage data"
method: POST
path: "/export/agents"
tags: ["Usage Export"]
---

# Export agent usage data

`POST /export/agents`

## Request

- Base URL: `https://api.langdock.com`
- URL: `https://api.langdock.com/export/agents`
- Auth: HTTP bearer

Export detailed usage data for all agents in the workspace

## Request body

- UsageExportModelGroupByRequest: Request body for usage export endpoints
  - `from` object, required: Start date and timezone for the export
    - `date` string, date-time, required: Start date in ISO 8601 format
    - `timezone` string, required: Timezone for the date range
  - `to` object, required: End date and timezone for the export
    - `date` string, date-time, required: End date in ISO 8601 format
    - `timezone` string, required: Timezone for the date range
  - `group_by` 'model': Optional aggregation dimension.

## Response `200`

Export successful

- UsageExportResponse: Successful response from usage export endpoints
  - `success` boolean, required: Indicates if the export was successful
  - `data` object, required: Export data information
    - `filePath` string, required: Path to the generated export file
    - `downloadUrl` string, uri, required: Signed URL to download the export file
    - `dataType` 'assistants' | 'agents' | 'api_keys' | 'users' | 'projects' | 'models' | 'workflows', required: Type of data exported
    - `recordCount` integer, required: Number of records in the export
    - `dateRange` object, required: Actual date range of the exported data
      - `from` string, date-time, required: Start date of the export
      - `to` string, date-time, required: End date of the export

## Other responses

- `400`: Bad Request - Export too large or invalid date range
- `401`: Unauthorized - Invalid or missing API key
- `404`: No data found for the selected period

## Changes

- **2026-11-03** `c62bf90b4013`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/langdock/apis/langdock-api/changes/export/agents/post.md)

---

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