List Leads
const url = 'https://api.aymaragents.com/public/v1/leads?limit=50';const options = {method: 'GET', headers: {'X-API-Key': '<X-API-Key>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://api.aymaragents.com/public/v1/leads?limit=50' \ --header 'X-API-Key: <X-API-Key>'List the tenant’s leads (SPEC_API_PUBLICA.md §2.1).
Same filter/pagination semantics as the internal GET /leads for the shared filters;
dateFrom/dateTo is public-API-only (backs a third-party CRM’s incremental sync, case 1
of the spec’s “casos de uso reales”).
Permiso necesario: tenant:leads.read
Authorizations
Sección titulada «Authorizations»Parameters
Sección titulada «Parameters»Query Parameters
Sección titulada «Query Parameters»Responses
Sección titulada «Responses»Successful Response
Paginated lead list (GET /public/v1/leads) – same envelope shape as the internal
LeadsResponse (PAGIN-1).
object
Lead shape returned by the public list/get/create/update endpoints.
Curated subset of the internal LeadOut (schemas/leads.py): drops
originChannelId/originChannelName (MCH-7 internal attribution, meaningless to a third-
party integration) and the legacy stage string mirror (stageId is the single canonical
field on this NEW contract – no legacy bridge to preserve here, unlike the internal shape
which still serves pre-KAN consumers).
object
12-api-contract.md §3.2 offset/limit pagination metadata, verbatim shape.
object
Examplegenerated
{ "items": [ { "id": "example", "customerId": "example", "conversationId": "example", "customerName": "example", "customerEmail": "example", "customerPhone": "example", "intent": "example", "quality": "example", "stageId": "example", "budget": { "min": 1, "max": 1 }, "zones": [ "example" ], "rooms": 1, "assignedOperatorId": "example", "source": "example", "notes": "example", "createdAt": "example", "updatedAt": "example" } ], "total": 1, "cursor": "example", "pagination": { "page": 1, "pageSize": 1, "totalItems": 1, "totalPages": 1, "hasNext": true, "hasPrev": true }}Validation Error
object
object
object
Examplegenerated
{ "detail": [ { "loc": [ "example" ], "msg": "example", "type": "example", "input": "example", "ctx": {} } ]}