Primeros pasos
- En el portal de Atendivo, entra a Ajustes → API y webhooks (dueño o administrador).
- Crea una clave y elige sus permisos. Cópiala: solo se muestra una vez.
- Llama a la API desde tu servidor. Nunca pongas la clave en un navegador ni en una app móvil.
curl https://portal.atendivo.com/api/public/v1/calls?limit=5 \
-H "Authorization: Bearer atd_live_…"Autenticación
Envía la clave en cada solicitud como token Bearer. Cada clave tiene permisos (scopes); una solicitud sin el permiso necesario responde 403 insufficient_scope. Las claves revocadas o vencidas responden 401.
calls:readrecordings:readtranscripts:readusage:readwebhooks:write
Límites de solicitudes
120 solicitudes por minuto y 20,000 por día por clave; 300 por minuto por empresa; 30 descargas de grabaciones por minuto por clave. Las respuestas traen RateLimit-Limit, RateLimit-Remaining y RateLimit-Reset. Si te pasas, recibes 429 con Retry-After.
Errores
Los errores tienen una sola forma. Menciona el request_id (también en la cabecera Atendivo-Request-Id) cuando escribas a soporte. Los ids de otras empresas responden 404, igual que los que no existen.
{
"error": { "code": "rate_limited", "message": "Rate limit exceeded…" },
"request_id": "6f1c…"
}Paginación
Los listados devuelven data y next_cursor. Pasa next_cursor en el parámetro cursor para la página siguiente; null significa que no hay más.
Webhooks
Agrega hasta 5 URLs HTTPS en el portal o con la API y elige los eventos. Atendivo envía un POST con un evento JSON, firmado con el secreto de tu endpoint. Responde cualquier 2xx en menos de 10 segundos; los fallos se reintentan hasta 8 veces durante unas 22 horas, y un endpoint sin ningún 2xx durante 3 días se desactiva. El id del evento no cambia entre reintentos: ignora duplicados. El orden no está garantizado.
POST https://your-server.example.com/webhooks/atendivo
Atendivo-Webhook-Id: evt_3f0c2a…
Atendivo-Event: call.started
Atendivo-Timestamp: <unix seconds>
Atendivo-Signature: v1=5257a8…
{
"id": "evt_3f0c2a…",
"type": "call.started",
"created_at": "2026-11-01T20:00:00.000Z",
"company_id": "…",
"data": { "call_id": "…", "from": "+12105550123", "to": "+18305550100", "route": "ai" }
}Verificar la firma
Calcula HMAC-SHA256 de "<Atendivo-Timestamp>.<cuerpo crudo>" con tu secreto y compáralo, en tiempo constante, con cualquier valor v1= de Atendivo-Signature (llegan dos mientras rotas el secreto). Rechaza timestamps de más de 5 minutos.
import { createHmac, timingSafeEqual } from "node:crypto";
export function verify(rawBody, headers, secret) {
const ts = Number(headers["atendivo-timestamp"]);
if (!ts || Math.abs(Date.now() / 1000 - ts) > 300) return false;
const want = createHmac("sha256", secret).update(`${ts}.${rawBody}`).digest();
return String(headers["atendivo-signature"] ?? "")
.split(" ")
.map((p) => p.replace(/^v1=/, ""))
.some((hex) => hex.length === want.length * 2 && timingSafeEqual(Buffer.from(hex, "hex"), want));
}Referencia de la API
Account
- get
/meThe API key in use, its company, scopes and limits
Respuestas
200 · 401 · 403 · 429
Calls
- get
/callsPermiso:calls:readList calls, newest first
Parámetros
limit(query, integer)cursor(query, string) —next_cursorfrom the previous page.since(query, string) — Calls started at or after this time.until(query, string) — Calls started before this time.status(query, CallStatus)outcome(query, CallOutcome)
Respuestas
200 · 400 · 401 · 403 · 429
- get
/calls/{id}Permiso:calls:readOne call with its current summary and next steps
Parámetros
id(path, string)
Respuestas
200 · 401 · 403 · 404 · 429
- get
/calls/{id}/summariesPermiso:calls:readEvery version of the call's summary, oldest first
The voice agent may send an early summary and update it during the call; the last one is current.
Parámetros
id(path, string)
Respuestas
200 · 401 · 403 · 404 · 429
- get
/calls/{id}/transcriptPermiso:transcripts:readFull transcript of the call
Available when transcription is enabled for your account and the recording was not deleted by retention.
Parámetros
id(path, string)
Respuestas
200 · 401 · 403 · 404 · 429
- get
/calls/{id}/recordingPermiso:recordings:readRecording audio
Single byte ranges are supported (
Range: bytes=…→ 206).Parámetros
id(path, string)Range(header, string)
Respuestas
200 · 206 · 401 · 403 · 404 · 429 · 503
Usage
- get
/usagePermiso:usage:readThis period's minutes
The same numbers as the usage card in your portal. Never prices.
Respuestas
200 · 401 · 403 · 429
Webhooks
- get
/webhook-eventsCatalog of webhook event types
Respuestas
200 · 401
- get
/webhooksPermiso:webhooks:writeYour webhook endpoints
The signing secret is never returned here.
Respuestas
200 · 401 · 403
- post
/webhooksPermiso:webhooks:writeCreate a webhook endpoint
Up to 5 endpoints per company. The URL must be
https://on port 443 with a public DNS name (no IP addresses, no private networks). The response includes the signingsecretonce.Respuestas
201 · 400 · 401 · 403 · 409 · 413
- get
/webhooks/{id}One webhook endpoint
Respuestas
200 · 404
- patch
/webhooks/{id}Change URL, events, description or pause/resume
Respuestas
200 · 400 · 404
- delete
/webhooks/{id}Delete a webhook endpoint
Respuestas
204 · 404
- post
/webhooks/{id}/testSend a webhook.test event now
Delivers immediately (paused endpoints included) and returns the delivery result.
Respuestas
200 · 404
- post
/webhooks/{id}/rotate-secretNew signing secret (the previous one keeps signing for 24 hours)
Respuestas
200 · 404 · 503
- get
/webhooks/{id}/deliveriesLast 100 deliveries to this endpoint (kept 30 days)
Respuestas
200 · 404
Eventos de webhook
call.startedAtendivo received a call and handed it to the voice agent or the forwarding number
campos de data:
call_id(string),from(string | null),to(string),started_at(string),route(ai | forwarded),call_url(string)call.endedThe call ended
campos de data:
call_id(string),from(string | null),to(string),started_at(string),ended_at(string | null),duration_seconds(integer | null),status(CallStatus),outcome(CallOutcome | null),minutes_billed(integer | null),call_url(string)call.missedNobody answered the call
campos de data:
call_id(string),from(string | null),to(string),reason(no_answer | failed | minutes_cap),call_url(string)call.summary.createdThe agent's first summary arrived
campos de data:
call_id(string),summary_id(string),version(integer),text(string),caller_name(string | null),call_url(string)call.summary.updatedThe agent sent a new version of the summary
campos de data:
call_id(string),summary_id(string),version(integer),text(string),caller_name(string | null),call_url(string)call.next_steps.readyNext steps were generated for the final summary
campos de data:
call_id(string | null),summary_id(string),items(string[]),call_url(string | null)call.recording.readyThe recording is stored in Atendivo
campos de data:
call_id(string),duration_seconds(integer | null),recording_url(string)call.transcript.readyThe full transcript is ready
campos de data:
call_id(string),transcript_url(string)sms.receivedAn SMS arrived at the company's number (inbound SMS enabled)
campos de data:
message_id(string),from(string),to(string),text(string),received_at(string)chat.lead.createdThe web chat captured a lead
campos de data:
conversation_id(string),name(string | null),phone(string | null),email(string | null),message(string | null)usage.threshold_reachedThis month's usage crossed 80%, 100% or 120% of the plan
campos de data:
threshold_pct(integer),used_minutes(integer),included_minutes(integer),period_start(string)webhook.testTest event sent from the portal or POST /webhooks/{id}/test
campos de data:
message(string)