# Original filename is automatically preserved
curl -X POST \
'https://service.incaseof.law/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/documents' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-F 'file=@/path/to/contract.pdf' \
-F 'documentType=contract' \
-F 'description=Signed service contract' \
-F 'visibility=creditor'
// Original filename is automatically preserved from fileInput.files[0].name
const formData = new FormData();
formData.append('file', fileInput.files[0]); // filename preserved automatically
formData.append('documentType', 'contract');
formData.append('description', 'Signed service contract');
const response = await fetch(
'https://service.incaseof.law/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/documents',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
},
body: formData
}
);
const result = await response.json();
console.log(result);
import requests
url = "https://service.incaseof.law/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/documents"
# Original filename is automatically preserved
files = {
'file': ('contract.pdf', open('contract.pdf', 'rb'), 'application/pdf')
}
data = {
'documentType': 'contract',
'description': 'Signed service contract'
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
response = requests.post(url, files=files, data=data, headers=headers)
print(response.json())
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"claim_id": "3c90c3cc-0d44-4b50-8888-8dd257363052",
"organization_id": "123e4567-e89b-12d3-a456-426614174000",
"filename": "a1b2c3d4-e5f6-7890-abcd-ef1234567890.pdf",
"original_filename": "contract_signed.pdf",
"file_size": 245678,
"mime_type": "application/pdf",
"document_type": "contract",
"description": "Signed service contract",
"processing_status": "uploaded",
"created_at": "2025-10-08T10:30:00Z"
}
}
{
"success": false,
"message": "Claim not found"
}
{
"success": false,
"message": "Invalid file type. Allowed types: PDF, DOC, DOCX, XLS, XLSX, TXT, XML, PNG, JPG, GIF, WEBP"
}
Documents
Upload Document
Upload additional supporting documents to a claim (PDF, Word, Excel, XML, images, etc.)
POST
/
openapi
/
claims
/
{claim_id}
/
documents
# Original filename is automatically preserved
curl -X POST \
'https://service.incaseof.law/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/documents' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-F 'file=@/path/to/contract.pdf' \
-F 'documentType=contract' \
-F 'description=Signed service contract' \
-F 'visibility=creditor'
// Original filename is automatically preserved from fileInput.files[0].name
const formData = new FormData();
formData.append('file', fileInput.files[0]); // filename preserved automatically
formData.append('documentType', 'contract');
formData.append('description', 'Signed service contract');
const response = await fetch(
'https://service.incaseof.law/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/documents',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
},
body: formData
}
);
const result = await response.json();
console.log(result);
import requests
url = "https://service.incaseof.law/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/documents"
# Original filename is automatically preserved
files = {
'file': ('contract.pdf', open('contract.pdf', 'rb'), 'application/pdf')
}
data = {
'documentType': 'contract',
'description': 'Signed service contract'
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
response = requests.post(url, files=files, data=data, headers=headers)
print(response.json())
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"claim_id": "3c90c3cc-0d44-4b50-8888-8dd257363052",
"organization_id": "123e4567-e89b-12d3-a456-426614174000",
"filename": "a1b2c3d4-e5f6-7890-abcd-ef1234567890.pdf",
"original_filename": "contract_signed.pdf",
"file_size": 245678,
"mime_type": "application/pdf",
"document_type": "contract",
"description": "Signed service contract",
"processing_status": "uploaded",
"created_at": "2025-10-08T10:30:00Z"
}
}
{
"success": false,
"message": "Claim not found"
}
{
"success": false,
"message": "Invalid file type. Allowed types: PDF, DOC, DOCX, XLS, XLSX, TXT, XML, PNG, JPG, GIF, WEBP"
}
Interactive Playground Not Supported: File uploads cannot be tested in this documentation playground due to browser limitations with
multipart/form-data.Please use Postman, Insomnia, or refer to the code examples below to test this endpoint.Overview
Upload supporting documents to a claim. Each claim can have multiple documents attached. The original filename is automatically preserved when using multipart/form-data.Supported File Types
- PDF documents (.pdf)
- Word documents (.doc, .docx)
- Excel spreadsheets (.xls, .xlsx)
- Text files (.txt)
- Images (.png, .jpg, .jpeg, .gif, .webp)
File Size Limit
Maximum file size: 50MBUpload Method
This endpoint only supports multipart/form-data uploads. The original filename is automatically preserved when using multipart/form-data.Document Processing
Documents uploaded via the Open API are stored only and are not processed by OCR. They are attached to the claim for reference purposes.Who sees the document
visibility: creditor(default) — the creditor organisation sees the document in its customer portal.visibility: partner_only— only your partner integration and the incaseof.law team see it (partner API keys only).- The debtor never sees a document uploaded through the API. Only the incaseof.law team can release a document to the debtor portal.
Authentication
Requires API Token authentication via Bearer token.Request
Multipart/Form-Data Required: This endpoint only accepts multipart/form-data uploads. The original filename is automatically preserved.How to Test: Use Postman or Insomnia with the following setup:
- Set body type to “Multipart Form” or “Form Data”
- Add field
filewith type “File” and select your document (filename is preserved automatically) - Optionally add
documentType,descriptionandvisibilityas text fields — before or after the file
string
required
UUID of the claim to attach the document to
file
required
The document file to upload (binary data)Note: This field is not testable in the playground. Use Postman/Insomnia instead.
string
Type of document being uploaded
invoice- Invoice documentcontract- Contract or agreementcorrespondence- Letters, emails, communicationslegal- Legal documentsgeneral- General documentsadditional_document- Additional supporting documents (default)
string
Optional description or notes about the document
string
default:"creditor"
Who besides the incaseof.law team sees the document
creditor- the creditor organisation (default)partner_only- only your partner integration (partner API keys only)
Response
boolean
Indicates if the upload was successful
object
The uploaded document object
Show Document Properties
Show Document Properties
string
Unique document ID (UUID)
string
Associated claim ID
string
Original filename as uploaded
integer
File size in bytes
string
MIME type of the file
string
Type/category of the document
string
creditor or partner_onlystring
Description or notes (if provided)
string
Processing status:
pending, uploaded, processing, completed, or failedNote: Documents uploaded via Open API are stored only and typically have status uploaded (no OCR processing).string
Timestamp when document was uploaded (ISO 8601)
# Original filename is automatically preserved
curl -X POST \
'https://service.incaseof.law/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/documents' \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-F 'file=@/path/to/contract.pdf' \
-F 'documentType=contract' \
-F 'description=Signed service contract' \
-F 'visibility=creditor'
// Original filename is automatically preserved from fileInput.files[0].name
const formData = new FormData();
formData.append('file', fileInput.files[0]); // filename preserved automatically
formData.append('documentType', 'contract');
formData.append('description', 'Signed service contract');
const response = await fetch(
'https://service.incaseof.law/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/documents',
{
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN'
},
body: formData
}
);
const result = await response.json();
console.log(result);
import requests
url = "https://service.incaseof.law/openapi/claims/3c90c3cc-0d44-4b50-8888-8dd257363052/documents"
# Original filename is automatically preserved
files = {
'file': ('contract.pdf', open('contract.pdf', 'rb'), 'application/pdf')
}
data = {
'documentType': 'contract',
'description': 'Signed service contract'
}
headers = {
'Authorization': 'Bearer YOUR_API_TOKEN'
}
response = requests.post(url, files=files, data=data, headers=headers)
print(response.json())
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"claim_id": "3c90c3cc-0d44-4b50-8888-8dd257363052",
"organization_id": "123e4567-e89b-12d3-a456-426614174000",
"filename": "a1b2c3d4-e5f6-7890-abcd-ef1234567890.pdf",
"original_filename": "contract_signed.pdf",
"file_size": 245678,
"mime_type": "application/pdf",
"document_type": "contract",
"description": "Signed service contract",
"processing_status": "uploaded",
"created_at": "2025-10-08T10:30:00Z"
}
}
{
"success": false,
"message": "Claim not found"
}
{
"success": false,
"message": "Invalid file type. Allowed types: PDF, DOC, DOCX, XLS, XLSX, TXT, XML, PNG, JPG, GIF, WEBP"
}
Notes
- Multipart/form-data only: This endpoint only accepts multipart/form-data uploads. Raw binary uploads are not supported.
- Filename preservation: The original filename is automatically preserved when using multipart/form-data
- Multiple documents: Multiple documents can be uploaded to the same claim by calling this endpoint multiple times
- Storage: Documents are stored securely in Supabase Storage
- No processing: Documents uploaded via the Open API are stored only and are not processed by OCR. They are attached to the claim for reference purposes
- File types: Supported file types include PDF, Word (.doc, .docx), Excel (.xls, .xlsx), text files (.txt), and images (.png, .jpg, .jpeg, .gif, .webp)