POST https://agentcaller.io/api/v1/calls
This page covers x402 and operator funding. Saved-card calls use the same
endpoint with X-AgentCaller-Funding: stripe_postpaid and a different body;
see Saved-card billing. The overview compares the
three paths.
Supply Authorization: Bearer ac_… and an Idempotency-Key header of at most
128 characters. After validation, rate limits and rate-card checks pass, the
first request returns 402 with an x402 challenge in the PAYMENT-REQUIRED
header. Retry the same request with a base64-encoded PAYMENT-SIGNATURE.
{
"destination": "+34915200000",
"destinationCountry": "ES",
"language": "es",
"maxDurationSeconds": 600,
"maxAmountUsd": 1.2,
"task": {
"type": "reservation",
"partySize": 2,
"timeWindow": {
"startsAt": "2026-07-14T19:00:00.000Z",
"endsAt": "2026-07-14T21:00:00.000Z",
"timezone": "Europe/Madrid"
},
"contact": { "name": "Marta Ruiz" }
}
}Responses
Successful responses wrap the call in { "data": call } and return 202. A
call whose dispatch fails is still returned with 202, with state: "failed".
Reusing an idempotency key returns the original call with 202, even if the
body differs. Use a new key for a new request.
| Status | Meaning |
|---|---|
400 | Idempotency-Key is missing or longer than 128 characters |
402 | Payment is required; retry with PAYMENT-SIGNATURE |
403 | Operator funding was requested without an enabled operator profile |
422 | Validation failed: { "error": "Invalid request", "issues": [...] }, or a policy check failed with { "error": "..." } |
429 | The calls-per-minute or active-call limit was reached |
503 | No active rate card, x402 is not configured, or x402 was used for connect_me |
Limits
| Field | Rule |
|---|---|
maxDurationSeconds | 60–1800 |
maxAmountUsd | Greater than 0, at most 500 |
clientReference | Optional, at most 120 characters |
voiceId | Optional, at most 80 characters |
maxDurationSeconds is enforced on the call itself: AgentCaller hangs up when it elapses.
maxAmountUsd is a billing ceiling, not a call timer. It must cover the destination's connection
fee and one started minute, and you are never charged more than it — but it does not by itself end
a call. Size maxDurationSeconds to the spend you are willing to authorize.
Charges are capped at maxAmountUsd and measured from the telephony answer signal:
- Answered: the connection fee plus every started minute from the answer, even if the task fails afterwards.
- Busy or no answer: the connection fee only.
- Never rang (cancelled before the answer, an invalid or blocked destination, or a platform failure): nothing.
Cancelling an answered call bills the started minutes up to the cancellation.
Voices
voiceId is optional and defaults to the ara voice for every language. Supplying one that is
not enabled for your client returns 422. Ask an operator to enable a voice before using it.
Correlation
clientReference is an optional free-text field, echoed back on the call resource and in list
responses. Use it to tie a call to your own records.
Bounded business-to-mobile connection
connect_me can be funded by a saved card or by an operator.
Saved-card paid calling stays disabled until its release checks pass. x402
cannot fund connect_me: an x402 authorization covers one capture within an
hour, while a connect_me job is billed across two legs and can span several
attempts and days. Any connect_me request funded by x402 returns 503,
including Call now. Operator
funding is reserved for platform testing. The platform pays the call itself,
and the call reports paymentState: "not_required".
Send an operator-funded request with X-AgentCaller-Funding: operator; it
needs no PAYMENT-SIGNATURE. This example uses a scheduled weekly window:
{
"destination": "+34911234567",
"destinationCountry": "ES",
"language": "es",
"maxDurationSeconds": 900,
"maxAmountUsd": 5,
"task": {
"type": "connect_me",
"callbackNumber": "+34612345678",
"callbackLanguage": "it",
"purpose": "Speak to the post office about collecting a parcel",
"callingWindow": {
"timezone": "Europe/Madrid",
"weekdays": [1, 2, 3, 4, 5],
"start": "09:00",
"end": "17:00"
},
"expiresAt": "2026-09-19T15:00:00.000Z",
"maxAttempts": 2,
"retryDelaySeconds": 300,
"ringingSeconds": 40,
"waitingSeconds": 120,
"handoffSeconds": 90,
"callbackRingingSeconds": 40,
"acceptanceSeconds": 15,
"conversationSeconds": 600,
"maxIvrDigits": 0
}
}Connection timing
For Call now, use this task in the same request:
{
"type": "connect_me",
"callbackNumber": "+34612345678",
"callbackLanguage": "it",
"purpose": "Speak to the post office about collecting a parcel",
"callingWindow": "now",
"maxAttempts": 1,
"expiresAt": "2026-09-28T12:30:00.000Z"
}These are syntax examples, not authorized destinations or live deadlines.
callerName is optional: the name the business hears, at most 80 letters,
spaces, apostrophes, periods or hyphens.
callingWindow is required: supply either the literal "now" or the weekly
object. Call now requires an explicit maxAttempts: 1; omitting it or setting
it above one is invalid. It ignores timezone, weekdays and local hours, including
midnight, weekends and daylight-saving transitions. It never postpones to another
window or retries a busy/no-answer outcome.
Call now means the job may dial any time before expiresAt; dialing is not
guaranteed to start instantly. Expiry also ends active sessions in both modes; it is not just the last
time dialing may start. All funding, destination, duration and spend controls
still apply.
Supply an explicit future expiresAt. For Call now, it can be at most 30
minutes ahead. The portal defaults new calls to Call now with a 30-minute
expiry.
Scheduled calls use the weekly object shown above. Supply actual business hours and a future expiry within seven days. Weekdays use Monday=1 through Sunday=7; windows are same-day local times in an explicit IANA timezone. Scheduled jobs retain the defaults of six attempts and a 300-second retry delay. Redialing a scheduled job in the portal retains its saved scheduled values and requires a fresh deadline rather than switching it to Call now.
language and callbackLanguage each accept en, es, and it.
The destination policy accepts geographic landlines and supported mobile ranges
in Spain, Italy, and Ireland. Spanish mobile destinations use nine national digits in the
6, 71–74, or 78 ranges. Italian mobile destinations use nine or ten national
digits in the 32–39 ranges, or ten in the 31 and 43 ranges. These mobile patterns
follow libphonenumber metadata.
Irish destinations start with +353 and use the area code without the domestic 0. Irish mobiles have seven subscriber digits after 83, 85, 86, 87, or 89.
Direct mobile mailbox numbers are excluded. The Irish ranges follow the
ComReg numbering conditions.
Use Europe/Dublin for Irish calling hours. Each destination requires
approved pricing before calls can be accepted.
Premium-rate, service, emergency and short-code destinations remain excluded.
The country code must match destinationCountry; prefix validation does not
verify ownership, business use, reachability, or consent. The callback is
restricted to Spanish mobile ranges (6 and 71–74).
Only scheduled jobs with a confirmed busy or no-answer result retry, at least five minutes apart, within hours, expiry, attempt and spend limits. A terminal attempt never reopens. Refusal, voicemail, unclear IVR, uncertain detection and failed callback stop the job. IVR navigation defaults to zero digits; an explicitly positive limit allows at most five clearly identified menu choices. The assistant stays silent when it detects voicemail on the business leg. The callback can reach voicemail, and only pressing 1 can connect the two legs.
Allow time in handoffSeconds for the callback to ring, play the AI
introduction and press-1 instructions, and wait for a response. The
acceptanceSeconds timer starts after the instructions. The handoff or
callback time limit can end the call before that response window is over.
Ringing, prompts, and waiting for a response can also reduce the time
available for the joined conversation.
The spend cap must cover maxAttempts times both legs at their maximum
durations, at the rates fixed when the job is accepted, including waiting and
conversation. Expiry or the attempt count can still stop a job early.