API reference

A versioned REST API for automating lead collection, list building and exports. JSON in, JSON out, with a single consistent envelope.

Create a key

Authentication

Create a key in the dashboard (Developer → API) and send it as a bearer token. Keys are scoped to one organization, shown once, and stored only as a hash.

curl https://leadatlas.bdtechoffice.com/api/v1/leads \
  -H "Authorization: Bearer lg_live_xxxxxxxxxxxxxxxx"
  • leads:readList and read leads
  • leads:writeUpdate lead status, owner and tags
  • searches:readRead search history and results
  • searches:createStart new searches
  • lists:readRead lead lists
  • lists:writeAdd and remove leads in lists
  • exports:readDownload completed exports
  • exports:createGenerate new exports
  • analytics:readRead usage and performance analytics

Endpoints

All endpoints are prefixed with /api/v1 and are organization-scoped.

MethodPathScopeDescription
GET/api/v1/meanyOrganization, plan, credits and limits for the calling key.
GET/api/v1/leadsleads:readList leads with the same filters as the table.
GET/api/v1/leads/:idleads:readOne lead with location, contacts and social profiles.
PATCH/api/v1/leads/:idleads:writeUpdate status, owner or tags; activity history is recorded.
GET/api/v1/searchessearches:readSearch history with counters.
POST/api/v1/searchessearches:createQueue a search; returns immediately with an id.
GET/api/v1/searches/:idsearches:readSearch state plus live progress.
GET/api/v1/listslists:readAll lead lists with counts.
POST/api/v1/listslists:writeCreate an empty list.
GET/api/v1/lists/:id/leadslists:readPaginated members of a list.
POST/api/v1/lists/:id/leadslists:writeBulk add leads to a list.
DELETE/api/v1/lists/:id/leadslists:writeBulk remove leads from a list.
GET/api/v1/exportsexports:readExport history with status and expiry.
POST/api/v1/exportsexports:createQueue an export job.
GET/api/v1/exports/:idexports:readPoll an export until it completes.
GET/api/v1/analyticsanalytics:readCoverage and pipeline analytics.

Request example — queue a search

Returns immediately; poll the search or stream its progress.

curl -X POST https://leadatlas.bdtechoffice.com/api/v1/searches \
  -H "Authorization: Bearer lg_live_xxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "keyword": "Digital Marketing Agency",
    "mode": "CITY",
    "cities": ["New York", "Chicago"],
    "minRating": 4,
    "hasWebsite": true,
    "requestedResults": 500
  }'
{
  "success": true,
  "data": {
    "id": "cuid_search",
    "status": "QUEUED",
    "provider": "google-places",
    "estimatedCredits": 500,
    "warnings": [],
    "progressUrl": "/api/searches/cuid_search/progress"
  },
  "meta": { "estimatedCredits": 500 }
}

Pagination, filtering and sorting

List endpoints share one pagination contract.

page (default 1) and pageSize (default 25, max 200) control pagination. Responses carry meta.page, meta.total, meta.totalPages and meta.hasMore.

Leads accept the same filters as the dashboard: q, status, country, city, category, tag, listId, minRating, hasWebsite, hasPhone, sort and order. Repeat a parameter or comma-separate values for OR semantics.

curl "https://leadatlas.bdtechoffice.com/api/v1/leads?status=NEW,QUALIFIED&country=Canada&minRating=4&sort=created_at&order=desc&page=2&pageSize=50" \
  -H "Authorization: Bearer lg_live_xxxxxxxxxxxxxxxx"

Errors

Every failure uses the same envelope, with a stable code you can branch on.

{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_CREDITS",
    "message": "You do not have enough credits to perform this search."
  }
}
CodeHTTPMeaning
UNAUTHENTICATED401Missing, malformed or revoked credentials.
FORBIDDEN403Authenticated but the role or key scope does not permit this.
NOT_FOUND404The resource does not exist in your organization.
VALIDATION_ERROR422The request body or query was rejected; `details` explains why.
INSUFFICIENT_CREDITS402The operation would exceed your credit balance.
RATE_LIMITED429Slow down; `Retry-After` gives the number of seconds to wait.
PLAN_LIMIT_REACHED402Your plan does not allow this operation at its current level.
FEATURE_NOT_AVAILABLE403The feature is not included in your current plan.
CONFLICT409The record already exists, or the operation conflicts with its current state.
PROVIDER_ERROR502An upstream data provider failed; safe to retry.
INTERNAL_ERROR500Unexpected failure. Include the `x-request-id` when contacting support.

Rate limits & idempotency

Designed to be driven by a job runner.

Requests are limited per organization (60 per minute by default, configurable per plan) and by monthly quota. Responses include X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset; a 429 adds Retry-After.

Search and export jobs are idempotent — retrying a request after a timeout cannot double-charge credits or double-insert leads. Correlate support requests with the x-request-id response header.

Webhook delivery for search.completed, export.completed and related events is available to plans with the webhooks entitlement.