Skip to main content
This walkthrough runs a complete enrichment in Python. You need an API key from your DataLane workspace settings and the requests package (pip install requests).

1. Set up a client

Every endpoint is a 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
Enrichment consumes one SMB credit per eligible account, so 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
Account IDs must be UUIDs; duplicates are counted once in 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
DataLane validates the list, applies the campaign’s recency exclusion, charges one credit per remaining account, and starts finding contacts. The call returns once the campaign is enriching. If it raises enrichment_pending, the launch is still in progress. Repeat the same call after a short backoff.

5. Poll until enriched

The loop ends on enriched:
Response
Results stay exportable until 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