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. The transcription is done by CoPilot, the artificial intelligence (AI) of your Bitrix24 account. The call queues a job, and the text appears once the job finishes.

Parameters

Parameter Type Required Description
ParameterfileId (path) Typenumber Requiredyes DescriptionChat file ID. Get it: files[].id in Load a chat or in the message history in the v2 mode

Request fields (body)

Field Type Required Description
FieldmessageId Typenumber Requiredyes DescriptionID of the message the file is attached to. Get it: messages[].id in Load a chat or in the message history in the v2 mode
FieldrequestId Typestring Requiredno DescriptionAttempt identifier in UUID format, generated by the app. Sent only together with contentVersion and only when transcription settings were retrieved successfully
FieldcontentVersion Typestring Requiredno DescriptionExpected file version from the file metadata: 1–128 visible ASCII characters, without spaces. Sent only together with requestId

Examples

curl — personal key

Terminal
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

Terminal
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

javascript
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

javascript
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
Fieldsuccess Typeboolean DescriptionAlways true on success
Fielddata.fileId Typenumber DescriptionFile ID
Fielddata.status Typestring DescriptionTranscription state: Pending — the job is running, Success — the text is ready, Error — the transcription failed
Fielddata.transcriptText Typestring|null DescriptionThe transcript text. null while there is no text
Fielddata.chatId Typenumber DescriptionID of the message's chat
Fielddata.messageId Typenumber DescriptionMessage ID
Fielddata.contentVersion Typestring DescriptionFile version from the request
Fielddata.revision Typestring DescriptionJob revision as a decimal string
Fielddata.operationId Typestring DescriptionTranscription job ID
Fielddata.errorCode Typestring|null DescriptionTranscription error code
Fielddata.retryable Typeboolean DescriptionWhether the attempt can be retried
Fielddata.pendingForMs Typenumber|null DescriptionHow many more milliseconds the job stays in the Pending state, from 0 to 300000. null for a final result

The fields from data.chatId to data.pendingForMs are returned only in response to a call with requestId and contentVersion.

Response example

JSON
{
  "success": true,
  "data": {
    "fileId": 7701,
    "status": "Pending",
    "transcriptText": null
  }
}

Error response example

422 — the file is neither audio nor video:

JSON
{
  "success": false,
  "error": {
    "code": "BITRIX_ERROR",
    "message": "FILE_NOT_TRANSCRIBABLE",
    "b24Code": "FILE_NOT_TRANSCRIBABLE"
  }
}

Errors

HTTP Code Description
HTTP400 CodeINVALID_PARAMS DescriptionfileId is not a positive integer, messageId is missing or is not a positive integer, the body is not a JSON object, or an extra body field or a query parameter was sent. Checked before any call to Bitrix24
HTTP400 CodeINVALID_PARAMS DescriptionrequestId is not a UUID, contentVersion is not 1–128 visible ASCII characters, or one of these fields was sent without the other. Checked before any call to Bitrix24
HTTP404 CodeENTITY_NOT_FOUND DescriptionBitrix24 returned a "not found" error. The Bitrix24 code is in error.b24Code
HTTP422 CodeBITRIX_ERROR Descriptionerror.b24Code = 100 — there is no file with this fileId
HTTP422 CodeBITRIX_ERROR Descriptionerror.b24Code = FILE_NOT_TRANSCRIBABLE — the file is neither audio nor video
HTTP422 CodeBITRIX_ERROR Descriptionerror.b24Code = FILE_SIZE_EXCEEDED — the file is larger than 25 MB
HTTP422 CodeBITRIX_ERROR Descriptionerror.b24Code = TRANSCRIPTION_NOT_ACTIVE — transcription is turned off in the Bitrix24 account
HTTP422 CodeBITRIX_ERROR Descriptionerror.b24Code = LIMIT_IS_EXCEEDED_BAAS — the AI request limit is used up
HTTP422 CodeBITRIX_ERROR Descriptionerror.b24Code = TRANSCRIPTION_SERVICE_ERROR — the transcription service failed
HTTP422 CodeBITRIX_ERROR Descriptionerror.b24Code = FILE_ACCESS_ERROR — no access to the file
HTTP422 CodeBITRIX_ERROR DescriptionAnother Bitrix24 refusal. The Bitrix24 code is in error.b24Code
HTTP403 CodeSCOPE_DENIED DescriptionThe API key does not have the im scope
HTTP403 CodeWRITE_BLOCKED_READONLY_KEY DescriptionThe key is read-only. Checked before any call to Bitrix24
HTTP401 CodeTOKEN_MISSING DescriptionThe API key has no Bitrix24 tokens configured

The full list of general API errors — Errors.

Known specifics

Counts against the AI request limit of your Bitrix24 account. 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 call may add the user as a member. If the message's chat can be joined without an invitation — 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.

An attempt with the same requestId. A repeat with the same requestId within 24 hours does not queue a new job. A new manual attempt sends a new UUID: it joins the running job and, once the repeat window expires, may consume the AI request limit again.

No automatic retries. The call reaches Bitrix24 exactly once and does not retry the request on its own.

See also