# Record a call session

Records the call session. If a call is bridged, both audio streams are recorded.

## Record call session

> Record a channel call session

```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 (e.g., 'Authorization: AccessKey AbCdEfGhIjKlMnOpQrStUvWxYzAbCdEfGhIj')","scheme":"AccessKey","type":"http"}},"schemas":{"RecordCall":{"type":"object","title":"Record Call","additionalProperties":false,"properties":{"maxLength":{"type":"integer"},"stereo":{"type":"boolean"}}},"CallCommandRecordResponse":{"type":"object","title":"ChannelCallCommandRecord","additionalProperties":false,"properties":{"command":{"$ref":"#/components/schemas/CallCommandResponse"},"recordingId":{"$ref":"#/components/schemas/Id-2"}}},"CallCommandResponse":{"type":"object","title":"CallCommandResponse","additionalProperties":false,"properties":{"id":{"$ref":"#/components/schemas/Id-2"},"callId":{"$ref":"#/components/schemas/Id-2"},"callFlowId":{"nullable":true,"$ref":"#/components/schemas/Id-2"},"status":{"type":"string"},"command":{"type":"string"},"conditions":{"type":"array","items":{"$ref":"#/components/schemas/CallFlowCommandCondition"}}}},"Id-2":{"type":"string","format":"uuid"},"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"}}},"RequestError":{"type":"object","properties":{"code":{"type":"string","description":"A unique code that identifies the error. This code can be used to programmatically identify the error.\n"},"message":{"type":"string","description":"A human-readable message that describes the error. An example is 'The requested resource does not exist: channel not found'.\n"}},"required":["code","message"]},"ValidationError":{"type":"object","properties":{"code":{"type":"string","description":"A unique code that identifies the error. This code can be used to programmatically identify the error.\n"},"message":{"type":"string","description":"A human-readable message that describes the error. An example is 'The requested resource does not exist: channel not found'.\n"},"details":{"type":"object","description":"Additional details about the error. This object can contain any additional information that may be useful for debugging.\n","additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["code","message"]}},"responses":{"requestError":{"description":"The request did not pass validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestError"}}}},"validationError":{"description":"The request did not pass validation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidationError"}}}}}},"paths":{"/workspaces/{workspaceId}/channels/{channelId}/calls/{callId}/recordings":{"post":{"summary":"Record call session","operationId":"recordCallChannelCall","description":"Record a channel call session","tags":["channel_call_command"],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecordCall"}}}},"responses":{"202":{"description":"Call Command RecordCall 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"}}}}}}
```

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

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

{% endtab %}

{% tab title="Request Body" %}

```
{
  "maxLength": 0,
  "stereo": true
}
```

{% endtab %}

{% tab title="Response" %}

```
{
  "command": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "callId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "callFlowId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "status": "string",
    "command": "string"
  },
  "recordingId": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
```

{% endtab %}
{% endtabs %}
