---
title: "Answer a ringing or early-media inbound SIP leg (asynchronous)"
method: POST
path: "/legs/{id}/answer"
tags: ["Legs"]
---

# Answer a ringing or early-media inbound SIP leg (asynchronous)

`POST /legs/{id}/answer`

Signals the inbound-call goroutine to send 200 OK. The HTTP call returns 202 immediately; the actual SIP 200 OK is sent in the background, and the leg's transition is observed via `leg.connected`. Pre-condition failures (wrong state, unknown codec) still return 4xx synchronously.

## Request body

- AnswerLegRequest
  - `speech_detection` boolean — If true, emit speaking.started and speaking.stopped events for this leg. If false, suppress them. Omit to use the server default (SPEECH_DETECTION_ENABLED env var, default false).
  - `codec` 'PCMU' | 'PCMA' | 'G722' | 'opus' | 'AMR-WB' | 'AMR-NB' — Explicit codec for the answer SDP. Must appear in the remote offer's offered_codecs list. Omit to use the server's default preference order.

## Response `202`

Answer queued

## Other responses

- `400` — Not a SIP inbound leg, invalid body, or codec not in offer
- `404` — Leg not found
- `409` — Leg is not in ringing or early_media state

## Changes

- **2026-06-15** `41268cfc6143` — 1 info
  - added the new `AMR-NB` enum value to the request property `codec`
- **2026-06-12** `dee6706a7730` — 1 info
  - added the new `AMR-WB` enum value to the request property `codec`
- **2026-05-08** `20957badcc90` — 1 breaking, 2 info
  - removed the success response with the status `200`
  - added the new optional request property `codec`
  - added the success response with the status `202`
- **2026-04-22** `1794fb134332` — 1 info
  - added optional request body
- **2026-03-26** `d09c97c6ca8c` — 2 breaking, 1 info
  - removed the request body
  - removed the success response with the status `202`
  - added the success response with the status `200`

[Change history](https://skmtc.dev/voiceblender/apis/voiceblender-api/changes/legs/:id/answer/post.md)

---

[API](https://skmtc.dev/voiceblender/apis/voiceblender-api.md) · [All operations](https://skmtc.dev/voiceblender/apis/voiceblender-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/voiceblender/voiceblender-api/revisions/c1929616bee3/schema)
