RelayaRelayaDocs
Dashboard

Scribe API

Submit audio recordings for AI transcription and clinical note generation. Scribe converts consultation audio into structured SOAP notes ready for review and approval.

POST/v1/scribe/transcribe

Submit an audio file for transcription and clinical note generation. Accepts MP3, WAV, M4A, and WebM formats up to 100MB. Processing is asynchronous.

Request Body (multipart/form-data)

ParameterTypeRequiredDescription
audiofileRequiredAudio file (MP3, WAV, M4A, WebM; max 100MB)
patient_idstringRequiredPatient UUID for note association
doctor_idstringRequiredAttending doctor UUID
appointment_idstringOptionalAssociated appointment UUID
languagestringOptionalAudio language (default: en-IN). Supports: en, hi, ta, te, kn
note_typestringOptionalNote format: soap, brief, detailed (default: soap)

Example Request

curl -X POST "https://api.relaya.one/v1/scribe/transcribe" \
  -H "Authorization: Bearer rlya_live_abc123" \
  -F "audio=@consultation.mp3" \
  -F "patient_id=pat_4jn7h2" \
  -F "doctor_id=doc_9km3p1" \
  -F "note_type=soap"

Example Response

{
  "data": {
    "id": "note_3kv8m2",
    "status": "processing",
    "patient_id": "pat_4jn7h2",
    "doctor_id": "doc_9km3p1",
    "note_type": "soap",
    "estimated_completion": "2026-07-25T10:02:00Z",
    "created_at": "2026-07-25T10:00:00Z"
  }
}

Poll the note endpoint or configure a webhook for the scribe.note.ready event to be notified when processing is complete.

GET/v1/scribe/notes/:id

Retrieve a generated clinical note with full transcript and structured content.

Example Response

{
  "data": {
    "id": "note_3kv8m2",
    "status": "ready",
    "patient_id": "pat_4jn7h2",
    "doctor_id": "doc_9km3p1",
    "appointment_id": "apt_8xk2m9v3",
    "note_type": "soap",
    "content": {
      "subjective": "Patient reports persistent lower back pain for 2 weeks...",
      "objective": "BP 120/80, Temperature 98.6F, Tenderness in lumbar region...",
      "assessment": "Mechanical lower back pain, likely muscular strain...",
      "plan": "1. Prescribed Ibuprofen 400mg TID x 5 days\n2. Physiotherapy referral..."
    },
    "transcript": "Doctor: Good morning, how are you feeling today?\nPatient: ...",
    "duration_seconds": 480,
    "language": "en-IN",
    "approved": false,
    "created_at": "2026-07-25T10:00:00Z",
    "completed_at": "2026-07-25T10:01:45Z"
  }
}
POST/v1/scribe/notes/:id/approve

Approve a clinical note for inclusion in the patient record. Once approved, the note is immutable and becomes part of the official medical record.

Request Body

ParameterTypeRequiredDescription
editsobjectOptionalOptional edits to note content before approval
approved_bystringRequiredDoctor or staff UUID who reviewed

Example Request

curl -X POST "https://api.relaya.one/v1/scribe/notes/note_3kv8m2/approve" \
  -H "Authorization: Bearer rlya_live_abc123" \
  -H "Content-Type: application/json" \
  -d '{
    "approved_by": "doc_9km3p1"
  }'

Error Codes

CodeStatusDescription
400bad_requestInvalid audio format or missing required fields
401unauthorizedInvalid or missing API key
404not_foundNote not found
409conflictNote already approved (immutable)
413payload_too_largeAudio file exceeds 100MB limit
422processing_failedAudio could not be processed
429rate_limitedToo many requests