All endpoints require an API key sent in the request header:
X-API-KEY: <your_api_key>
If a rate limit is exceeded, the API responds with 429 Too Many Requests and a retry message.
POST /api/v1/pcr/upload/
Upload one or more documents for asynchronous summarization. You can include any number of extra form fields—they will be stored in metadata, and if you provide a webhook_url, they will all be forwarded in that webhook.
Patient auto-lookup/creation: If you supply email, first_name, and last_name in your form fields, the API will:
first_name/last_name or swapped).email, first_name, and last_name will also be reflected on your account in the Global Scribe app.Content-Type: multipart/form-datafiles: array of file uploadsextra_information (optional): additional context or noteswebhook_url (optional): URL to receive a POST when processing completesmetadata.emailfirst_namelast_name200 OK{
"message": "Files uploaded successfully; processing is underway.",
"upload_id": "684a9f404c658fc1a0743af9",
"webhook_url": "https://your-hook.example.com/notify",
"extra_information": "Patient Tony Stark, June 2025 notes",
"metadata": {
"unique_identifier": "case-1234",
"foo": "bar",
"email": "tony.stark@example.com",
"first_name": "Tony",
"last_name": "Stark"
}
}
429 Too Many Requests{
"detail": "Rate limit of 10 requests per hour exceeded. Please try again after an hour."
}
POST /api/v1/pcr/upload/text/
Submit plain text for immediate summarization. You can include any extra JSON properties; they will be stored in metadata and forwarded via webhook if you supply one.
Content-Type: application/json
{
"user_input": "Text to be summarized.",
"extra_information": "Optional context or instructions.",
"webhook_url": "https://your-hook.example.com/notify",
"unique_identifier": "note-5678",
"foo": "bar"
}
200 OK{
"response": "Generated summary of the provided text.",
"webhook_url": "https://your-hook.example.com/notify",
"extra_information": "Optional context or instructions.",
"metadata": {
"unique_identifier": "note-5678",
"foo": "bar"
}
}
429 Too Many Requests{
"detail": "Rate limit of 10 requests per hour exceeded. Please try again after an hour."
}
POST /api/v1/pcr/icd10/text
Submit clinical text for ICD-10 generation as an asynchronous job. The API immediately returns a job_id. Poll the job status endpoint to fetch final codes when complete.
Content-Type: application/json
{
"text": "67-year-old male with long-standing hypertension and type 2 diabetes mellitus.",
"webhook_url": "https://your-hook.example.com/notify" // optional
}
202 Accepted{
"job_id": "67f4ea3b8c7b2f64b2f1a3cd",
"status": "queued",
"message": "ICD-10 request accepted; processing has started",
"created_at": "2026-04-21T19:14:02.739182",
"webhook_url": "https://your-hook.example.com/notify"
}
400 Bad Request - Invalid or blank text input503 Service Unavailable - ICD-10 service configuration is missing429 Too Many Requests - Rate limit exceededIf webhook_url is provided, the API sends POST callbacks for:
queued (immediately after acceptance)completed (includes icd10_codes)failed (includes error_code and error_message)GET /api/v1/pcr/icd10/{job_id}
Poll the status of a submitted ICD-10 async job.
| Parameter | Type | Description |
|---|---|---|
job_id | string | ID returned by /api/v1/pcr/icd10/text |
200 OK (Completed){
"job_id": "67f4ea3b8c7b2f64b2f1a3cd",
"status": "completed",
"created_at": "2026-04-21T19:14:02.739182",
"updated_at": "2026-04-21T19:14:13.989100",
"icd10_codes": [
{
"name": "Primary hypertension",
"icd10_code": "I10",
"evidence": "history of high blood pressure"
}
]
}
200 OK (Failed){
"job_id": "67f4ea3b8c7b2f64b2f1a3cd",
"status": "failed",
"created_at": "2026-04-21T19:14:02.739182",
"updated_at": "2026-04-21T19:14:13.989100",
"error_code": "rag_service_error",
"error_message": "ICD-10 upstream service error"
}
400 Bad Request - Invalid job_id format404 Not Found - No ICD-10 job found for the given ID429 Too Many Requests - Rate limit of 5 requests per minute exceededGET /api/v1/pcr/templates/community
List public community templates available for audio-to-note generation. This endpoint returns only the minimal catalog fields: _id, name, and short_description.
| Parameter | Type | Description |
|---|---|---|
skip | integer | Pagination offset (default 0) |
limit | integer | Pagination size (default 20, max 100) |
name | string | Optional case-insensitive filter by template name |
search | string | Optional case-insensitive keyword search over name and short description |
200 OK{
"data": [
{
"_id": "66eb0bfe20db7d898c8e5c4e",
"name": "GENERAL TEMPLATE",
"short_description": "A minimal and versatile template designed for any clinical interview."
}
],
"count": 1
}
POST /api/v1/pcr/audio/notes
Submit an audio file and a required community template_id. The API returns 202 Accepted immediately and processes transcript + note generation in the background.
Content-Type: multipart/form-datafile: required audio file (audio/mpeg, audio/mp3, audio/wav, audio/ogg, audio/flac)template_id: required; must reference a public community templatewebhook_url (optional): URL for queued/completed/failed callbacks202 Accepted{
"job_id": "680a8eb5904f2995138cf6b6",
"status": "queued",
"message": "Audio note request accepted; processing has started",
"created_at": "2026-04-25T10:40:15.947012",
"webhook_url": "https://your-hook.example.com/notify"
}
400 Bad Request - Invalid file type, file too large, or invalid template selection503 Service Unavailable - Transcribe service configuration is missing429 Too Many Requests - Rate limit exceededIf webhook_url is provided, this endpoint sends POST callbacks for:
queuedcompleted (includes transcript and note)failed (includes error_code and error_message)GET /api/v1/pcr/audio/notes/{job_id}
Poll the status of a submitted audio-note async job.
200 OK (Completed){
"job_id": "680a8eb5904f2995138cf6b6",
"status": "completed",
"created_at": "2026-04-25T10:40:15.947012",
"updated_at": "2026-04-25T10:41:22.103050",
"transcript": "Patient reports worsening cough over 3 days...",
"note": "Clinical note generated using selected community template..."
}
200 OK (Failed){
"job_id": "680a8eb5904f2995138cf6b6",
"status": "failed",
"created_at": "2026-04-25T10:40:15.947012",
"updated_at": "2026-04-25T10:41:22.103050",
"error_code": "transcription_failed",
"error_message": "Failed to transcribe audio"
}
400 Bad Request - Invalid job_id format404 Not Found - No audio-note job found for the given ID429 Too Many Requests - Rate limit of 5 requests per minute exceededGET /api/v1/pcr/{upload_id}
Check the processing status of a previously uploaded batch. The response includes your original extra_information, stored metadata, and the patient lookup fields if provided.
| Parameter | Type | Description |
|---|---|---|
upload_id | string | ID returned when files were uploaded |
200 OK{
"status": "completed", // or "queued", "processing", "failed"
"response": "Summarized content of the uploaded files...",
"extra_information": "Patient Tony Stark, June 2025 notes",
"metadata": {
"unique_identifier": "case-1234",
"foo": "bar",
"email": "tony.stark@example.com",
"first_name": "Tony",
"last_name": "Stark"
}
}
400 Bad Request – Invalid upload_id format404 Not Found – No upload found for the given ID429 Too Many Requests – Rate limit of 5 requests per minute exceeded| Field | Type | Description |
|---|---|---|
message | string | Informational message |
upload_id | string | Identifier for async file uploads |
job_id | string | Identifier for async ICD-10 jobs |
status | string | One of queued, processing, completed, failed |
created_at | string (ISO 8601) | Job creation timestamp |
updated_at | string (ISO 8601) | Most recent job status update timestamp |
response | string | Generated summary text |
icd10_codes | array | Final ICD-10 output for completed ICD-10 jobs |
transcript | string | Generated transcript text for completed audio-note jobs |
note | string | Generated clinical note for completed audio-note jobs |
error_code | string | Sanitized machine-friendly error classification for failed ICD-10 jobs |
error_message | string | Sanitized human-readable error message for failed async jobs |
extra_information | string | Original context or instructions you provided |
webhook_url | string | URL you provided to receive completion callbacks |
metadata | object | All other fields you sent, echoed back and forwarded; if you provided email, first_name, and last_name, those will also appear here and drive patient auto-lookup/creation (and reflect in your Global Scribe app account). |
detail | string | Error or rate-limit detail message |
For API key requests or assistance, please contact contact@sporo.health.