Skip to main content
CornectAPI Docsv1
Sign inGet an API tokenGet started free

Preview Export

POST/api/v1/exports/preview

Price an export before you create it. Takes the same body as Create Export and returns exactly what it would cost, what you already own, and — if your balance is short — how many rows you would not receive. Charges nothing.

Authentication#

Requires a token with the read scope, sent as Authorization: Bearer cornect_….

Request#

Body parameters:

NameTypeRequiredDescription
source_typestringNoWhere rows come from: search (default), list, or company_ids.
search_filtersobjectNoFor source_type=search: the same filter shape as Search Companies.
sort_bystringNoSort field for a search-sourced export.
sort_orderstringNoasc or desc.
list_idstring (UUID)NoFor source_type=list: the saved list to price.
company_idsstring[]NoFor source_type=company_ids: the exact companies to price.

Send the body you intend to send to Create Export. Anything that changes which companies are selected changes the price, so preview the same body you will submit.

Response#

FieldMeaning
requested_countCompanies the filters match, up to the 10,000 per-export ceiling.
already_unlockedHow many of those your workspace has exported before. Free again.
new_countCompanies you have not paid for yet.
capped_at_10kTrue when the match set exceeds 10,000 — the export would be truncated.
costCredits this export would charge. Always equals new_count — 1 credit per new company.
balanceYour workspace's credit balance right now.
would_exportRows you would actually receive: min(cost, balance).
would_skipRows you would not receive: max(0, cost - balance).
json
{
  "requested_count": 500,
  "already_unlocked": 320,
  "new_count": 180,
  "capped_at_10k": false,
  "cost": 180,
  "balance": 120,
  "would_export": 120,
  "would_skip": 60
}

Why preview before you export#

A short balance does not fail — it exports less

If your balance is zero, Create Export returns 402 and no job is created. But if your balance is non-zero and smaller than the cost, the export succeeds partially: you are charged everything you have, and the job contains only the rows those credits paid for. The rest are dropped.

Nothing in the finished file tells you rows are missing. A non-zero would_skip here is the warning you get, and it is the reason to call this endpoint first.

Preview is free and uses the read scope, so a read-only token can price work a read_write token would perform.

Code samples#

curl -X POST https://api.cornect.io/api/v1/exports/preview \
  -H "Authorization: Bearer cornect_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{"source_type":"search","search_filters":{"query":"fintech","countries":["United States"]}}'

Errors#

See Errors for the full table. Codes you're most likely to see here:

CodeStatusWhen
no_candidates400No companies match — there is nothing to price.
MISSING_AUTH_HEADER401No Authorization header sent.
INVALID_TOKEN401Token not found or revoked.

Interactive reference#

Loading interactive reference