Skip to main content

Upload a support document

This guide covers completing the document placeholders on a pre-appointment.

Prerequisites

  • A pre-appointment id (from HIS inbound or a manual create).
  • Credentials enabled for uploading pre-appointment documents.
  • A file to upload: PDF, JPEG or PNG, up to 25 MB.

Step 1 — Upload the file

The request is multipart/form-data with two parts: the binary file and a JSON request_data part.

curl -X POST https://sandbox.osigu.com/pre-attendance-api/v1/checkin/appointments/$ID/documents \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-F 'file=@medical-order.pdf;type=application/pdf' \
-F 'request_data={"support_file_code":"CPF","provider_product_codes":["PROC001"]};type=application/json'
  • support_file_code — which required document this is (case-insensitive match against the placeholders).
  • provider_product_codes — which charges to complete. Omit or leave empty to complete that support for all charges of the appointment; provide codes to restrict it.

On success you get 201 Created with one array element per completed placeholder. The file is stored once and shared across all placeholders it completes.

Step 2 — List the documents

curl https://sandbox.osigu.com/pre-attendance-api/v1/checkin/appointments/$ID/documents \
-H "Authorization: Bearer $ACCESS_TOKEN"

Returns every enabled document — including still-PENDING placeholders (with a null download URL) — each with a presigned URL and the associated charge. Presigned URLs expire, so re-list to refresh them.

Step 3 — Delete or clear (manual documents only)

  • Delete a manually uploaded document (soft-delete):

    curl -X DELETE https://sandbox.osigu.com/pre-attendance-api/v1/checkin/appointments/$ID/documents/$DOC_ID \
    -H "Authorization: Bearer $ACCESS_TOKEN"
  • Clear it back to PENDING (keeps the placeholder, wipes the file):

    curl -X POST https://sandbox.osigu.com/pre-attendance-api/v1/checkin/appointments/$ID/documents/$DOC_ID/clear \
    -H "Authorization: Bearer $ACCESS_TOKEN"

Both return 204 No Content. Neither removes the file from storage (it may be shared). Documents from the HIS cannot be deleted or cleared — those return 403.

Troubleshooting

SymptomCauseFix
422 on uploadNo PENDING placeholder matches the support_file_code + provider_product_codes, or unsupported MIME typeCheck the configured supports for the charge; ensure the file is really PDF/JPEG/PNG
413 on uploadFile over 25 MBCompress or split the file
403 on delete/clearThe document came from the HISOnly MANUAL documents are mutable
404 on uploadAppointment not found or not yoursCheck the id and that it belongs to your provider

Next steps