For AI agents: markdown of this page — /docs-content-en/chats/files/transcribe.md documentation index — /llms.txt
Transcribe an audio file
POST /v1/chats/files/:fileId/transcribe
Starts speech-to-text transcription of an audio or video file attached to a message — for example, a voice message or a video note. Calls the v2 messenger method im.v2.Disk.File.transcribe. The transcription is done by the AI of your Bitrix24 account (CoPilot): the call queues a job and returns its state right away, and the text appears once the job finishes.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
fileId (path) |
number | yes | Chat file ID. Get it: files[].id in Load a chat or in the message history in the v2 mode |
Query parameters are not accepted and are rejected with 400 INVALID_PARAMS.
Request fields (body)
| Field | Type | Required | Description |
|---|---|---|---|
messageId |
number | yes | ID of the message the file is attached to |
Other body fields are rejected with 400 INVALID_PARAMS.
Examples
curl — personal key
curl -X POST https://vibecode.bitrix24.com/v1/chats/files/7701/transcribe \
-H "X-Api-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"messageId": 1003}'
curl — OAuth application
curl -X POST https://vibecode.bitrix24.com/v1/chats/files/7701/transcribe \
-H "X-Api-Key: YOUR_APP_KEY" \
-H "Authorization: Bearer USER_SESSION_TOKEN" \
-H "Content-Type: application/json" \
-d '{"messageId": 1003}'
JavaScript — personal key
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/files/7701/transcribe', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({ messageId: 1003 }),
})
const { success, data } = await res.json()
console.log('State:', data.status, data.transcriptText)
JavaScript — OAuth application
const res = await fetch('https://vibecode.bitrix24.com/v1/chats/files/7701/transcribe', {
method: 'POST',
headers: {
'X-Api-Key': 'YOUR_APP_KEY',
'Authorization': 'Bearer USER_SESSION_TOKEN',
'Content-Type': 'application/json',
},
body: JSON.stringify({ messageId: 1003 }),
})
const { success, data } = await res.json()
console.log('State:', data.status, data.transcriptText)
Response fields
| Field | Type | Description |
|---|---|---|
success |
boolean | Always true on success |
data.fileId |
number | File ID |
data.status |
string | Transcription state: Pending — the job is running, Success — the text is ready, Error — the transcription failed |
data.transcriptText |
string|null | The transcript text; null while there is no text |
Response example
{
"success": true,
"data": {
"fileId": 7701,
"status": "Pending",
"transcriptText": null
}
}
Error response example
422 — the file is neither audio nor video:
{
"success": false,
"error": {
"code": "BITRIX_ERROR",
"message": "FILE_NOT_TRANSCRIBABLE",
"b24Code": "FILE_NOT_TRANSCRIBABLE"
}
}
Errors
| HTTP | Code | Description |
|---|---|---|
| 400 | INVALID_PARAMS |
fileId is not a positive integer, messageId is missing or is not a positive integer, or another body field or a query parameter was sent. Checked before any call to Bitrix24 |
| 404 | ENTITY_NOT_FOUND |
Bitrix24 returned "not found" — no such file or message; the portal code is in error.b24Code |
| 422 | BITRIX_ERROR |
Bitrix24 refused; the portal code is in error.b24Code: FILE_NOT_TRANSCRIBABLE — the file is neither audio nor video, FILE_SIZE_EXCEEDED — the file is larger than 25 MB, TRANSCRIPTION_NOT_ACTIVE — transcription is turned off on the portal, LIMIT_IS_EXCEEDED_BAAS — the AI request limit is used up, TRANSCRIPTION_SERVICE_ERROR — the transcription service failed, FILE_ACCESS_ERROR — no access to the file |
| 403 | SCOPE_DENIED |
The API key does not have the im scope |
| 403 | WRITE_BLOCKED_READONLY_KEY |
The key is read-only — the call starts an AI job and may make the key owner a chat member |
| 401 | TOKEN_MISSING |
The API key has no Bitrix24 tokens configured |
The full list of general API errors — Errors.
Known specifics
The call invokes the AI of your Bitrix24 account. Transcription counts against the account's AI request limit. A repeated call for the same file does not queue a new job: while the transcription runs, it returns Pending, afterwards Success with the text.
The file and the message go together. Bitrix24 checks the file by fileId and the message by messageId; pass the message the file is attached to.
The call may make you a member. If the message's chat allows auto-join — for example, a comment chat, a collab or a task chat — the call adds the current user as a member, just as opening the chat in the Bitrix24 interface does.