# Record a Call

Record a call. This command will record the call until one of the conditions apply:

* the `endKey` DTMF is detected.
* silence is detected for more than the duration defined in `timeout`.
* duration exceeds the `maxLength`.

This command doesn't record the whole call. This command is useful to record messages in a typical voicemail use case.

## Record call

> Record a channel call

```json
{"openapi":"3.0.3","info":{"title":"Channels","version":"v1"},"tags":[],"servers":[{"url":"https://api.bird.com","description":"Production API"}],"security":[{"accessKey":[]}],"components":{"securitySchemes":{"accessKey":{"description":"Uses the Authorization header: 'AccessKey ' followed by your access key token","scheme":"AccessKey","type":"http"}},"schemas":{"Record":{"type":"object","title":"Record one Call","additionalProperties":false,"properties":{"endKey":{"$ref":"#/components/schemas/Key"},"maxLength":{"type":"integer"},"timeout":{"type":"integer"},"beep":{"type":"boolean"},"transcribe":{"type":"boolean"},"transcribeLocale":{"type":"string","format":"locale-bcp47","default":"en-US","enum":["ar-AE","ar-SA","zh-CN","zh-TW","da-DK","nl-NL","en-AU","en-GB","en-IN","en-IE","en-NZ","en-AB","en-ZA","en-US","en-WL","fr-FR","fr-CA","fa-IR","de-DE","de-CH","he-IL","hi-IN","id-ID","it-IT","ja-JP","ko-KR","ms-MY","pt-PT","pt-BR","ru-RU","es-ES","es-US","sv-SE","ta-IN","te-IN","th-TH","tr-TR","vi-VN"]}}},"Key":{"type":"string","enum":["0","1","2","3","4","5","6","7","8","9","*","#"]},"CallCommandRecordResponse":{"type":"object","title":"ChannelCallCommandRecord","additionalProperties":false,"properties":{"command":{"$ref":"#/components/schemas/CallCommandResponse"},"recordingId":{"type":"string","format":"uuid"}}},"CallCommandResponse":{"type":"object","title":"CallCommandResponse","additionalProperties":false,"properties":{"id":{"type":"string","format":"uuid"},"callId":{"type":"string","format":"uuid"},"callFlowId":{"nullable":true,"type":"string","format":"uuid"},"status":{"type":"string"},"command":{"type":"string"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/CallFlowCommandCondition"}}}},"CallFlowCommandCondition":{"type":"object","title":"Conditions for command","additionalProperties":false,"properties":{"variable":{"type":"string","enum":["keys","speech"]},"operator":{"type":"string","enum":["eq","ne","==","!=","contains"]},"value":{"type":"string"}}},"error.detailed":{"additionalProperties":false,"description":"An error returned from the API that includes additional details about the error. The `details` property can contain any additional information about the error that may be helpful for debugging or understanding the error.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":true,"description":"Any additional information about the error that may be helpful for debugging or understanding the error.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"DetailedError","type":"object"},"error.validation":{"additionalProperties":false,"description":"A validation error returned from the API. The `details` map keys are JSON paths\npointing into the request body / parameters; values are arrays of human-readable\nmessages describing each problem with that path.\n","properties":{"code":{"description":"A unique code that identifies the error. This code can be used to programmatically identify the error.","minLength":3,"type":"string"},"details":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"description":"Per-field validation messages keyed by JSON path.","type":"object"},"message":{"description":"A human-readable message that describes the error.","minLength":1,"type":"string"}},"required":["code","message"],"title":"ValidationError","type":"object"}},"responses":{"requestError":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.detailed"}}},"description":"An error"},"validationError":{"$ref":"#/components/responses/error.response.invalid_request"},"error.response.invalid_request":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/error.validation"}}},"description":"The request contains invalid parameters or body fields."}}},"paths":{"/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/record":{"post":{"summary":"Record call","operationId":"recordChannelCall","description":"Record a channel call","tags":["channel_call_command"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Record"}}}},"responses":{"202":{"description":"Call Command Record was accepted for processing","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallCommandRecordResponse"}}}},"400":{"$ref":"#/components/responses/requestError"},"404":{"$ref":"#/components/responses/requestError"},"422":{"$ref":"#/components/responses/validationError"}}}}}}
```

### Example 1: Record one inbound / outbound call

{% tabs %}
{% tab title="Request Headers" %}

```
curl -X POST "https://api.bird.com/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/record" \
     -H "Authorization: AccessKey YOUR_SECRET_TOKEN"
```

{% endtab %}

{% tab title="Request Body" %}

```
{
  "beep": true,
  "endKey": "#",
  "maxLength": 60,
  "timeout": 3,
  "transcribe": true,
  "transcribeLocale": "en-US"
}
```

{% endtab %}

{% tab title="Response" %}

```
{
  "command": {
    "id": "067f0409-fe5a-466a-bdc1-dccc76b02376",
    "callId": "d34d4ebc-dd67-405e-95ef-ca72485a2975",
    "command": "record",
    "status": "accepted"
  },
  "recordingId": "61396ce4-2e1a-404e-a550-5863b594f387"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bird.com/api/voice-api/voice-calls-api/record-a-call.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
