Export Leads
Export lead data as JSON or CSV. Returns the content inline in the response.
Endpoint
POST /api/v1/leads/export
Authentication
All requests require the X-Satellyte-API-Key header. See Quickstart.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
lead_ids | string[] | Yes | Leads to export. |
format | string | No | csv or json. Defaults to csv. |
cURL: JSON export
curl -i -X POST "https://api-staging.satellyte.ai/api/v1/leads/export" \
-H "X-Satellyte-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{ "lead_ids": ["lead_1", "lead_2"], "format": "json" }'
cURL: CSV export
curl -i -X POST "https://api-staging.satellyte.ai/api/v1/leads/export" \
-H "X-Satellyte-API-Key: $API_KEY" \
-H "Content-Type: application/json" \
-d '{ "lead_ids": ["lead_1", "lead_2"], "format": "csv" }'
Response (200): CSV
{
"data": {
"status": "ready",
"format": "csv",
"lead_count": 0,
"requested_lead_count": 1,
"missing_lead_ids": ["nonexistent-doc-capture"],
"content_type": "text/csv",
"file_name": "satellyte-leads-export-1778485953172.csv",
"data": "id,full_name,first_name,last_name,title,company,linkedin_url,email,phone,location,score,status,source,radar_id,campaign_id,created_at"
}
}
Response fields
| Field | Type | Notes |
|---|---|---|
status | string | ready when the export is built. |
format | string | csv or json. |
lead_count | number | Leads actually exported. |
requested_lead_count | number | Leads requested. |
missing_lead_ids | string[] | Lead IDs that do not exist in this workspace. |
content_type | string | MIME type. |
file_name | string | Suggested filename for downloads. |
data | string | object[] | For CSV: the raw CSV text. For JSON: an array of lead objects. |