Starts a CSV export job. The job runs in the background: poll Get export until status is complete, then fetch the file with Download export.
Request#
| Field | Type | Required | Description |
|---|---|---|---|
kind |
string | Yes | What to export: calls, contacts, chats or audit_log. |
filters |
object | No | Narrows the rows. Default {}. |
filters.from |
integer | No | Earliest creation time, Unix ms (inclusive). Applies to calls, chats (start time) and audit_log. |
filters.to |
integer | No | Latest creation time, Unix ms (inclusive). Same kinds as from. |
filters.agent_ids |
string[] | No | Only calls from these agents. Applies to calls only. Default [] (all agents). |
contacts exports always include every contact in the workspace. calls and audit_log exports stop at 50,000 rows, newest first.
CSV columns#
| Kind | Columns |
|---|---|
calls |
call_id, agent_id, call_type, direction, from_number, to_number, call_status, start_timestamp, end_timestamp, duration_ms, disconnection_reason, user_sentiment, call_successful, call_summary, combined_cost, transcript |
contacts |
phone_number, first_name, last_name, email, do_not_call, then one column per custom field |
chats |
chat_id, chat_agent_id, channel, chat_status, start_timestamp, end_timestamp, chat_summary, transcript |
audit_log |
created_timestamp, actor_type, actor_label, action, target_type, target_id, ip, details |
Object values are written as JSON. Cells that contain a comma, quote or newline are quoted.
Example request#
curl -X POST https://api.tried.com.au/exports \
-H "Authorization: Bearer $TRIED_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"kind": "calls",
"filters": {
"from": 1759276800000,
"to": 1761955199000,
"agent_ids": ["agent_2f8d4b6a0c1e3f5a7b9d1c3e"]
}
}'const res = await fetch("https://api.tried.com.au/exports", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TRIED_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
kind: "calls",
filters: {
from: 1759276800000,
to: 1761955199000,
agent_ids: ["agent_2f8d4b6a0c1e3f5a7b9d1c3e"],
},
}),
});
const job = await res.json();import os, requests
res = requests.post(
"https://api.tried.com.au/exports",
headers={"Authorization": f"Bearer {os.environ['TRIED_API_KEY']}"},
json={
"kind": "calls",
"filters": {
"from": 1759276800000,
"to": 1761955199000,
"agent_ids": ["agent_2f8d4b6a0c1e3f5a7b9d1c3e"],
},
},
)
job = res.json()Response#
201 Created
{
"export_id": "export_5d2a8f1c4e7b0d3a6f9c2e5b",
"kind": "calls",
"status": "pending",
"row_count": null,
"filters": {
"from": 1759276800000,
"to": 1761955199000,
"agent_ids": ["agent_2f8d4b6a0c1e3f5a7b9d1c3e"]
},
"error": null,
"created_timestamp": 1760918400000,
"completed_timestamp": null,
"download_url": null
}| Field | Type | Description |
|---|---|---|
status |
string | pending while the job runs, then complete or error. |
row_count |
integer or null | Rows in the CSV once complete. |
error |
string or null | Why the job failed, when status is error. |
completed_timestamp |
integer or null | When the job finished. |
download_url |
string or null | Path of the CSV, /exports/{export_id}/download, once status is complete. Call it on https://api.tried.com.au with your API key. |
The create is recorded in the audit log as export.create.
Errors#
| Status | When |
|---|---|
400 |
kind is missing or not one of the four values, or a filter has the wrong type. |
401 |
Missing or invalid API key. |
403 |
The key's IP allowlist or scopes reject the request. This route needs the admin scope. Dashboard members get The member role is read-only. |
429 |
Rate limit exceeded. See Rate limits. |
See Errors for the body format.