Saltar al contenido
Volver al inicio

Desarrolladores

API de Atendivo

Lee tus llamadas, resúmenes, transcripciones, grabaciones y uso, y recibe webhooks cuando algo pasa. De servidor a servidor, JSON, con versión.

URL basehttps://portal.atendivo.com/api/public/v1Descargar OpenAPI (YAML)v1.0.0

Primeros pasos

  1. En el portal de Atendivo, entra a Ajustes → API y webhooks (dueño o administrador).
  2. Crea una clave y elige sus permisos. Cópiala: solo se muestra una vez.
  3. 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:read
  • recordings:read
  • transcripts:read
  • usage:read
  • webhooks: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/me

    The API key in use, its company, scopes and limits

    Respuestas

    200 · 401 · 403 · 429

Calls

  • get/callsPermiso: calls:read

    List calls, newest first

    Parámetros

    • limit (query, integer)
    • cursor (query, string) — next_cursor from 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:read

    One call with its current summary and next steps

    Parámetros

    • id (path, string)

    Respuestas

    200 · 401 · 403 · 404 · 429

  • get/calls/{id}/summariesPermiso: calls:read

    Every 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:read

    Full 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:read

    Recording 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:read

    This period's minutes

    The same numbers as the usage card in your portal. Never prices.

    Respuestas

    200 · 401 · 403 · 429

Webhooks

  • get/webhook-events

    Catalog of webhook event types

    Respuestas

    200 · 401

  • get/webhooksPermiso: webhooks:write

    Your webhook endpoints

    The signing secret is never returned here.

    Respuestas

    200 · 401 · 403

  • post/webhooksPermiso: webhooks:write

    Create 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 signing secret once.

    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}/test

    Send a webhook.test event now

    Delivers immediately (paused endpoints included) and returns the delivery result.

    Respuestas

    200 · 404

  • post/webhooks/{id}/rotate-secret

    New signing secret (the previous one keeps signing for 24 hours)

    Respuestas

    200 · 404 · 503

  • get/webhooks/{id}/deliveries

    Last 100 deliveries to this endpoint (kept 30 days)

    Respuestas

    200 · 404

Eventos de webhook

  • call.started

    Atendivo 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.ended

    The 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.missed

    Nobody 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.created

    The 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.updated

    The 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.ready

    Next 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.ready

    The recording is stored in Atendivo

    campos de data: call_id (string), duration_seconds (integer | null), recording_url (string)

  • call.transcript.ready

    The full transcript is ready

    campos de data: call_id (string), transcript_url (string)

  • sms.received

    An 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.created

    The 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_reached

    This 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.test

    Test event sent from the portal or POST /webhooks/{id}/test

    campos de data: message (string)

Demo de Atendivo

Solicita una demo

Déjanos tus datos y te contactamos para coordinar una demo de Atendivo.

De EE. UU., o internacional con + y código de país.

Al enviar, aceptas que te contactemos sobre la demo. Consulta la política de privacidad.