Before you start
You’ll need:- An API key (see Authentication if you don’t have one yet).
- The ID of an existing claim to attach the document to (you get this back when you create a claim, it looks like
clm_3Ccox6eQUYYeg9RIo6qXCwGN3nQ). - The file itself, in one of the accepted formats: PDF, JPEG, PNG, or WEBP, and no bigger than 10 MB.
Step 1: Tell Opereit you’re about to upload a file
- Hang onto
id. You’ll pass it back in step 3 to confirm the upload. content_typehas to be one ofapplication/pdf,image/jpeg,image/png, orimage/webp. Anything else gets rejected with a400before anything is registered.
Step 2: Upload the file
metadata.upload_url is a link that’s ready to accept the raw file. Upload directly to it with an HTTP PUT:
Content-Type you sent in step 1. There’s nothing to parse from the response here, a successful PUT just means the upload went through.
Step 3: Confirm the upload
Once the file is uploaded, tell Opereit it’s there:"status": "failed" and a reason instead, rather than silently being left out:
attached is just the count of documents with "status": "confirmed", it’s there so you don’t have to count the array yourself if you don’t need the per-document detail.
There’s currently no endpoint to list the documents already attached to a claim. Keep track of the
ids you get back from step 1 on your side if you need to reference them again later.Document statuses
A document moves through exactly two states, tracked in thestatus field you get back in step 1:
Confirm results
Thestatus inside each entry of documents[] in step 3’s response is a different, smaller vocabulary, it’s the outcome of that specific confirm attempt, not the document’s lifecycle state:
Failure reasons
reason is only present when status is failed.
Handling errors
Both endpoints use the same error envelope as the rest of the API:
A rejected content type on a document you’re actively confirming (step 3) doesn’t come back as one of these top-level errors, it shows up as
"status": "failed", "reason": "unsupported_content_type" for that specific document instead, see Failure reasons above.