POST
/
documents
curl --request POST \
  --url https://api.usecobalt.com/v1/documents \
  --header 'Content-Type: multipart/form-data' \
  --header 'access_token: <api-key>' \
  --header 'client_id: <api-key>' \
  --header 'client_secret: <api-key>' \
  --form 'folder_name=<string>' \
  --form 'patient_mrn=<string>'
{
  "success": true,
  "message": "<string>",
  "document_id": "<string>"
}

Documents are processed asynchronously. You’ll receive a webhook notification when the upload is complete or if there was an error.

Example Request

curl -X POST https://api.usecobalt.com/v1/documents \
-H 'Content-Type: multipart/form-data' \
-H 'client_id: ci_live_198908HJDKJSH98789OHKJL' \
-H 'client_secret: cs_live_9827hofdsklOYYHJLJh' \
-H 'access_token: 493JKLHIU98789hLKH9HHJH' \
-F 'folder_name=MedicalRecords' \
-F 'patient_mrn=123456' \
-F 'document=@/path/to/document.pdf'

Example Response

{
    "success": true,
    "message": "Document uploaded successfully. It will be processed soon.",
    "document_id": "9988776655443322"
}

Example Success Webhook

{
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "object": "event",
    "created": "2023-10-01T12:34:56Z",
    "type": "document.uploaded",
    "data": {
        "document_id": "9988776655443322",
        "patient_mrn": "123456",
        "folder_name": "MedicalRecords"
    }
}

Example Failure Webhook

{
    "id": "123e4567-e89b-12d3-a456-426614174001",
    "object": "event",
    "created": "2023-10-01T12:34:56Z",
    "type": "document.upload_failed",
    "data": {
        "document_id": "9988776655443322",
        "patient_mrn": "123456",
        "folder_name": "MedicalRecords",
        "failure_reason": "Patient not found. Please check the patient MRN and try again."
    }
}

Authorizations

client_id
string
header
required
client_secret
string
header
required
access_token
string
header
required

Body

multipart/form-data

Response

200 - application/json

Successful response

The response is of type object.