<!-- Generated from the reviewed public OpenAPI contract. Do not edit this file. -->

# Answer a ringing inbound call


**POST** ` /v1/calls/{id}/answer `


See https://ordan.io/docs/authentication and https://ordan.io/docs/errors for authority, scopes and retries. Paid usage reports customer charges; preview usage reports provider-cost allowance consumption. Money fields use the units specified in their schemas.

Operation ID: ` post__v1_calls_id_answer `.

## Authentication

Use **one** of these authentication alternatives. Schemes on the same line are required together:

- ` bearerAgent ` (bearer token)

Organization roles, key scopes, grant capabilities, policy and spend limits still apply. See [Authentication](../authentication.md).

## Request

### Path parameters


| Parameter | Type | Required | Description / constraints |
| --- | --- | --- | --- |
| ` id ` | string | Yes | — |


### Header parameters


| Parameter | Type | Required | Description / constraints |
| --- | --- | --- | --- |
| ` Idempotency-Key ` | string | No | One key per logical operation; reuse only with identical body. Retrieve committed resources after ambiguous outcomes. |


No request body is declared in this contract.

## Request examples

These are **request templates**, not executed requests. Replace `REPLACE_…` and `<…>` placeholders, set the credential environment variables, and supply any conditional fields your action needs. JSON values are illustrative, not live records. Use a stable idempotency key per logical operation.

```bash
curl --request POST --url 'https://api.ordan.io/v1/calls/REPLACE_id/answer' \
  --header "Authorization: Bearer $ORDAN_AGENT_TOKEN" \
  --header "Idempotency-Key: $ORDAN_IDEMPOTENCY_KEY"
```

```js
const response = await fetch("https://api.ordan.io/v1/calls/REPLACE_id/answer", {
  method: "POST",
  headers: {
    "Authorization": "Bearer " + process.env.ORDAN_AGENT_TOKEN,
    "Idempotency-Key": "" + process.env.ORDAN_IDEMPOTENCY_KEY,
  },
});
const text = await response.text();
if (!response.ok) throw new Error(`${response.status}: ${text}`);
const result = text ? JSON.parse(text) : null;
```

```python
import json
import os
from urllib.request import Request, urlopen

request = Request("https://api.ordan.io/v1/calls/REPLACE_id/answer",
    method="POST",
    headers={
        "Authorization": "Bearer " + os.environ["ORDAN_AGENT_TOKEN"],
        "Idempotency-Key": "" + os.environ["ORDAN_IDEMPOTENCY_KEY"],
    },
)
with urlopen(request, timeout=30) as response:
    text = response.read().decode("utf-8")
    result = json.loads(text) if text else None
```

## Responses

| Status | Meaning |
| --- | --- |
| ` 400 ` | Invalid request; device token polling uses RFC 8628 string errors |
| ` 402 ` | spend_limit_exceeded: inspect details.scope (org/grant/line) and outstanding_micros |
| ` 403 ` | Missing authority, policy_violation, approval_required (details.approval_request), limit_reached, destination_not_supported or feature_disabled (details.feature) |
| ` 409 ` | Conflict, idempotency in progress, or a2p_registration_pending; retrieve state instead of duplicating work |
| ` 422 ` | validation_error: the request is not valid; details name each field |
| ` 429 ` | Rate limited; back off and retain the same idempotency key |
| ` 502 ` | provider_error: unknown routes need verified quotes; ambiguous operations retain resource references and cost holds |
| ` 2XX ` | Success (created objects use 201) |
| ` default ` | Error |

Status ranges such as `2XX` are retained exactly as declared. See [Errors and recovery](../errors.md) for retries and pending outcomes.

### 400 response

**Content type:** ` application/json `

**Type:** [Error](schemas/error.md)

Required means required **within its containing object**, when that object is present. Union/conditional constraints remain defined by the JSON Schema below.


| Field | Type | Presence | Description / constraints |
| --- | --- | --- | --- |
| ` error ` | object | Required | Additional properties allowed |
| ` error.code ` | string | Required | — |
| ` error.details ` | object | Optional | Additional properties allowed |
| ` error.message ` | string | Required | — |


**JSON Schema**
```json
{
  "$ref": "#/components/schemas/Error"
}
```

### 2XX response

**Content type:** ` application/json `

**Type:** [Call](schemas/call.md)

Required means required **within its containing object**, when that object is present. Union/conditional constraints remain defined by the JSON Schema below.


| Field | Type | Presence | Description / constraints |
| --- | --- | --- | --- |
| ` agent ` | anyOf: string; null | Optional | — |
| ` answered_at ` | anyOf: string (date-time); null | Optional | — |
| ` billable_seconds ` | anyOf: integer; null | Optional | — |
| ` billing_status ` | ` pending `, ` settled ` | Optional | — |
| ` cost_micros ` | anyOf: string; null | Optional | — |
| ` direction ` | ` inbound `, ` outbound ` | Optional | — |
| ` duration_seconds ` | anyOf: integer; null | Optional | — |
| ` ended_at ` | anyOf: string (date-time); null | Optional | — |
| ` from_e164 ` | string | Optional | pattern: ` ^\+[1-9][0-9]{6,14}$ ` |
| ` id ` | string | Required | Public call_… reference (not a UUID). pattern: ` ^call_[0-7][0-9A-HJKMNP-TV-Z]{25}$ ` |
| ` line ` | string | Optional | pattern: ` ^\+[1-9][0-9]{6,14}$ ` |
| ` line_id ` | anyOf: string; null | Optional | — |
| ` max_duration_seconds ` | anyOf: integer; null | Optional | — |
| ` rating ` | anyOf: object; null | Optional | Paid accounts only: the price book's route class (e.g. us-ordinary, us-high-cost) and version its charge used; null until charged |
| ` recording ` | anyOf: [RecordingSummary](schemas/recordingsummary.md); null | Optional | — |
| ` records ` | object | Optional | Additional properties allowed |
| ` records.outcome ` | anyOf: string; null | Optional | — |
| ` records.recording ` | boolean | Optional | — |
| ` records.transcript ` | boolean | Optional | — |
| ` speech ` | object | Optional | ORDan voice on the call: the characters spoken; a preview org also sees its provider cost (a paid account's charge is in cost_micros). Additional properties allowed |
| ` speech.chars ` | integer | Optional | minimum: ` 0 ` |
| ` speech.cost_micros ` | anyOf: string; null | Optional | — |
| ` status ` | ` authorized `, ` routing `, ` ringing `, ` connected `, ` completed `, ` failed `, ` busy `, ` no_answer `, ` canceled ` | Required | — |
| ` to_e164 ` | string | Optional | pattern: ` ^\+[1-9][0-9]{6,14}$ ` |
| ` transcription_failed_at ` | anyOf: string (date-time); null | Optional | Set when the carrier refused to start transcribing the call: ORDan voice can speak on it, but the transcript stays empty, and a paid account is not charged for its ORDan voice |
| ` transfer ` | string | Optional | Public xfer_… reference (not a UUID). pattern: ` ^xfer_[0-7][0-9A-HJKMNP-TV-Z]{25}$ ` |
| ` transfers ` | Array of [Transfer](schemas/transfer.md) | Optional | — |
| ` voice_mode ` | ` none `, ` ordan ` | Optional | — |
| ` voice_opened_at ` | anyOf: string (date-time); null | Optional | — |
| ` voice_settings ` | anyOf: object; null | Optional | — |


**JSON Schema**
```json
{
  "$ref": "#/components/schemas/Call"
}
```

**Illustrative response template**
Placeholder values show the shape, not a live response. Nullable costs remain null rather than implying zero usage.

```json
{
  "agent": null,
  "answered_at": null,
  "billable_seconds": null,
  "billing_status": "pending",
  "cost_micros": null,
  "direction": "inbound",
  "duration_seconds": null,
  "ended_at": null,
  "from_e164": "+12125550101",
  "id": "<id>",
  "line": "+12125550101",
  "line_id": null,
  "max_duration_seconds": null,
  "rating": null,
  "recording": null,
  "records": {
    "outcome": null,
    "recording": false,
    "transcript": false
  },
  "speech": {
    "chars": 0,
    "cost_micros": null
  },
  "status": "authorized",
  "to_e164": "+12125550101",
  "transcription_failed_at": null,
  "transfer": "<transfer>",
  "transfers": [
    {
      "answered_at": null,
      "billing_status": "pending",
      "call": "<call>",
      "cost_micros": null,
      "ended_at": null,
      "id": "<id>",
      "max_duration_seconds": 0,
      "status": "creating",
      "to": "+12125550101"
    }
  ],
  "voice_mode": "none",
  "voice_opened_at": null,
  "voice_settings": null
}
```

### default response

**Content type:** ` application/json `

**Type:** [Error](schemas/error.md)

Required means required **within its containing object**, when that object is present. Union/conditional constraints remain defined by the JSON Schema below.


| Field | Type | Presence | Description / constraints |
| --- | --- | --- | --- |
| ` error ` | object | Required | Additional properties allowed |
| ` error.code ` | string | Required | — |
| ` error.details ` | object | Optional | Additional properties allowed |
| ` error.message ` | string | Required | — |


**JSON Schema**
```json
{
  "$ref": "#/components/schemas/Error"
}
```
