---
title: "Create an export job"
method: POST
path: "/v1/contexts/{contextId}/export-jobs"
tags: ["Export Jobs"]
---

# Create an export job

`POST /v1/contexts/{contextId}/export-jobs`

Use this endpoint to create an asynchronous export job for large report exports. Supported formats include CSV, JSON, and XML.

## Path parameters

- `contextId` string, required

## Headers

- `X-Request-Id` string
- `X-Idempotency-Key` string

## Request body

- CreateExportJobRequest
  - `dateFrom` string, required
  - `dateTo` string, required
  - `format` 'CSV' | 'JSON' | 'XML', required
  - `reportType` 'MATCHED' | 'UNMATCHED' | 'SUMMARY' | 'VARIANCE', required
  - `sourceId` string

## Response `202`

Indicates that the request was accepted for processing.

The response includes the `X-Idempotency-Replayed` header.

If the value is false, the request was just processed. If the value is true, the response is a replay of a previously processed request.

See [Retries and idempotency](/en/reference/retries-idempotency) for more details.

- CreateExportJobResponse
  - `jobId` string
  - `status` string
  - `statusUrl` string

## Other responses

- `400` — The request contains invalid parameters or payload.
- `401` — The request lacks valid authentication credentials.
- `403` — You do not have permission to access this resource.
- `404` — The requested resource was not found.
- `409` — Idempotency conflict: request with same key in progress
- `500` — An unexpected error occurred on the server.
- `503` — The service is temporarily unavailable. Please try again later.

---

[API](https://skmtc.net/lerian/apis/identity-plugin.md) · [All operations](https://skmtc.net/lerian/apis/identity-plugin/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/lerian/identity-plugin/versions/25daba385532/schema)
