POST /upload and AfterCare immediately queues it for processing. The endpoint accepts a single PDF, JPEG, or PNG file up to 15 MB and returns a documentId you use to track progress and retrieve the finished recovery plan.
Request
file
required
The discharge document to process. Must be a PDF, JPEG, or PNG file no larger than 15 MB. Send this field as
multipart/form-data.If you upload a document that AfterCare has already seen, it will not reprocess it. Instead, the server returns
200 OK with the existing documentId and its current status. Use the returned processUrl to check status — if processing already finished, the SSE stream will replay the full event history and close immediately.Response — 202 Accepted
A fresh upload returns202 Accepted with the following fields.
string (UUID)
The unique identifier for this document. Store it — you need it to stream progress, retrieve medications, and list appointments.
string
Always
"processing" on a 202 response. Connect to processUrl to receive stage-by-stage progress.string
The relative path of the SSE stream for this document, e.g.
/process/550e8400-e29b-41d4-a716-446655440000. Connect to this URL immediately after uploading to receive real-time pipeline progress.string
The relative path where you can retrieve the original uploaded file, e.g.
/documents/550e8400-e29b-41d4-a716-446655440000/original. Useful for displaying or cross-referencing source text alongside extracted data.boolean
When
true, AfterCare is operating in safe-development mode and no real AI calls were made. The returned plan is a static fixture. In production this is always false.boolean
false on a 202 response — this is a newly accepted document. When the same document has been uploaded before, the server returns 200 OK with deduplicated: true and the existing documentId instead of queuing a new pipeline run.