Recordings

บันทึกการสนทนา + transcript + summary

Recordings

หน่วยข้อมูลหลักของระบบ — บันทึกการสนทนาหนึ่งสาย พร้อม transcript + summary

GET /recordings

List recording แบบ paginated

Scopes: view_recording_all · view_recording_self

ParamTypeNote
limitint 1-200default 20
offsetintdefault 0
direction"in" | "out"optional
sourceProviderthreecx | dtac | uploadoptional
callDateFromISO 8601 datetimeoptional
callDateToISO 8601 datetimeoptional
customerPhonestring (exact match)optional
searchstring (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

ParamTypeNote
dataIdstring uniquerequired
callAtISO 8601required
direction"in" | "out"required
customerPhonestringoptional
callcenterNumberstringoptional
callcenterNamestringoptional
tagenumoptional
scorenumber 0-100optional
notestringoptional
contentTypestring (MIME)default audio/wav
audioPresignedUploadUrlbooleanขอ 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

ParamTypeNote
scorenumber 0-100optional
tagnormal | short | wrong_or_spam | otheroptional
reviewCommentstringoptional
notestringoptional
linkedUserIduuid | nullrequires 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_..."
เอกสาร API