# Backend endpoints (upload service → your backend) Your backend implements two endpoints. The upload service calls them. --- ## POST /update (progress, multiple times per job) **Headers:** `Content-Type: application/json`; optional `Authorization: ` **Body:** ```json { "doc_id": "string", "finished": 1, "total": 4, "message": "string", "project_id": "string" } ``` - `doc_id` – document/job id - `finished` – current step (1–4) - `total` – always 4 - `message` – e.g. "Downloading...", "Parsing document...", "Upload complete" - `project_id` – optional, if client sent it **Respond:** 200 --- ## POST /finish (once per job) **Headers:** `Content-Type: application/json`; optional `Authorization: ` **Body (success):** ```json { "status": "complete", "doc_id": "string", "project_id": "string" } ``` **Body (failure):** ```json { "status": "failure", "doc_id": "string", "message": "string", "project_id": "string" } ``` - `doc_id` – same as the doc_id used to start the job - `project_id` – optional **Respond:** 200