AGENTCALLER.IO

Poll GET /api/v1/calls/{id} or receive signed events at the webhook endpoint configured in the control room.

Call state moves through queued, dialing, in_progress, then completed, failed, or cancelled. Terminal states never reopen.

Payment state is separate from call state:

FundingPayment states
x402authorized, then settling, then settled or failed
Saved cardaccruing while usage is held, then accrued once usage is finalized
Operatornot_required throughout

Call completion does not imply payment settlement.

Event types

TypeSent whendata
call.queuedThe call is accepted{ callId, state }
call.dialingThe business is being dialed (x402 tasks only){ callId, state, outcome }
call.in_progressThe business answered (x402 tasks only){ callId, state, outcome }
call.completedThe call ended normally{ callId, state, outcome } or { callId, state, reason }
call.failedThe call failedAs above, or { callId, reason } when dispatch fails
call.cancelledThe call was cancelled{ callId, state } or { callId, state, reason }
payment.settledAn x402 payment was captured{ callId, amountMicros, transaction }
payment.failedAn x402 capture failed{ callId, error }

connect_me jobs send only call.queued and their terminal event. Poll the call to follow dialing, attempts and legs. Saved-card calls send no payment.* events; read their usage with GET /api/v1/billing/usage.

A payment.settled event with amountMicros: 0 and no transaction means the call never rang, so nothing was captured.

Webhook delivery

Each delivery is a POST with a JSON body of { id, timestamp, type, data } and three headers:

HeaderValue
AgentCaller-EventThe event ID, identical to id in the body
AgentCaller-TimestampISO-8601 signing timestamp, identical to timestamp in the body
AgentCaller-Signaturesha256=<hex>

The signature is HMAC-SHA256(secret, "{timestamp}.{rawBody}"), hex-encoded. Your signing secret is shown next to the webhook endpoint in the control room, and is unique to your client. It is created once and cannot be rotated yet.

import { createHmac, timingSafeEqual } from "node:crypto";

function verify(rawBody, headers, secret) {
  const timestamp = headers["agentcaller-timestamp"];
  const signature = headers["agentcaller-signature"];
  if (!timestamp || !signature?.startsWith("sha256=")) return false;
  const expected = Buffer.from(
    createHmac("sha256", secret)
      .update(`${timestamp}.${rawBody}`)
      .digest("hex"),
  );
  const received = Buffer.from(signature.slice("sha256=".length));
  return (
    expected.length === received.length && timingSafeEqual(expected, received)
  );
}

Verify the signature against the raw request body before parsing it, reject timestamps outside your tolerance window, store the event ID for replay protection, and make your handler idempotent.

  • Success: only a 2xx response within 10 seconds counts as delivered. Redirects are not followed and count as failures.
  • Retries: failures retry with exponential backoff, capped at one hour between attempts and ten attempts in total. The event ID stays the same across retries; the timestamp and signature are new on each attempt. After ten failures the event is not sent again.
  • Order: events are delivered concurrently and retries can interleave with newer events. Use the call's state and terminal status rather than arrival order.
  • No endpoint: events produced while no endpoint is configured are discarded. They are not sent after you add one later. Poll for anything you missed.
  • Destination: endpoints must be public HTTPS addresses. Private-network addresses are rejected when you save the endpoint and again on each delivery.

Connect-me jobs

For connect_me, queued includes a scheduled retry. While that retry is waiting, outcome.reason is busy, no_answer, or outside_window. dialing starts when the business leg is dialed and continues through classification and callback setup. in_progress means the callback participant has been moved into the business room. Polling returns job, the current attempts (a row changes until it is terminal), and separate legs. measuredMicros: null means unknown, not free. outcome.reason is a connectReasons value, including connected, cancelled, voicemail, worker_lost, dial_unknown, refused, attempts_exhausted, callback_declined, callback_timeout, callback_hangup, uncertain_answer, expired, spend_limit, and duration_limit.

POST /api/v1/calls/{id}/cancel ends the job immediately; a later acceptance cannot reopen it. The portal offers the same cancellation. Cancellation also stops scheduled retries. These jobs cannot be deleted yet (see retention). Recording and transcripts are not collected for this task.

On this page