---
title: "Export campaign call logs as a JSON file"
method: GET
path: "/campaign/{id}/logs/export"
tags: ["Campaigns"]
---

# Export campaign call logs as a JSON file

`GET /campaign/{id}/logs/export`

Streams a JSON file containing every call log for a campaign.

Response is a **file download** (`Content-Disposition: attachment`), not the
standard `{status, data}` envelope. Body is a raw JSON array of log objects.
When the relay-service is configured and reachable, each row also includes an
`events` array; otherwise the field is omitted.

## Path parameters

- `id` string, required

## Response `200`

Campaign-logs JSON file. `Content-Disposition: attachment; filename=campaign-logs-<campaignName>-<createdAt>.json`.

- object[]
  - `_id` string
  - `callId` string
  - `status` string
  - `duration` number
  - `recordingUrl` string, nullable
  - `from` string, nullable
  - `to` string, nullable
  - `agentId` string
  - `statusDetails` string[]
  - `events` object[] — Relay-service event stream. Omitted when relay isn't configured.

## Other responses

- `400` — Bad request — validation failed or required field missing.
- `401` — Unauthorized access
- `404` — Resource not found — the referenced ID does not exist or does not belong to the caller's organization.
- `500` — Internal server error

## Changes

- **2026-06-21** `ea4ea58d7c4e` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/smallest-inc/apis/agent-management-api/changes/campaign/:id/logs/export/get.md)

---

[API](https://skmtc.dev/smallest-inc/apis/agent-management-api.md) · [All operations](https://skmtc.dev/smallest-inc/apis/agent-management-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/smallest-inc/agent-management-api/revisions/ea4ea58d7c4e/schema)
