Skip to main content

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​

MethodPathPurpose
POST/v1/call-logs/export-jobsAccepts 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:export permission (permissions).
  • projectId is required on all three. Permissions are evaluated against the project identified by this projectId.
  • For full parameter and response details, see the auto-generated API reference.

Workflow​

  1. Call POST /v1/call-logs/export-jobs to request an export, and keep the jobId returned with 202 Accepted.
  2. Poll GET /v1/call-logs/export-jobs/{jobId}?projectId=... at a regular interval (for example, every 5 seconds).
  3. When status becomes COMPLETED, download the CSV from downloadUrl in the response.
  4. If status becomes FAILED, check errorCode and 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 status values may be added

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.

  • downloadUrl expires at most 10 minutes after it is issued, and never later than the download deadline (expiresAt). If less than 1 second remains until expiresAt, downloadUrl is null even when COMPLETED.
  • 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 include downloadUrl. To download a job you found in the list, call GET .../{jobId} for that job.

Job status​

statusMeaning
PENDINGWaiting to be processed (including waiting for a retry after a temporary error)
RUNNINGThe CSV is being built
COMPLETEDDone. The CSV can be downloaded from downloadUrl
FAILEDFailed. See errorCode for the reason
EXPIREDThe 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​

FieldTypeDescription
jobIdstring (uuid)Job ID
statusstringJob status (see above)
estimatedRowCountnumberRow count estimated when the export was accepted (the number of calls that matched at that time). May differ from rowCount
rowCountnumber | nullActual number of rows written to the CSV (excluding the header row). Always set when COMPLETED / EXPIRED
createdAtstring (date-time)When the job was accepted
completedAtstring (date-time) | nullWhen the job finished (became COMPLETED or FAILED). null if it has not finished
expiresAtstring (date-time)Download deadline (72 hours after the job was accepted)
errorCodestring | nullReason when FAILED (Error codes). null otherwise
downloadUrlstring | nullGET .../{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) and rowCount (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 in outputTimezone (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:read permission at the time the export was accepted. Otherwise the values are left blank.

Limits​

ItemLimitWhen exceeded
Rows per export100,000At acceptance: 400. During CSV generation: FAILED (ROW_LIMIT_EXCEEDED)
Jobs in progress at once2 per requester (user or API key), per project429 (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 becomes FAILED (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 / RUNNING are 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 400 if 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.

Statuserror.codeCause and action
400VALIDATION_ERRORInvalid parameters, the row count exceeds the limit (100,000), or the filters are too large. Revise your filters
403FORBIDDENMissing the call-log:export permission, or the project is out of scope
429TOO_MANY_REQUESTSThe limit of jobs in progress (2) has been reached. Wait for a job in progress to finish, then try again
503SERVICE_UNAVAILABLEThe 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.

errorCodeMeaningAction
QUEUE_TIMEOUTThe job waited too long to be processed (high load, or waiting for a retry after a temporary error)Try again later
PROCESSING_TIMEOUTBuilding the CSV exceeded the processing time limit (most likely too many rows)Narrow your filters and try again
ROW_LIMIT_EXCEEDEDThe row limit was exceeded while building the CSV (for example, more calls matched after acceptance)Narrow your filters and try again
INVALID_PLANThe export settings could not be interpretedTry again; contact support if the problem persists
UNSUPPORTED_PLAN_VERSIONThe format of the export settings is not supportedTry again; contact support if the problem persists
DATABASE_ERRORThe call logs could not be read even after retriesTry again later
STORAGE_ERRORThe CSV file could not be saved even after retriesTry 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} returns 404 for 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, status becomes EXPIRED and no downloadUrl is 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.