Autenticação e permissões
O dono ou um administrador do workspace cria uma chave em Configurações › Integrações › Chaves de API e escolhe as permissões. Envie-a como token Bearer em cada requisição. O segredo aparece uma única vez; guarde-o no seu gerenciador de segredos.
curl https://rexenda.com/api/public/v1/contacts?limit=10 \
-H "Authorization: Bearer rx_live_<prefix>_<secret>"
Permissões
| Permissão | Permite |
| contacts:read | Contatos · ler |
|---|
| contacts:write | Contatos · escrever |
|---|
| leads:read | Oportunidades · ler |
|---|
| leads:write | Oportunidades · escrever |
|---|
| events:write | Eventos · escrever |
|---|
| journeys:write | Jornadas · escrever |
|---|
| consent:write | Consentimento · escrever |
|---|
| campaigns:read | Campanhas · ler |
|---|
| calls:read | Chamadas · ler |
|---|
| calls:write | Chamadas · escrever |
|---|
Erros
Os erros usam application/problem+json com um código estável para tratar no seu código e, nos de validação, o campo que falhou.
{ "type": "about:blank", "title": "Validation error", "status": 422,
"code": "invalid_phone", "field": "phone", "traceId": "…" }/leads
GET
/leads
Requer leads:read
List leads
| cursor | query | Opaque cursor from `next_cursor`. |
|---|
| limit | query | Page size (1-100, default 25). |
|---|
| contact_id | query | Only this contact's leads. |
|---|
Retorna: LeadPage (200)
POST
/leads
Requer leads:write
Create a lead
| Idempotency-Key | header | Retries with the same key and body return the original response for 24 hours. |
|---|
Corpo: LeadCreateRetorna: Lead (201)
GET
/leads/{id}
Requer leads:read
Get a lead
Retorna: Lead (200)
POST
/leads/{id}/stage
Requer leads:write
Move a lead to another stage
| id | path | |
|---|
| Idempotency-Key | header | Retries with the same key and body return the original response for 24 hours. |
|---|
Corpo: LeadStageUpdateRetorna: Lead (200)
/calls
GET
/calls
Requer calls:read
List calls (history)
| cursor | query | Opaque cursor from `next_cursor`. |
|---|
| limit | query | Page size (1-100, default 25). |
|---|
| from | query | Window start (ISO-8601, UTC). Default: 30 days before `to`. Max window 93 days. |
|---|
| to | query | Window end (ISO-8601, UTC, exclusive). Default: now. |
|---|
| queue_id | query | Only calls that went through this queue. |
|---|
| user_id | query | Only calls answered or made by this person. |
|---|
| number_id | query | Only calls of this workspace number. |
|---|
| direction | query | inbound or outbound. |
|---|
| outcome | query | answered, missed, abandoned, voicemail, failed or in_progress. |
|---|
| has_recording | query | Only calls with (true) or without (false) a recording. |
|---|
| q | query | Phone number or contact name (contains). |
|---|
Retorna: CallPage (200)
POST
/calls
Requer calls:write
Click-to-call: ring a workspace user, then dial the number
| Idempotency-Key | header | Retries with the same key and body return the original response for 24 hours. |
|---|
Corpo: CallCreateRetorna: CallStarted (202)
GET
/calls/{id}
Requer calls:read
Get a call with summary, disposition, transcript and a 5-minute signed recording link
Retorna: CallDetail (200)
GET
/calls/stats
Requer calls:read
Call analytics (also requires the advanced analytics plan feature)
| from | query | Window start (ISO-8601, UTC). Default: 30 days before `to`. Max window 93 days. |
|---|
| to | query | Window end (ISO-8601, UTC, exclusive). Default: now. |
|---|
| queue_id | query | Only calls that went through this queue. |
|---|
| user_id | query | Only calls answered or made by this person. |
|---|
| number_id | query | Only calls of this workspace number. |
|---|
| time_zone | query | IANA time zone for day and hour buckets. Default: the workspace time zone. |
|---|
| service_level_seconds | query | Service level threshold in seconds (1-600, default 20). |
|---|
| abandon_after_seconds | query | Hang-ups while waiting shorter than this are short abandons, not abandons (0-120, default 5). |
|---|
Retorna: CallStats (200)