Recordings
หน่วยข้อมูลหลักของระบบ — บันทึกการสนทนาหนึ่งสาย พร้อม transcript + summary
GET /recordings
List recording แบบ paginated
Scopes: view_recording_all · view_recording_self
| Param | Type | Note |
|---|---|---|
limit | int 1-200 | default 20 |
offset | int | default 0 |
direction | "in" | "out" | optional |
sourceProvider | threecx | dtac | upload | optional |
callDateFrom | ISO 8601 datetime | optional |
callDateTo | ISO 8601 datetime | optional |
customerPhone | string (exact match) | optional |
search | string (ilike dataId) | optional |
curl "https://phone.mcloud.co.th/api/v1/recordings?limit=10&direction=in" \
-H "Authorization: Bearer crk_..."
{
"items": [
{
"id": "0192b9...",
"dataId": "rec_2026_05_20_001",
"callAt": "2026-05-20T08:14:00+07:00",
"direction": "in",
"customerPhone": "+66812345678",
"tag": "normal",
"score": 86,
"processingStatus": "completed",
"audioUrl": "/api/recording/audio/0192b9...",
"transcriptUrl": "/api/recording/transcript/0192b9...",
"summaryUrl": "/api/recording/summary/0192b9..."
}
],
"total": 1284,
"limit": 10,
"offset": 0
}
POST /recordings
Ingest metadata + presigned upload (optional) — idempotent ด้วย dataId
Scopes: manage_call_recording
| Param | Type | Note |
|---|---|---|
dataId | string unique | required |
callAt | ISO 8601 | required |
direction | "in" | "out" | required |
customerPhone | string | optional |
callcenterNumber | string | optional |
callcenterName | string | optional |
tag | enum | optional |
score | number 0-100 | optional |
note | string | optional |
contentType | string (MIME) | default audio/wav |
audioPresignedUploadUrl | boolean | ขอ presigned URL? |
curl -X POST https://phone.mcloud.co.th/api/v1/recordings \
-H "Authorization: Bearer crk_..." \
-H "Content-Type: application/json" \
-d '{
"dataId": "rec_2026_05_20_001",
"callAt": "2026-05-20T08:14:00+07:00",
"direction": "in",
"audioPresignedUploadUrl": true
}'
GET /recordings/{id}
ดึง recording เดียว
Scopes: view_recording_all · view_recording_self
PATCH /recordings/{id}
Review — score / tag / comment / note / link
Scopes: manage_recording_review · manage_recording_link
| Param | Type | Note |
|---|---|---|
score | number 0-100 | optional |
tag | normal | short | wrong_or_spam | other | optional |
reviewComment | string | optional |
note | string | optional |
linkedUserId | uuid | null | requires manage_recording_link |
DELETE /recordings/{id}
Soft-delete (ย้ายไป trash, เก็บ 30 วัน)
Scopes: manage_call_recording
POST /recordings/{id}/reextract
สั่ง AI ทำงานใหม่ (ถอดเสียง + สรุป)
Scopes: manage_call_recording
curl -X POST https://phone.mcloud.co.th/api/v1/recordings/$ID/reextract \
-H "Authorization: Bearer crk_..."
