Upload a support document from the HIS for a HIS-inbound pre-appointment
POST/v1/checkin/appointments/his-inbound/:externalAppointmentId/documents
Uploads a support document, sent by the HIS itself, as multipart/form-data with two parts: a binary file part and a request_data part (Content-Type application/json) carrying the metadata. The pre-appointment is resolved by (provider from the token, external_appointment_id); only pre-appointments created by the HIS inbound integration (source HIS_INBOUND), in a non-terminal status (PENDING/CONFIRMED), accept this upload. provider_product_codes selects the target charges: empty/absent completes the PENDING placeholders of all charges of the pre-appointment for the given support_file_code (case-insensitive); a non-empty list restricts completion to the matching charges (codes without a corresponding charge are silently ignored). To replace a document that is already received, send explicit provider_product_codes: without them there is nothing pending to complete and the request fails with 422. The replacement is resolved per charge: PENDING placeholders are completed first; otherwise the most recently received document of the charge is replaced. If the support document's keep_support_file_history setting is false (default), the file is overwritten on the same record (same id); if true, the previous document stays active and a new record (new id) is added. The setting is copied to each document when its placeholder is created, so a change applies only to documents created afterwards. The response contains only the resulting document and the AI validation restarts. The previous file is not removed from storage. A channel can only replace documents it uploaded itself (403 otherwise). The file is uploaded to storage only once and shared across every completed placeholder. The resulting document is persisted with source=HIS_INBOUND and can no longer be deleted or cleared from the web endpoints (403). Returns 201 with one array element per completed document. Supported file types: PDF, JPEG, and PNG. Maximum file size: 45MB. Requires valid OAuth2 authentication.
Request
Responses
- 201
- 400
- 401
- 403
- 404
- 409
- 413
- 422
- 502
Document(s) uploaded successfully: one array element per completed placeholder
Bad Request: the pre-appointment was not created by the HIS inbound integration (source is not HIS_INBOUND); or the token is authorized for multiple providers and the X-Active-Provider header is missing or invalid.
Unauthorized: missing or invalid Bearer token
Forbidden: your credentials are not authorised for this operation, or the document to replace was uploaded through the other channel
Pre-appointment not found for the given external_appointment_id and provider
Conflict: the pre-appointment is in a terminal status (COMPLETED or CANCELLED)
Uploaded file exceeds the maximum allowed size (45MB). Depending on the environment, the platform gateway may answer 500 without a message instead of 413
Request validation failed, unsupported file type (MIME type not in whitelist, missing support_file_code, invalid pattern, or missing file), or there is nothing to complete or replace for the given support_file_code and provider_product_codes (no PENDING placeholder and, with explicit provider_product_codes, no received document)
Bad Gateway: document storage service is unavailable