cURL
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>' \ --form document=@example-file
{ "success": true, "message": "<string>", "document_id": "<string>" }
Upload a document to a patient’s chart.
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'
{ "success": true, "message": "Document uploaded successfully. It will be processed soon.", "document_id": "9988776655443322" }
{ "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" } }
{ "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." } }
The name of the folder where the document will be stored.
The medical record number of the patient.
The document file to be uploaded. Only PDF, JPEG, and PNG files are allowed. Maximum file size is 5MB.
Successful response