Leads

Create a lead export

Start the same lead export the application makes from the Leads page: a CSV or XLSX file of every lead matching the search, built in the background and listed on the application's Exports page.

The body takes the lead list's search parameters - campaign, start_date, end_date (whole days, YYYY-MM-DD), timezone, status, supplier, supplier_outcome, buyer, buyer_outcome, where, test, return, repost - plus the file's format, an optional columns list, and the Exports page's name, description and notify list. The response is the export row with status queued; poll GET /v2/leads/exports/{export} until it is finished, then follow download_url. The link is valid for seven days.

Requires the export permission - an owner always has it, a team member only when granted - and a token that can write.

post/v2/leads/exports

Request

  • Base URL: https://api.leadprosper.io/public
  • URL: https://api.leadprosper.io/public/v2/leads/exports
  • Auth: one of:
    • HTTP bearer
    • API key in query parameter api_token

Request body

campaigninteger required

Campaign id.

start_datestring date required

YYYY-MM-DD, no more than a year ago. The export covers whole days in timezone.

end_datestring date required

YYYY-MM-DD, on or after start_date.

timezonestring

The timezone the dates are read in. Default UTC.

status'accepted' | 'duplicated' | 'error'
supplierinteger

Only leads from this supplier.

supplier_outcomestring

As on GET /v2/leads. Requires supplier.

buyerinteger

Only leads this buyer was sent. Adds the buyer status, error message and sell price columns to the file.

buyer_outcomestring

As on GET /v2/leads. Requires buyer.

whereobject

Lead-data conditions, the same object GET /v2/leads takes - here as JSON rather than bracketed parameters: {"match": "all", "conditions": {"state": "CA"}}.

testboolean
returnboolean
repostboolean
format'csv' | 'xlsx' required

Required, as the Leads page requires a choice.

columnsstring[]

Only these columns, by the keys the application's export picker uses: lead_id, date, status, cost, revenue, test, repost, delayed, returned, return_reason, supplier_name, supplier_id, supplier_client_id, supplier_company, buyer_name, buyer_id, buyer_client_id, validation_error_provider, validation_error_description, lp_campaign_id, lp_supplier_id, lp_key; with buyer also buyer_status, buyer_error_message, buyer_sell_price; plus any of the campaign's field names and lp_subid1, lp_subid2. A key the campaign cannot export is refused with 422. Omit for every column.

namestring

Shown on the Exports page. Defaults to what the Leads page proposes: <campaign> - Leads - <start> -> <end>, e.g. Harborview - Leads - Sep 1, 2026 -> Sep 14, 2026.

descriptionstring

Free text shown on the Exports page. Empty by default.

notifystring[]

Addresses emailed when the file is ready. Nobody is emailed unless listed; the application pre-fills the owner's address, the API does not.

Response

Success

statusstring

Changes

No recorded changes to this operation across all 1 revision of this API.