const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_name: '<string>'})
};
fetch('https://api.opereit.ai/v1/claims/{id}/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"claim_id": "<string>",
"name": "<string>",
"type": "<string>",
"status": "PENDING_UPLOAD",
"uploaded_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"organization_id": "<string>",
"metadata": {
"upload_url": "<string>"
}
}{
"statusCode": 400,
"statusReasonCode": "UNSUPPORTED_DOCUMENT_CONTENT_TYPE",
"error": "Unsupported content type: text/plain. Expected pdf, jpeg, or png."
}{
"statusCode": 401,
"statusReasonCode": "AUTHENTICATION_REQUIRED",
"error": "Authentication required"
}{
"statusCode": 404,
"statusReasonCode": "CLAIM_NOT_FOUND",
"error": "Claim not found"
}{
"statusCode": 500,
"statusReasonCode": "INTERNAL_ERROR",
"error": "Internal server error"
}Initiate document upload
Start uploading a supporting document (e.g. proof of damage, an invoice) for an existing claim. This doesn’t upload the file itself — it registers the document and gives you back a URL to upload the file to. See Uploading a document for an existing claim.
const options = {
method: 'POST',
headers: {Authorization: 'Basic <encoded-value>', 'Content-Type': 'application/json'},
body: JSON.stringify({file_name: '<string>'})
};
fetch('https://api.opereit.ai/v1/claims/{id}/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"id": "<string>",
"claim_id": "<string>",
"name": "<string>",
"type": "<string>",
"status": "PENDING_UPLOAD",
"uploaded_by": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"organization_id": "<string>",
"metadata": {
"upload_url": "<string>"
}
}{
"statusCode": 400,
"statusReasonCode": "UNSUPPORTED_DOCUMENT_CONTENT_TYPE",
"error": "Unsupported content type: text/plain. Expected pdf, jpeg, or png."
}{
"statusCode": 401,
"statusReasonCode": "AUTHENTICATION_REQUIRED",
"error": "Authentication required"
}{
"statusCode": 404,
"statusReasonCode": "CLAIM_NOT_FOUND",
"error": "Claim not found"
}{
"statusCode": 500,
"statusReasonCode": "INTERNAL_ERROR",
"error": "Internal server error"
}Authorizations
HTTP Basic Auth using your API key. Send Authorization: Basic base64(key_id:key_secret).
Path Parameters
ID of the claim.
Body
Response
Document registered. Upload the file to metadata.upload_url, then confirm it.
A claim document, as returned right after you initiate its upload.
Unique document ID. Hold onto this — you need it to confirm the upload.
The file name you sent, truncated to 100 characters if longer (the extension is preserved).
File extension, derived from content_type (e.g. pdf, jpeg, png, webp).
Always PENDING_UPLOAD on this response — it only becomes CONFIRMED once you upload the file and confirm it.
PENDING_UPLOAD, CONFIRMED Always external for documents created through this API.
Show child attributes
Show child attributes