Preview Export
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:
| Name | Type | Required | Description |
|---|---|---|---|
source_type | string | No | Where rows come from: search (default), list, or company_ids. |
search_filters | object | No | For source_type=search: the same filter shape as Search Companies. |
sort_by | string | No | Sort field for a search-sourced export. |
sort_order | string | No | asc or desc. |
list_id | string (UUID) | No | For source_type=list: the saved list to price. |
company_ids | string[] | No | For 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#
| Field | Meaning |
|---|---|
requested_count | Companies the filters match, up to the 10,000 per-export ceiling. |
already_unlocked | How many of those your workspace has exported before. Free again. |
new_count | Companies you have not paid for yet. |
capped_at_10k | True when the match set exceeds 10,000 — the export would be truncated. |
cost | Credits this export would charge. Always equals new_count — 1 credit per new company. |
balance | Your workspace's credit balance right now. |
would_export | Rows the export would contain if you can afford it: min(cost, balance). |
would_skip | Your shortfall: max(0, cost - balance). Above zero means Create Export will be refused. |
{
"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#
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:
| Code | Status | When |
|---|---|---|
no_candidates | 400 | No companies match — there is nothing to price. |
MISSING_AUTH_HEADER | 401 | No Authorization header sent. |
INVALID_TOKEN | 401 | Token not found or revoked. |