Buckets Leads Status API

The Buckets Leads Status API allows authorized systems to retrieve lead data for a givenΒ bucket and affiliate, using emails and/or client IDs, with optional filtering, pagination, and flexible response structure.

These endpoints are read-only and implemented as POST to support bulk lookups.


πŸ“ Base path

/api/public

πŸ” Authentication

Method: Token-based via Authorization header

Authorization: <API_TOKEN>

Required permission:
πŸ‘‰ Buckets: View Own

If authentication fails:

401 Unauthorized
{
  "message": "Access with the provided credentials is incorrect. CODE: X-0005",
  "statusCode": 401
}

βš™οΈ Common behavior


πŸ“¦ Endpoint: Leads by bucket & affiliate

POST /buckets/{bucketId}/{affiliateID}/leads

🧠 Description

Returns lead data for clients identified by:

Includes validation:


πŸ“Œ Path parameters


πŸ“₯ Request headers


πŸ“€ Request body

{
  "emails": ["user1@example.com"],
  "ids": ["69ce524d741e8f2238329fff"],
  "keyBy": "email",
  "filters": {
    "createdDate": ["1676172330450", "1776172330450"]
  },
  "limit": 100,
  "offset": 0
}

🧩 Fields


⚠️ Notes


βœ… Successful response

200 OK

Response is an object keyed by email or id (based on keyBy).

{
  "user1@example.com": {
    "id": "69ce524d741e8f2238329fff",
    "email": "user1@example.com",
    "affiliateID": "1234567890",
    "status": "active",
    "createdDate": "2021-01-01T00:00:00.000Z",
    "ftd": "2021-01-01T00:00:00.000Z"
  }
}

❌ Errors

400 Bad Request

401 Unauthorized


🧩 Endpoint: Leads by bucket, affiliate & source

POST /buckets/{bucketId}/{affiliateID}/leads/{sourceId}

🧠 Description

Same as previous endpoint, with an additional source validation step.

Used for source-level access control.


πŸ“Œ Path parameters


πŸ“€ Request body

Same as previous endpoint.


⚠️ Source validation behavior


βœ… Successful response

Same structure as previous endpoint.


❌ Errors

400 Bad Request

All previous errors, plus:

401 Unauthorized

Same as previous endpoint.


πŸ”§ Example requests

Without sourceId

curl -X POST "(CRM origin)/api/public/buckets/<bucketId>/<affiliateID>/leads" \
  -H "Content-Type: application/json" \
  -H "Authorization: <API_TOKEN>" \
  -d '{
    "emails": ["user1@example.com"],
    "ids": ["69ce524d741e8f2238329fff"],
    "limit": 50,
    "offset": 0
  }'

With sourceId

curl -X POST "(CRM origin)/api/public/buckets/<bucketId>/<affiliateID>/leads/<sourceId>" \
  -H "Content-Type: application/json" \
  -H "Authorization: <API_TOKEN>" \
  -d '{
    "filters": {
      "createdDate": ["1676172330450", "1776172330450"]
    }
  }'

Revision #8
Created 4 February 2026 12:08:51 by Volodymyr Tsyoha
Updated 16 April 2026 12:26:04 by Volodymyr Tsyoha