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

FieldTypeRequiredNotes
lead_idsstring[]YesLeads to export.
formatstringNocsv 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

FieldTypeNotes
statusstringready when the export is built.
formatstringcsv or json.
lead_countnumberLeads actually exported.
requested_lead_countnumberLeads requested.
missing_lead_idsstring[]Lead IDs that do not exist in this workspace.
content_typestringMIME type.
file_namestringSuggested filename for downloads.
datastring | object[]For CSV: the raw CSV text. For JSON: an array of lead objects.

Error responses

All failed calls use the standard error envelope documented in Errors.

StatusCodeNotes
400validation_errorReturned when the request body is invalid, format is unsupported, or the requested lead IDs are malformed.
401unauthorizedReturned when X-Satellyte-API-Key is missing, invalid, or expired.
404not_foundReturned when Public API access is not enabled or the requested Public API resource is unavailable. Missing lead IDs are reported in missing_lead_ids when applicable rather than raising this error.
429rate_limit_exceededReturned when the API key exceeds its configured rate limit.
500service_errorReturned when Satellyte cannot complete the export request. Retry with backoff.