Skip to main content
POST
/
patients
/
{patient_id}
/
pdf
Upload Patient PDF
curl --request POST \
  --url https://backend.claros.health/patients/{patient_id}/pdf/ \
  --header 'Content-Type: multipart/form-data' \
  --header 'X-API-Key: <api-key>' \
  --form file='@example-file' \
  --form 'filename=<string>'
{
  "id": "<string>",
  "url": "<string>",
  "filename": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "patient_id": 123
}
This endpoint requires authentication. Include your API key in the request headers as X-API-Key.

Description

Uploads a PDF file directly to a specific patient. This endpoint is used when you already know which patient the PDF belongs to and want to upload it directly to their record.

Path Parameters

patient_id
integer
required
The ID of the patient to upload the PDF for

Request Body

Response

id
string
The unique identifier of the uploaded PDF
url
string
The URL where the PDF can be accessed
filename
string
The name of the uploaded file
created_at
string
The timestamp when the file was uploaded
patient_id
integer
The ID of the patient the PDF was uploaded for

Example Response

{
  "id": "pdf_123456",
  "url": "https://storage.example.com/pdfs/patient_123456.pdf",
  "filename": "medical_record.pdf",
  "created_at": "2024-03-20T10:30:00Z",
  "patient_id": 123
}

Error Responses

400
object
Invalid request. The file must be a valid PDF document and the filename must include the .pdf extension.
401
object
Authentication required. Make sure you’ve included a valid API key in the request headers.
403
object
Unauthorized access. You can only upload PDFs for patients associated with your account.
404
object
Patient not found. The specified patient ID does not exist.
413
object
File too large. The PDF file exceeds the maximum allowed size.

Authorizations

X-API-Key
string
header
required

Path Parameters

patient_id
integer
required

The ID of the patient to upload the PDF for

Body

multipart/form-data
file
file
required

The PDF file to upload

filename
string
required

The name to give the uploaded file

Response

PDF uploaded successfully

id
string

The unique identifier of the uploaded PDF

url
string

The URL where the PDF can be accessed

filename
string

The name of the uploaded file

created_at
string<date-time>

The timestamp when the file was uploaded

patient_id
integer

The ID of the patient the PDF was uploaded for