Lead sources
Where leads come from (Meta, Google, websites, WhatsApp, your own systems), their Facebook Pages, and the delivery log.
GET/lead-sources
List lead sources
Each source with its address, how it is doing (last delivery, counts for the last 7 days) and, for Meta, how many Facebook Pages it has and how many need attention.
Needs the permission integrations:read.
curl -X GET https://crm.anibrosdesign.com/api/v1/lead-sources \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
200 401 403 429
POST/lead-sources
Create a lead source
Meta, WhatsApp, Google, website or your own system. The response includes the secret of a Google or generic source once; it cannot be read again.
Needs the permission integrations:manage.
| Body field | Type | Notes |
|---|---|---|
provider | one of meta, google, website, generic, whatsapp | Required when creating. One of meta, whatsapp, google, website, generic. |
name | string | Required when creating.. at least 1 characters. up to 120 characters |
status | one of active, paused | |
config | any | Object: campaign, tags, source, pipelineId, stageId, ownerId, allowedOrigins, fieldMap, adAccountId, adAccountName, appId (Meta), routing (own or agency). |
appSecret | string | Meta and WhatsApp: the app secret, used to check every delivery really comes from Meta. Required when creating those.. up to 500 characters |
pageAccessToken | string or null | Meta: the token of the one Page this source served before Pages existed. Add Pages with POST /lead-sources/{id}/pages instead. |
curl -X POST https://crm.anibrosdesign.com/api/v1/lead-sources \
-H "Authorization: Bearer crm_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"provider":"meta","name":"text","status":"active"}'Responses:
201 400 401 402 403 429
GET/lead-sources/events
The delivery log
Every delivery a source received and what happened to it: created, added to an existing lead, waiting, needs attention or failed.
Needs the permission integrations:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
limit | query | integer | at least 1. up to 100. default 25 |
cursor | query | string | up to 512 characters |
endpointId | query | string (uuid) | |
status | query | one of received, created, duplicate, needs_review, ignored, failed, unrouted |
curl -X GET https://crm.anibrosdesign.com/api/v1/lead-sources/events \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
200 400 401 403 429
POST/lead-sources/events/{id}/ignore
Ignore a delivery
Needs the permission integrations:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) |
curl -X POST https://crm.anibrosdesign.com/api/v1/lead-sources/events/{id}/ignore \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
201 400 401 402 403 404 429
POST/lead-sources/events/{id}/retry
Retry a delivery
For deliveries that need review, failed, or wait for an owner.
Needs the permission integrations:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) |
curl -X POST https://crm.anibrosdesign.com/api/v1/lead-sources/events/{id}/retry \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
201 400 401 402 403 404 429
PATCH/lead-sources/{id}
Change a lead source
Needs the permission integrations:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) |
| Body field | Type | Notes |
|---|---|---|
provider | one of meta, google, website, generic, whatsapp | Required when creating. One of meta, whatsapp, google, website, generic. |
name | string | Required when creating.. at least 1 characters. up to 120 characters |
status | one of active, paused | |
config | any | Object: campaign, tags, source, pipelineId, stageId, ownerId, allowedOrigins, fieldMap, adAccountId, adAccountName, appId (Meta), routing (own or agency). |
appSecret | string | Meta and WhatsApp: the app secret, used to check every delivery really comes from Meta. Required when creating those.. up to 500 characters |
pageAccessToken | string or null | Meta: the token of the one Page this source served before Pages existed. Add Pages with POST /lead-sources/{id}/pages instead. |
curl -X PATCH https://crm.anibrosdesign.com/api/v1/lead-sources/{id} \
-H "Authorization: Bearer crm_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"provider":"meta","name":"text","status":"active"}'Responses:
200 400 401 402 403 404 412 429
DELETE/lead-sources/{id}
Delete a lead source
Needs the permission integrations:delete.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) |
curl -X DELETE https://crm.anibrosdesign.com/api/v1/lead-sources/{id} \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
200 400 401 402 403 404 429
GET/lead-sources/{id}/pages
The Facebook Pages of a Meta source
Each Page with the state of its own access token (works, expires, expired), whether lead notifications are on, its last lead and how many leads wait for it. Also lists Pages Meta sent leads for that are not on the list yet. Tokens are never returned.
Needs the permission integrations:read.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) |
curl -X GET https://crm.anibrosdesign.com/api/v1/lead-sources/{id}/pages \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
200 400 401 403 404 429
POST/lead-sources/{id}/pages
Add a Facebook Page to a Meta source
Send the Page’s access token (or useStoredToken: true to move the token saved on the source). Meta is asked which Page it is for and whether the token works; a personal token or a Page that another workspace uses is refused. With subscribe (the default) lead notifications are switched on for the Page. Any lead that waited for this Page’s token is read at once.
Needs the permission integrations:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) |
| Body field | Type | Notes |
|---|---|---|
token | string | up to 5000 characters |
useStoredToken | boolean | |
subscribe | boolean | default true |
curl -X POST https://crm.anibrosdesign.com/api/v1/lead-sources/{id}/pages \
-H "Authorization: Bearer crm_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"token":"text","useStoredToken":true,"subscribe":true}'Responses:
201 400 401 402 403 404 429
PATCH/lead-sources/{id}/pages/{pageId}
Give a Page a new access token
The token must be for the same Page. Leads that waited for a token are read at once.
Needs the permission integrations:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) | |
pageId required | path | string |
| Body field | Type | Notes |
|---|---|---|
token required | string | up to 5000 characters |
curl -X PATCH https://crm.anibrosdesign.com/api/v1/lead-sources/{id}/pages/{pageId} \
-H "Authorization: Bearer crm_live_xxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"token":"text"}'Responses:
200 400 401 402 403 404 412 429
DELETE/lead-sources/{id}/pages/{pageId}
Remove a Page from a Meta source
With unsubscribe=true (what the app sends) Meta is also told to stop sending this Page’s leads.
Needs the permission integrations:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) | |
pageId required | path | string | |
unsubscribe | query | boolean | default false |
curl -X DELETE https://crm.anibrosdesign.com/api/v1/lead-sources/{id}/pages/{pageId} \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
200 400 401 402 403 404 429
POST/lead-sources/{id}/pages/{pageId}/check
Ask Meta whether a Page’s token still works
Also checks that lead notifications are on.
Needs the permission integrations:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) | |
pageId required | path | string |
curl -X POST https://crm.anibrosdesign.com/api/v1/lead-sources/{id}/pages/{pageId}/check \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
201 400 401 402 403 404 429
POST/lead-sources/{id}/pages/{pageId}/subscribe
Switch on lead notifications for a Page
Asks Meta to send this Page’s new leads to the app (needs the pages_manage_metadata permission on the token).
Needs the permission integrations:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) | |
pageId required | path | string |
curl -X POST https://crm.anibrosdesign.com/api/v1/lead-sources/{id}/pages/{pageId}/subscribe \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
201 400 401 402 403 404 429
POST/lead-sources/{id}/rotate-secret
Rotate secret (lead sources)
Needs the permission integrations:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) |
curl -X POST https://crm.anibrosdesign.com/api/v1/lead-sources/{id}/rotate-secret \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
201 400 401 402 403 404 429
POST/lead-sources/{id}/test
Send a test lead through a source
Needs the permission integrations:manage.
| Parameter | In | Type | Notes |
|---|---|---|---|
id required | path | string (uuid) |
curl -X POST https://crm.anibrosdesign.com/api/v1/lead-sources/{id}/test \
-H "Authorization: Bearer crm_live_xxxxxxxx"Responses:
201 400 401 402 403 404 429
Something missing or unclear? Tell us.