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 the export would contain if you can afford it: min(cost, balance).
would_skipYour shortfall: max(0, cost - balance). Above zero means Create Export will be refused.
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 is refused, so find out here

Exports are all or nothing. If your balance cannot cover cost in full, Create Export returns 402 insufficient_balance and applies nothing — no charge, no job, no unlocks. A zero balance and a merely short one behave the same way.

A non-zero would_skip here is how you learn that before it happens, and it is the number of credits you are short. Preview is free, so checking costs you nothing.

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