Asynchronous Call Log CSV Export
This API exports the call logs that match your filters as a CSV file. After an export is accepted, the CSV is built in the background. The client polls the job status and, once the job is complete, downloads the CSV from the download URL.
The synchronous GET /v1/call-logs/export is limited to 5,000 rows per request. To export more than 5,000 call logs, use this asynchronous API (up to 100,000 rows per export).
Endpoints
| Method | Path | Purpose |
|---|---|---|
POST | /v1/call-logs/export-jobs | Accepts an export and returns a job ID (jobId) |
GET | /v1/call-logs/export-jobs?projectId= | Lists the jobs you requested (newest first, up to 50) |
GET | /v1/call-logs/export-jobs/{jobId}?projectId= | Returns one job's status, including a download URL when complete |
- All three require the
call-log:exportpermission (permissions). projectIdis required on all three. Permissions are evaluated against the project identified by thisprojectId.- For full parameter and response details, see the auto-generated API reference.
Workflow
- Call
POST /v1/call-logs/export-jobsto request an export, and keep thejobIdreturned with202 Accepted. - Poll
GET /v1/call-logs/export-jobs/{jobId}?projectId=...at a regular interval (for example, every 5 seconds). - When
statusbecomesCOMPLETED, download the CSV fromdownloadUrlin the response. - If
statusbecomesFAILED, checkerrorCodeand act accordingly (Error codes).
How long a job takes depends on the number of rows and on current load.
1. Request an export
The request body takes the same fields as the query parameters of the synchronous GET /v1/call-logs/export (projectId, filters, sortField / sortOrder, outputTimezone), sent as JSON. Only projectId is required.
curl -X POST "https://dashboard-api.recho-api.com/v1/call-logs/export-jobs" \
-H "X-API-Key: <your-api-key>" \
-H "Content-Type: application/json" \
-d '{
"projectId": "<project-uuid>",
"createdAtFrom": "2026-09-01T00:00:00+09:00",
"createdAtTo": "2026-10-01T00:00:00+09:00",
"outputTimezone": "Asia/Tokyo"
}'
{ "jobId": "0b9c6f1e-3a4d-4c55-9f0e-2d7a8b1c3e44" }
When the request is accepted, the API counts the calls that match your filters. If the count exceeds the limit, it returns 400 without creating a job (Limits).
2. Check the status (polling)
curl -H "X-API-Key: <your-api-key>" \
"https://dashboard-api.recho-api.com/v1/call-logs/export-jobs/<job-id>?projectId=<project-uuid>"
{
"jobId": "0b9c6f1e-3a4d-4c55-9f0e-2d7a8b1c3e44",
"status": "COMPLETED",
"estimatedRowCount": 12034,
"rowCount": 12036,
"createdAt": "2026-10-14T01:23:45.000Z",
"completedAt": "2026-10-14T01:24:30.000Z",
"expiresAt": "2026-10-17T01:23:45.000Z",
"errorCode": null,
"downloadUrl": "https://..."
}
New values may be added to status in the future (for example, for cancellation). If you receive a value you do not recognize, treat the job as in progress and keep polling. Treating everything other than COMPLETED / FAILED / EXPIRED as "in progress" keeps your integration working when values are added.
Polling example (Node.js 18 or later):
const TERMINAL = new Set(['COMPLETED', 'FAILED', 'EXPIRED']);
async function waitForExport(baseUrl, apiKey, projectId, jobId) {
for (;;) {
const res = await fetch(`${baseUrl}/v1/call-logs/export-jobs/${jobId}?projectId=${projectId}`, {
headers: { 'X-API-Key': apiKey },
});
if (!res.ok) throw new Error(`HTTP ${res.status}`);
const job = await res.json();
// Anything other than a final state (including unknown values) is still in progress
if (TERMINAL.has(job.status)) return job;
await new Promise((resolve) => setTimeout(resolve, 5000));
}
}
3. Download
When status is COMPLETED, downloadUrl contains the URL of the CSV file. You can GET this URL as is, without the X-API-Key header.
downloadUrlexpires at most 10 minutes after it is issued, and never later than the download deadline (expiresAt). If less than 1 second remains untilexpiresAt,downloadUrlisnulleven whenCOMPLETED.- A new URL is issued every time you call
GET /v1/call-logs/export-jobs/{jobId}. Do not store and reuse the URL; fetch it right before downloading. If it has expired, call this API again to get a new one. - The list response (
GET /v1/call-logs/export-jobs) does not includedownloadUrl. To download a job you found in the list, callGET .../{jobId}for that job.
Job status
status | Meaning |
|---|---|
PENDING | Waiting to be processed (including waiting for a retry after a temporary error) |
RUNNING | The CSV is being built |
COMPLETED | Done. The CSV can be downloaded from downloadUrl |
FAILED | Failed. See errorCode for the reason |
EXPIRED | The job completed, but the download deadline (expiresAt) has passed. The CSV can no longer be downloaded |
| (other) | A value added in the future. Treat it as in progress and keep polling |
Response fields
| Field | Type | Description |
|---|---|---|
jobId | string (uuid) | Job ID |
status | string | Job status (see above) |
estimatedRowCount | number | Row count estimated when the export was accepted (the number of calls that matched at that time). May differ from rowCount |
rowCount | number | null | Actual number of rows written to the CSV (excluding the header row). Always set when COMPLETED / EXPIRED |
createdAt | string (date-time) | When the job was accepted |
completedAt | string (date-time) | null | When the job finished (became COMPLETED or FAILED). null if it has not finished |
expiresAt | string (date-time) | Download deadline (72 hours after the job was accepted) |
errorCode | string | null | Reason when FAILED (Error codes). null otherwise |
downloadUrl | string | null | GET .../{jobId} only. The CSV download URL, set only when COMPLETED (expires at most 10 minutes after issue, never later than expiresAt) |
CSV contents
- The CSV contains the calls created up to the time the export was accepted, with their contents as of the time the CSV is built. Calls created after acceptance are not included. If a call's contents (such as its status) change between acceptance and CSV generation, the updated contents are written.
- As a result,
estimatedRowCount(the estimate at acceptance) androwCount(the actual number of rows) may differ, because calls can start or stop matching your filters after acceptance. - The file is UTF-8 with a BOM, with LF line endings. The columns and value formats are the same as the synchronous
GET /v1/call-logs/export. Date-time columns are written inoutputTimezone(default:UTC). - The ACW analysis item columns always appear in the header, but their values are filled in only if the requester had the
acw-result:readpermission at the time the export was accepted. Otherwise the values are left blank.
Limits
| Item | Limit | When exceeded |
|---|---|---|
| Rows per export | 100,000 | At acceptance: 400. During CSV generation: FAILED (ROW_LIMIT_EXCEEDED) |
| Jobs in progress at once | 2 per requester (user or API key), per project | 429 (TOO_MANY_REQUESTS) |
- Rows: The matching calls are counted at acceptance; if the count exceeds the limit, the API returns
400. Narrow your filters (for example, the date range) and split the export into several requests. Even if the count is within the limit at acceptance, the job becomesFAILED(ROW_LIMIT_EXCEEDED) if more calls match by the time the CSV is built and the limit is exceeded. - Jobs in progress: Jobs in
PENDING/RUNNINGare counted. If you have reached the limit, wait for a job in progress to finish and then try again. - Filters too large: The API also returns
400if the export settings are too large (for example, too many filter values). Reduce your filters.
Errors at acceptance
The main errors returned by POST /v1/call-logs/export-jobs. For the response body format, see Errors.
| Status | error.code | Cause and action |
|---|---|---|
400 | VALIDATION_ERROR | Invalid parameters, the row count exceeds the limit (100,000), or the filters are too large. Revise your filters |
403 | FORBIDDEN | Missing the call-log:export permission, or the project is out of scope |
429 | TOO_MANY_REQUESTS | The limit of jobs in progress (2) has been reached. Wait for a job in progress to finish, then try again |
503 | SERVICE_UNAVAILABLE | The row count could not be checked in time. Try again later or narrow your filters (no job is created) |
{
"success": false,
"message": "進行中のエクスポートが上限(2件)に達しています。完了してから再度お試しください",
"error": { "type": "ApplicationError", "code": "TOO_MANY_REQUESTS" }
}
message is returned in Japanese. Use the HTTP status and error.code to determine the error type.
Error codes (errorCode)
When status is FAILED, errorCode contains the reason. New values may be added in the future.
errorCode | Meaning | Action |
|---|---|---|
QUEUE_TIMEOUT | The job waited too long to be processed (high load, or waiting for a retry after a temporary error) | Try again later |
PROCESSING_TIMEOUT | Building the CSV exceeded the processing time limit (most likely too many rows) | Narrow your filters and try again |
ROW_LIMIT_EXCEEDED | The row limit was exceeded while building the CSV (for example, more calls matched after acceptance) | Narrow your filters and try again |
INVALID_PLAN | The export settings could not be interpreted | Try again; contact support if the problem persists |
UNSUPPORTED_PLAN_VERSION | The format of the export settings is not supported | Try again; contact support if the problem persists |
DATABASE_ERROR | The call logs could not be read even after retries | Try again later |
STORAGE_ERROR | The CSV file could not be saved even after retries | Try again later |
Job visibility and retention
- You can list and get only your own jobs. Jobs requested by a user are visible only to that user, and jobs requested with an API key are visible only to the same API key. Jobs from other users or other API keys are not listed, even within the same project.
GET .../{jobId}returns404for a job that does not exist, belongs to another user or API key, or has been deleted after its retention period.- The CSV can be downloaded for 72 hours after the job is accepted (
expiresAt). After that,statusbecomesEXPIREDand nodownloadUrlis returned. Request a new export if you still need the data. - Expired and failed jobs are deleted some time later (roughly a week as a guideline) and no longer appear in the list (getting them returns
404). The exact deletion time is not guaranteed. Do not rely on a job continuing to exist; download and store any CSV you need before it expires.