> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentline.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Calls

> Make outbound calls, hang up, and read transcripts.

# Calls

Calls use a hybrid relay pipeline: the provider answers, plays the greeting,
records caller speech, transcribes it (Deepgram), and your agent replies with
text that is spoken back (TTS). The full transcript is saved automatically.

## Make an outbound call

<CodeGroup>
  ```python theme={null}
  call = client.calls.create(
      agent_id=agent.id,
      to_number="+12125557890",
      # optional per-call overrides:
      system_prompt="You are confirming an appointment.",
      initial_greeting="Hi, calling about your appointment tomorrow.",
  )
  ```

  ```javascript theme={null}
  const call = await client.calls.create({
      agentId: agent.id,
      toNumber: "+12125557890",
      systemPrompt: "You are confirming an appointment.",
      initialGreeting: "Hi, calling about your appointment tomorrow.",
  });
  ```
</CodeGroup>

The call is placed from the agent's assigned number (or `from_number_id` if
provided). Returns a `call_id` you use to control and inspect the call.

## Control and inspect

<CodeGroup>
  ```python theme={null}
  client.calls.hangup(call.id)
  client.calls.get(call.id)
  transcript = client.calls.get_transcript(call.id)
  client.calls.list(status="completed")
  ```

  ```javascript theme={null}
  await client.calls.hangup(call.id);
  await client.calls.get(call.id);
  const transcript = await client.calls.getTranscript(call.id);
  await client.calls.list({ status: "completed" });
  ```
</CodeGroup>

## Pushing context to a live call (relay mode)

If your backend (Hermes, OpenClaw, Claude Code, Codex, or another agent) needs
to answer a live caller after a `call.utterance` event, use the persistent
[Agent Relay](/guides/relay) or push context over HTTP. Every response is bound
to the exact `turn_id` from that event.

<CodeGroup>
  ```python theme={null}
  client.calls.push_context(call.id, turn_id="turn_xxx", context="Your order ships Tuesday.")
  ```

  ```javascript theme={null}
  await client.calls.pushContext(call.id, { turnId: "turn_xxx", context: "Your order ships Tuesday." });
  ```
</CodeGroup>

Returns `delivered=true` with `status: "live"` or `"duplicate"`. A **409** means
the turn is stale or cancelled; a **410** means the call has ended. Never reuse
context from one turn for another.

The response is spoken verbatim and then retained as the assistant turn in the
call conversation. Keep it caller-ready and concise. The hosted LLM is only a
fallback if direct TTS fails.

<Note>
  Transcripts are a list of `{role, text, timestamp}` turns where
  `role` is `human` (caller) or `assistant` (the AI agent).
</Note>
