requests package (pip install requests).
1. Set up a client
POST returning the same envelope, so one helper covers the whole API: it returns data on success and raises the error code otherwise. Keep the key server-side and out of source control.
2. Check your organization
Response
credits.smb is the budget for everything that follows. credits.researchAgents is a separate balance for Research Agent runs. enrichment.enrichingAccounts counts accounts currently enriching across the organization; new launches must fit within enrichment.maxEnrichingAccounts.
3. Create a campaign
Response
accounts.requested. The campaign starts as a draft; nothing is charged, and accounts.eligible and accounts.excluded stay null until enrichment evaluates the list. excludeEnrichedWithinDays tells the launch to skip accounts enriched within the last 30 days; it can be changed with /v1/campaigns/update while the campaign is still a draft.
4. Start enrichment
Response
enriching. If it raises enrichment_pending, the launch is still in progress. Repeat the same call after a short backoff.
5. Poll until enriched
enriched:
Response
resultsExpireAt. If the loop ends on draft instead, the attempt failed or was canceled. lastEnrichment reports what happened and whether its credits were refunded. See Campaign lifecycle.
6. Export a CSV
Response
url is presigned. Fetch it with a plain requests.get, without an Authorization header, and treat it as a secret. It stays valid for one hour; each export call builds a fresh file, so call it again to change filters or get a new URL. See Export results for contact caps and filters.
Next steps
- Campaign lifecycle: states, safe retries, and polling guidance
- Errors and retries: every error code and which ones to retry
- API reference: full schemas and an interactive playground