[{"data":1,"prerenderedAt":7},["ShallowReactive",2],{"docs-calls\u002Frecord":3,"docs-tabs-calls\u002Frecord":6},{"content":4,"lastmod":5},"## Call recording\n\n`POST \u002Fv1\u002Fcalls\u002F:callId\u002Frecord`\n\nAttaches an audio recording to a completed external telephony call. Pass the file in the request body as base64 or as a link to a public HTTPS URL.\n\n## Parameters\n\n| Parameter | Type | Required | Description |\n|----------|-----|-------|----------|\n| `callId` (path) | string | yes | ID of a completed call — the `data.callId` field from [call registration](\u002Fdocs\u002Ftelephony\u002Fcrm\u002Fregister). To complete a call, use [`POST \u002Fv1\u002Fcalls\u002F:callId\u002Ffinish`](\u002Fdocs\u002Ftelephony\u002Fcrm\u002Ffinish) |\n\n## Request fields (body)\n\nPass either `fileContent` or `recordUrl`, not both.\n\n| Field | Type | Required | Description |\n|------|-----|-------|----------|\n| `fileContent` | string | no | Audio file in base64. Required if `recordUrl` is not passed. Up to 2 MiB after decoding; an empty file is not accepted |\n| `recordUrl` | string | no | Public HTTPS URL of the recording file. Required if `fileContent` is not passed. The URL must not contain a login, password or access tokens and must not point to an internal network |\n| `fileName` | string | no | File name with a lowercase `.mp3` or `.wav` extension. Required together with `fileContent`. With `recordUrl`, the last segment of the URL path is used by default |\n\n## Examples\n\n### curl — personal key\n\n```bash\ncurl -X POST 'https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalls\u002FexternalCall.00000000000000000000000000000000.1700000000\u002Frecord' \\\n  -H 'X-Api-Key: YOUR_API_KEY' \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"fileName\":\"record.wav\",\"fileContent\":\"UklGRjQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YRAAAAAAAAAAAAAAAAAAAAAAAAAA\"}'\n```\n\n### curl — OAuth application\n\n```bash\ncurl -X POST 'https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalls\u002FexternalCall.00000000000000000000000000000000.1700000000\u002Frecord' \\\n  -H 'X-Api-Key: YOUR_APP_KEY' \\\n  -H 'Authorization: Bearer USER_SESSION_TOKEN' \\\n  -H 'Content-Type: application\u002Fjson' \\\n  -d '{\"fileName\":\"record.wav\",\"fileContent\":\"UklGRjQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YRAAAAAAAAAAAAAAAAAAAAAAAAAA\"}'\n```\n\n### JavaScript — personal key\n\n```javascript\nconst callId = 'externalCall.00000000000000000000000000000000.1700000000';\nconst response = await fetch(`https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalls\u002F${callId}\u002Frecord`, {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_API_KEY',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    fileName: 'record.wav',\n    fileContent: 'UklGRjQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YRAAAAAAAAAAAAAAAAAAAAAAAAAA',\n  }),\n});\nconst { data } = await response.json();\nconsole.log(data.fileId);\n```\n\n### JavaScript — OAuth application\n\n```javascript\nconst callId = 'externalCall.00000000000000000000000000000000.1700000000';\nconst response = await fetch(`https:\u002F\u002Fvibecode.bitrix24.com\u002Fv1\u002Fcalls\u002F${callId}\u002Frecord`, {\n  method: 'POST',\n  headers: {\n    'X-Api-Key': 'YOUR_APP_KEY',\n    'Authorization': 'Bearer USER_SESSION_TOKEN',\n    'Content-Type': 'application\u002Fjson',\n  },\n  body: JSON.stringify({\n    fileName: 'record.wav',\n    fileContent: 'UklGRjQAAABXQVZFZm10IBAAAAABAAEAQB8AAIA+AAACABAAZGF0YRAAAAAAAAAAAAAAAAAAAAAAAAAA',\n  }),\n});\nconst { data } = await response.json();\nconsole.log(data.fileId);\n```\n\n## Response fields\n\n| Field | Type | Description |\n|------|-----|----------|\n| `success` | boolean | `true` on success |\n| `data` | object | Operation result |\n| `data.fileId` | integer | ID of the recording file attached to the call |\n\n## Response example\n\n```json\n{\n  \"success\": true,\n  \"data\": {\n    \"fileId\": 10209\n  }\n}\n```\n\n## Error response example\n\n422 — a call with this `callId` is not found or has not ended yet:\n\n```json\n{\n  \"success\": false,\n  \"error\": {\n    \"code\": \"BITRIX_ERROR\",\n    \"message\": \"Call is not found in the statistic table. Looks like it is not finished yet.\"\n  }\n}\n```\n\n## Errors\n\n| HTTP | Code | Description |\n|------|-----|----------|\n| 400 | `INVALID_PARAMS` | The request body is not a JSON object |\n| 400 | `INVALID_PARAMS` | Both `recordUrl` and `fileContent` are passed, or `recordUrl` is empty |\n| 400 | `INVALID_PARAMS` | `recordUrl` is not an HTTPS URL, contains credentials or points to an internal network |\n| 400 | `INVALID_PARAMS` | `fileContent` is not base64 or the file is empty |\n| 400 | `INVALID_PARAMS` | `fileName` does not end in `.mp3` or `.wav` |\n| 400 | `INVALID_PARAMS` | Bitrix24 rejected the parameter value |\n| 400 | `MISSING_REQUIRED_FIELDS` | `recordUrl` is not passed, and `fileContent` or `fileName` is missing |\n| 401 | `MISSING_API_KEY` | The `X-Api-Key` header is missing |\n| 401 | `INVALID_API_KEY` | The key is not found or has been revoked |\n| 401 | `TOKEN_MISSING` | The key has no portal tokens. An OAuth application key requires the `Authorization: Bearer` header |\n| 403 | `SCOPE_DENIED` | The key has no `telephony` scope |\n| 403 | `WRITE_BLOCKED_READONLY_KEY` | The key is read-only |\n| 403 | `BITRIX_ACCESS_DENIED` | Bitrix24 denied access. For possible causes, see [Authorization, keys and permissions](\u002Fdocs\u002Ferrors\u002Fauth#bitrix_access_denied-403) |\n| 404 | `ENTITY_NOT_FOUND` | Bitrix24 reported that the object was not found |\n| 413 | `PAYLOAD_TOO_LARGE` | The file exceeds 2 MiB after decoding, or the request body exceeds 3 MiB |\n| 422 | `BITRIX_ERROR` | A call with this `callId` is not found or has not ended yet |\n| 422 | `BITRIX_ERROR` | Bitrix24 did not return the recording file ID |\n| 429 | `LARGE_BODY_BACKEND_BUSY` | The server is processing other requests with a large body. Retry the request after a delay |\n| 429 | `RATE_LIMITED` | Request rate exceeded on the Bitrix24 side |\n| 502 | `BITRIX_UNAVAILABLE` | Bitrix24 is unavailable |\n| 503 | `BITRIX_TIMEOUT` | Bitrix24 did not respond in time |\n\nThe full list of common API errors — [Error codes](\u002Fdocs\u002Ferrors).\n\n## See also\n\n- [Calls](\u002Fdocs\u002Fcalls)\n- [Register a call](\u002Fdocs\u002Ftelephony\u002Fcrm\u002Fregister)\n- [CRM cards by phone](\u002Fdocs\u002Fcalls\u002Fcrm-entities)\n- [Error codes](\u002Fdocs\u002Ferrors)\n","2026-10-20",{},1795415350741]