Reference

REST API reference (v1)

15 min readapi-reference

Full reference for the FlowMaticX public REST API — authentication, endpoints, request/response shapes, and error codes.

REST API reference (v1)

The FlowMaticX public API lets you integrate lead generation, CRM, and credit management into your own tools, dashboards, or automations.

> Plan requirement: API access requires the Agency plan.

---

Base URL

https://app.flowmaticx.com/api/v1

---

Authentication

All requests must include an API key in the Authorization header:

Authorization: Bearer lg_live_YOUR_API_KEY

Generate an API key at Settings → API Keys → New key. You can create multiple keys with different scopes and revoke them individually.

Scopes
ScopeDescription
leads:readList and search leads
jobs:writeCreate new search jobs
jobs:readList and check job status
credits:readView credit balance
*All scopes (default for new keys)

---

Rate limits
TierLimit
All plans300 requests / minute per API key

When exceeded, the API returns 429 Too Many Requests. Retry after the Retry-After header value (in seconds).

---

Error format

All errors follow the same envelope:

json { "ok": false, "error": { "code": "INSUFFICIENT_CREDITS", "message": "Need 20 credits, have 5", "status": 402 } }

Error codes
CodeHTTPMeaning
UNAUTHORIZED401Missing or invalid API key
FORBIDDEN403Key lacks required scope or plan feature is locked
PLAN_FEATURE_LOCKED403Your plan doesn't include this feature
NOT_FOUND404Resource doesn't exist in your workspace
VALIDATION_ERROR400Request body failed schema validation
PLAN_LIMIT_EXCEEDED400Requested leads exceed plan max-per-job
INSUFFICIENT_CREDITS402Not enough credits to run the job
RATE_LIMITED429Too many requests
NO_SUBSCRIPTION400Workspace has no active subscription

---

Endpoints

---

POST /api/v1/jobs — Create a search job

Start a new lead generation job. Returns the job ID immediately; use GET /jobs to poll for completion.

Request body

json { "workflow_type": "GOOGLE_MAPS", "keyword": "plumber", "location": "Manchester, UK", "leads_requested": 50, "ai_enabled": true, "include_risky": false }

FieldTypeRequiredDescription
workflow_typeenumYesGOOGLE_MAPSLINKEDININSTAGRAMTIKTOKFACEBOOKYELLOW_PAGESCUSTOM
keywordstringYesSearch keyword or hashtag
locationstringYesCity, region, or country
leads_requestedintegerYes1–500
ai_enabledbooleanNoEnable AI personalisation (default: true; requires Starter+)
include_riskybooleanNoInclude RISKY email status leads (default: false)

Response 200

json { "ok": true, "data": { "job_id": 10042, "status": "queued", "estimated_credits": 100, "credits_remaining": 850 } }

---

GET /api/v1/jobs — List jobs

GET /api/v1/jobs?limit=20&offset=0&status=COMPLETED

Query paramTypeDescription
limitinteger1–100 (default 50)
offsetintegerPagination offset (default 0)
statusstringFilter: QUEUEDRUNNINGCOMPLETEDFAILEDTIMED_OUT

Response 200

json { "ok": true, "data": { "jobs": [ { "id": 10042, "workflowType": "GOOGLE_MAPS", "keyword": "plumber", "location": "Manchester, UK", "requestedLeads": 50, "foundLeads": 47, "processedLeads": 47, "creditsUsed": 94, "status": "COMPLETED", "progress": 100, "createdAt": "2026-05-04T10:00:00Z", "startedAt": "2026-05-04T10:00:05Z", "finishedAt": "2026-05-04T10:02:15Z" } ], "total": 1, "limit": 20, "offset": 0 } }

---

GET /api/v1/leads — List leads

GET /api/v1/leads?limit=50&offset=0&job_id=10042&billable_only=true

Query paramTypeDescription
limitinteger1–100 (default 50)
offsetintegerPagination offset
job_idintegerFilter to leads from a specific job
billable_onlybooleanOnly return billable leads (default: true)
email_statusstringFilter: VALIDRISKYINVALID

Response 200

json { "ok": true, "data": { "leads": [ { "id": 98321, "businessName": "Bloom Florist", "category": "Florist", "email": "sarah@bloomflorist.co.uk", "emailStatus": "VALID", "decisionMakerName": "Sarah Blake", "decisionMakerRole": "Owner", "phone": "+441615551234", "website": "bloomflorist.co.uk", "domain": "bloomflorist.co.uk", "address": "14 Market St", "city": "Manchester", "postalCode": "M1 1AB", "country": "GB", "rating": 4.8, "reviewsCount": 127, "icebreaker": "Congrats on the 4.8 rating...", "emailSubject": "Quick question about your website", "emailBody": "Hi Sarah, ...", "aiInsight": "Active Google Maps presence with strong reviews...", "keyword": "florist", "isBillable": true, "createdAt": "2026-05-04T10:02:15Z" } ], "total": 47, "limit": 50, "offset": 0 } }

---

GET /api/v1/credits — Credit balance

GET /api/v1/credits

Response 200

json { "ok": true, "data": { "planId": "AGENCY", "creditsTotal": 1500, "creditsUsed": 650, "creditsRemaining": 850, "currentPeriodStart": "2026-05-01T00:00:00Z", "currentPeriodEnd": "2026-05-31T23:59:59Z", "status": "ACTIVE" } }

---

Pagination

All list endpoints return total, limit, and offset. To page through all results:

`js
let offset = 0;
const limit = 100;
let all = [];

while (true) {
const res = await fetch(/api/v1/leads?limit=${limit}&offset=${offset}, {
headers: { Authorization: 'Bearer lglive...' }
});
const { data } = await res.json();
all = all.concat(data.leads);
if (all.length >= data.total) break;
offset += limit;
}
`

---

Idempotency

Attach an Idempotency-Key header to any POST request to prevent duplicate jobs if the client retries:

Idempotency-Key: my-job-ref-abc123

If a job was already created with this key, the original job is returned instead of creating a new one.