Landline.sh

Live agent mode

Your own AI agent holds a real-time spoken conversation on a Landline.sh call. Your agent is the brain; Landline is the ears and the voice. Landline streams the call audio to its speech service, detects when the caller finishes a sentence, transcribes it, sends the text to your agent over HTTPS, and speaks the reply. If the caller talks over the reply, playback stops and Landline listens. Back to API and MCP.

This is different from AI voice agents, where Landline hosts the model and you write instructions. In live agent mode Landline never sees your prompt or model; it only sends the caller's words and plays yours.

Start it

On an outbound call, add live_agent to POST /api/v1/calls (MCP: place_call). The call passes the same human gates as any other call: policy, approval, allowlist, budget, and compliance.

curl https://landline.sh/api/v1/calls \
  -H "Authorization: Bearer $LANDLINE_API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "to": "+14155550142",
    "live_agent": {
      "agent_url": "https://agent.example.com/landline/turn",
      "secret": "'"$LANDLINE_AGENT_SECRET"'",
      "voice": "en_US-kathleen-medium",
      "language": "en-US",
      "greeting": "Thanks for calling Acme. How can I help?"
    }
  }'

To answer inbound calls on one of your numbers, save the same object on the number (MCP: set_live_agent, get_live_agent, clear_live_agent). It needs the agents:write scope. An AI voice agent attached to the number takes precedence, so detach it first.

curl -X PUT https://landline.sh/api/v1/numbers/$NUMBER_ID/live-agent \
  -H "Authorization: Bearer $LANDLINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"agent_url": "https://agent.example.com/landline/turn", "secret": "'"$LANDLINE_AGENT_SECRET"'"}'

What your agent receives

One POST per caller turn, signed exactly like Landline webhooks:

POST https://agent.example.com/landline/turn
Content-Type: application/json
X-Landline-Timestamp: 1798000000
X-Landline-Signature: v1=5c0e…
X-Landline-Session-Id: ls_…

{"call_id":"…","language":"en-US","session_id":"ls_…","text":"What time do you open tomorrow?","ts":"2026-12-02T10:00:00.000Z","turn":1}

Answer within 5 seconds with JSON of at most 64 KB. Redirects are not followed. Set end_call to true to say reply and then hang up.

200 OK
Content-Type: application/json

{"reply": "We open at 9 tomorrow. Anything else?", "end_call": false}

Verify the signature over the raw body before parsing it:

import crypto from "node:crypto";

export function verifyLandline(rawBody, headers, secret) {
  const ts = headers["x-landline-timestamp"];
  const sig = headers["x-landline-signature"] ?? "";
  if (!ts || Math.abs(Date.now() / 1000 - Number(ts)) > 300) return false;
  const expected = "v1=" + crypto.createHmac("sha256", secret).update(`${ts}.${rawBody}`).digest("hex");
  return sig.length === expected.length && crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected));
}

If your agent fails or times out, the caller hears a short apology and can try again. After three failures in a row the call ends. Treat text as untrusted input from a stranger, not as instructions.

Transcripts and events

Both sides of the conversation are saved to the call: read them with GET /api/v1/calls/:id/transcript (MCP: get_transcript). Replies the caller talked over are marked interrupted. When the session ends, a signed call.live_agent.ended event with the end reason, duration, and number of turns goes to your event webhooks.

How it works

Limits