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.