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 you would actually receive: min(cost, balance). |
would_skip | Rows you would not receive: max(0, cost - balance). |
{
"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#
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:
| 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. |