> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.rasen.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.rasen.ai/_mcp/server.

# Call lifecycle

> Read a call's state, dial outcome and result readiness, know which are final, and match each state to its webhook event.

## Summary

This page explains how a call starts and what each call `state` means. It also gives the
`dial_outcome` values, the readiness of each result and the webhook event of each end. It does not
cover why a call ended; see [Call end reasons](/reference/call-end-reasons).

## Facts

| Item                         | Value                                                                                                                                              |
| ---------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
| Operations that start a call | `createCall` (`POST /calls`), `createAgentSession` (`POST /agent-sessions`). An inbound call needs no operation                                    |
| Operations that read a call  | `getCall`, `listCalls`, `searchCalls`, `getCallTranscript`, `getCallSummary`, `getCallExtraction`, `downloadCallRecording`, `listCallToolOutcomes` |
| Operation that ends a call   | `endCall` (`POST /calls/{call_id}/end`)                                                                                                            |
| `state` values               | `admitted`, `active`, `evidence_pending`, `complete`, `incomplete`, `aborted`. Open vocabulary                                                     |
| Terminal states              | `complete`, `incomplete`, `aborted`. `terminal` is `true` for these three. Only `incomplete` can change again, to `complete`                       |
| `evidence_pending` limit     | 900 seconds, then `incomplete`                                                                                                                     |
| Agent session deadline       | `expires_at`: 120 seconds after admission                                                                                                          |
| Longest call                 | 30 minutes, whatever `max_call_duration_seconds` says. The call then ends with `end_reason` `timeout`                                              |
| Inactivity timeout           | `inactivity_timeout_seconds`: 1 to 3600, default 30. The call then ends with `end_reason` `timeout`                                                |
| Poll hint                    | `poll_after_seconds` on `getCall`; `null` when the call is terminal and no result is `pending`                                                     |
| Webhook end events           | `call.completed` or `call.failed`, once for each call, only within 24 hours of the call end                                                        |
| `call.analyzed`              | After `call.completed`, when the results are final, or 6 hours after the call end                                                                  |

## How a call starts

| Start               | Operation            | First answer                                                                                                                   | What happens next                                                                                                  |
| ------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| Outbound phone call | `createCall`         | `202` with `CallAccepted`: `call_id`, `published_version_id`, `state: admitted`, `poll_after_seconds`, and a `Location` header | Rasen requested the dial once. `202` means admitted, not connected. Read the call at `Location`.                   |
| Your own call leg   | `createAgentSession` | `201` with `state: admitted`, `websocket_url` and `expires_at`                                                                 | Connect to `websocket_url` and send audio before `expires_at`. The call becomes `active` at the first audio frame. |
| Inbound phone call  | None                 | The call appears in `listCalls` with `direction: inbound`                                                                      | Rasen answers a number that has an inbound agent.                                                                  |
| Campaign attempt    | `startCampaign`      | Each attempt is a call                                                                                                         | See [Campaign lifecycle](/concepts/campaign-lifecycle).                                                            |

Each call runs the live version of its agent at admission, and keeps that version to the end. A
later publish or rollback does not change a call that is already admitted.

## Call states

| `state`            | Meaning                                                                                       | Terminal | What happens next                                                                                                                                     |
| ------------------ | --------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `admitted`         | Rasen accepted the call start and reserved its place. Rasen has accepted no media yet.        | No       | `active` when Rasen accepts the call's media. `aborted` when the media never connects, the caller ends the call first, or admission refuses the call. |
| `active`           | Rasen accepted the media, and the conversation runs.                                          | No       | `evidence_pending` when the conversation ends.                                                                                                        |
| `evidence_pending` | The conversation is over. Rasen is storing the call record: transcript, recording and timing. | No       | `complete` when Rasen has stored the record. `incomplete` after 900 seconds without it.                                                               |
| `complete`         | The call happened, and its record is complete.                                                | Yes      | Nothing. Each result becomes ready on its own; read its readiness.                                                                                    |
| `incomplete`       | The call happened, and part of its record is missing.                                         | Yes      | Rasen can change it to `complete` when the full record arrives later. `end_reason` does not change. Rasen sends no event for this change.             |
| `aborted`          | The call never started: Rasen accepted no media.                                              | Yes      | Nothing. `transcript_state` is `absent`, and the other results are `unavailable`.                                                                     |

`endCall` on a call in `evidence_pending` or a terminal state answers the current state with
`end_requested: false`. The conversation is already over.

## Dial outcome

`dial_outcome` is the carrier's report for the outbound dial that placed the call. It is `null`
when no carrier dial placed the call: inbound, browser and test calls. `dial_sip_code` is the SIP
response code when the carrier gave one, for example `480` or `486`.

| `dial_outcome`   | Meaning                                                                                                |
| ---------------- | ------------------------------------------------------------------------------------------------------ |
| `dialing`        | Rasen requested the dial, and the carrier has not reported an outcome.                                 |
| `ringing`        | The carrier reports that the phone rings.                                                              |
| `answered`       | The called phone answered. A voicemail can still answer after the carrier connects; read `end_reason`. |
| `no_answer`      | The phone rang, and nobody answered.                                                                   |
| `busy`           | The line was busy.                                                                                     |
| `voicemail`      | The carrier reports that a machine answered.                                                           |
| `rejected`       | The carrier or the called phone rejected the call.                                                     |
| `invalid_number` | The carrier reports that the number is not valid.                                                      |
| `failed`         | The dial failed.                                                                                       |
| `cancelled`      | The carrier reports the dial as cancelled before it connected.                                         |
| `indeterminate`  | Rasen cannot know the carrier's outcome.                                                               |

`dial_outcome` is an open vocabulary. Keep a value you do not know, and never read it as success.

## Result readiness

Each result of a call has its own readiness field. A result read returns what Rasen stored and never
starts work. The call `state` does not tell you whether a result is ready.

| Value           | Meaning                                                                                                                                                                                                                                    | Fields                                                  |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------- |
| `pending`       | Rasen has not stored the result yet. The call is live, or Rasen is producing the result.                                                                                                                                                   | `transcript_state`, `extraction_state`, `summary_state` |
| `ready`         | Rasen stored the result. Read it.                                                                                                                                                                                                          | `transcript_state`, `extraction_state`, `summary_state` |
| `absent`        | The call ended with no transcript.                                                                                                                                                                                                         | `transcript_state`                                      |
| `failed`        | Rasen could not produce the result.                                                                                                                                                                                                        | `transcript_state`, `extraction_state`, `summary_state` |
| `unavailable`   | The result does not exist, and Rasen does not produce it, for example for an `aborted` call. Right after a call ends, it can read `unavailable` for a short time; see [A terminal call that can change](#a-terminal-call-that-can-change). | `transcript_state`, `extraction_state`, `summary_state` |
| `not_requested` | The agent asked for no result of this kind, for example no extraction fields.                                                                                                                                                              | `extraction_state`, `summary_state`                     |

The summary is ready when the extraction finishes. The call has no readiness field for the
recording: `downloadCallRecording` answers `404 not_found` for a call without a recording, and the
`call.analyzed` event carries `recording.available`.

When to read again:

| Situation                                                     | `poll_after_seconds` | What to do                                                                                               |
| ------------------------------------------------------------- | -------------------- | -------------------------------------------------------------------------------------------------------- |
| The call is live (`admitted`, `active` or `evidence_pending`) | A number             | Read the call again after that many seconds.                                                             |
| The call is terminal and a result is `pending`                | A number             | Read the call again after that many seconds.                                                             |
| The call is terminal and no result is `pending`               | `null` on `getCall`  | Stop polling this call. To catch an `incomplete` call that becomes `complete` later, run a changes scan. |

## A terminal call that can change

An `incomplete` call becomes `complete` when its full record arrives later. Rasen sends no webhook
event for this change: the call already got its end event. The change moves the call's
`updated_at`. To catch it, list the calls that changed since your last scan with `listCalls` and
`updated_since`. See [Keep a copy in sync](/guides/calls#9-keep-a-copy-in-sync).

`complete` and `aborted` do not change state again.

Right after a call becomes terminal, `extraction_state` and `summary_state` can read
`unavailable` for a short time, with `poll_after_seconds` `null`. Then they read `pending`. If a
call ended in the last few seconds and a result reads `unavailable`, read the call once more after
5 seconds. Only then treat the result as final.

## Webhook events

| What happened                                                                                                                  | Call `state` at that time                      | Event            |
| ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------- | ---------------- |
| Rasen accepted the media, and the call left `active`                                                                           | `evidence_pending`, `complete` or `incomplete` | `call.completed` |
| The call ended before Rasen accepted any media                                                                                 | `aborted`                                      | `call.failed`    |
| After `call.completed`: the transcript, the recording state and the extraction are final, or 6 hours passed since the call end | `complete` or `incomplete`                     | `call.analyzed`  |

A call gets exactly one of `call.completed` and `call.failed`, and `call.analyzed` only after
`call.completed`. Rasen sends an end event only within 24 hours of the call end. An imported call
sends no event. See [Webhook events](/reference/webhook-events) for the payloads.

## Refusals

A call start that admission refuses places no call. `createCall` and `createAgentSession` answer
the refusal as an error, for example `429 workspace_concurrency_full` with `Retry-After`, and
create no call. An inbound call or a campaign attempt that admission refuses is a call in state
`aborted`. Its `end_reason` is the refusal code, for example `workspace_concurrency_full`, and it
sends `call.failed`.

| Refusal code                       | Meaning                                                                                                                                                                   |
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `workspace_concurrency_full`       | The workspace already runs all the concurrent calls of its share.                                                                                                         |
| `workspace_concurrency_unallotted` | The workspace's share of the account's concurrent calls is 0.                                                                                                             |
| `at_capacity`                      | With `details.reason` `workspace_limit`: the workspace already runs as many calls as its own limit allows. With any other reason: no capacity was free to carry the call. |
| `admission_busy`                   | The admission service was busy.                                                                                                                                           |
| `quota_exceeded`                   | An enforced quota had no allowance left.                                                                                                                                  |

A full workspace answers one of two codes. Handle both:

* `429 workspace_concurrency_full` comes when the workspace's share or the organization's total
  is full. `details.reason` is `workspace_share` or `organisation_total`.
* `503 at_capacity` with `details.reason` `workspace_limit` comes when the workspace has a limit of
  its own and no share. `details.active` and `details.limit` give the count.

For both, end a call, or wait for one to finish. Wait at least `Retry-After` seconds. Then send the
identical request with the same `Idempotency-Key`. Any other `at_capacity` reason means that the
platform has no free capacity.

The account's plan sets its total of concurrent calls, and each workspace gets a share. A
workspace without a share has a limit of its own. See [Retry after a refusal](/concepts/idempotency#retry-after-a-refusal) for how to retry each refusal.

## Rules

* MUST read `terminal`, not a list of states, to know whether a call has ended. `complete` and
  `aborted` do not change again. `incomplete` can change to `complete`.
* MUST read each result's own readiness field before you read the result.
* MUST follow `poll_after_seconds`, and stop polling a call when it is `null`.
* MUST run a changes scan (`listCalls` with `updated_since`) to catch an `incomplete` call that
  becomes `complete`. No webhook event announces it.
* MUST NOT treat `202` from `createCall` as a connected call.
* MUST keep an unknown `state`, `dial_outcome`, `end_reason` or readiness value, and never read it
  as success.

## Related

* [Call end reasons](/reference/call-end-reasons)
* [Place calls and read results](/guides/calls)
* [Receive call events with webhooks](/guides/webhooks)
* [Webhook events](/reference/webhook-events)
* [Campaign lifecycle](/concepts/campaign-lifecycle)
* [Limits and quotas](/concepts/limits)
* [Errors](/concepts/errors)