> For the complete documentation index, see [llms.txt](https://api-docs.vbee.vn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://api-docs.vbee.vn/vbee-api/speech-to-text/callback-api.md).

# Callback API

Callback API áp dụng với Batch API và Realtime API (optional)

Khi request thành công, hệ thống sẽ gửi đến webhookURL một POST như sau

**URL**: callback url truyền lên khi gọi API create text

**Method**: POST

| **Tham số**   | **Kiểu dữ liệu** | **Mô tả**                                                         |
| ------------- | ---------------- | ----------------------------------------------------------------- |
| transcriptId  | String           | ID transcript                                                     |
| status        | String           | Trạng thái của API                                                |
| transcript    | String           | Văn bản nhận dạng ghép từ tất cả các utterances                   |
| utterances    | String           | Danh sách từng đoạn nhận dạng gồm text, startTime, endTime (giây) |
| audioDuration | String           | Thời lượng WAV                                                    |
| errorMessage  | String           | Mã lỗi khi status = FAILED                                        |

```
// Payload webhook (POST về webhookUrl):

{
  "transcriptId": "job-uuid-456",
  "status": "COMPLETED",
  "transcript": "nội dung nhận dạng",
  "utterances": [...],
  "audioDuration": 8
}

// Khi status = FAILED

{
  "transcriptId": "job-uuid-456",
  "status": "FAILED",
  "errorMessage": "Provider reported failure",
  "audioDuration": 8
}
```
