Upload documents onto a case
curl --request POST \
--url https://app.sahlfinancial.com/api/v1/cases/{case_id}/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form files=@example-file \
--form 'document_type_hint=<string>' \
--form 'ocr_language=<string>'const form = new FormData();
form.append('files', '<string>');
form.append('document_type_hint', '<string>');
form.append('ocr_language', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.sahlfinancial.com/api/v1/cases/{case_id}/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.sahlfinancial.com/api/v1/cases/{case_id}/documents"
files = { "files": ("example-file", open("example-file", "rb")) }
payload = {
"document_type_hint": "<string>",
"ocr_language": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text){
"case_id": "7e3b9a14-2d6c-4c85-b1f0-6a8d4e2c9b37",
"documents": [
{
"filename": "payslip-test.pdf",
"document_id": "a8f1c3e5-6b2d-4974-8e0a-1d5c7b9f3e26",
"job_id": "3c9d7b1f-5e2a-4a86-9f4c-8b0e6d2a1c75",
"status": "accepted"
},
{
"filename": "broken.bin",
"status": "failed",
"error": "Unsupported file type 'application/octet-stream'."
}
]
}{
"detail": "At most 10 files per request"
}{
"detail": "Invalid or expired token"
}{
"detail": "Insufficient permissions"
}{
"detail": "Case not found"
}{
"detail": [
{
"type": "missing",
"loc": [
"body",
"bank_code"
],
"msg": "Field required",
"input": {}
}
]
}{
"code": "rate_limit_exceeded",
"message": "Too many requests. Please slow down."
}Upload documents onto a case
Who can call it: tenant_admin, tenant_reviewer, tenant_api_manager or platform_admin. A tenant_viewer is read-only and gets 403.
multipart/form-data, 1 to 10 files. Each file is accepted or failed on its own: the response lists a status per file, so a 202 does not mean every file was accepted. Needs a verified email when the workspace requires it.
Auth: dashboard session (Authorization: Bearer <access token>). Not available with a partner API key.
Upload documents onto a case
curl --request POST \
--url https://app.sahlfinancial.com/api/v1/cases/{case_id}/documents \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--form files=@example-file \
--form 'document_type_hint=<string>' \
--form 'ocr_language=<string>'const form = new FormData();
form.append('files', '<string>');
form.append('document_type_hint', '<string>');
form.append('ocr_language', '<string>');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
fetch('https://app.sahlfinancial.com/api/v1/cases/{case_id}/documents', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.sahlfinancial.com/api/v1/cases/{case_id}/documents"
files = { "files": ("example-file", open("example-file", "rb")) }
payload = {
"document_type_hint": "<string>",
"ocr_language": "<string>"
}
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, data=payload, files=files, headers=headers)
print(response.text){
"case_id": "7e3b9a14-2d6c-4c85-b1f0-6a8d4e2c9b37",
"documents": [
{
"filename": "payslip-test.pdf",
"document_id": "a8f1c3e5-6b2d-4974-8e0a-1d5c7b9f3e26",
"job_id": "3c9d7b1f-5e2a-4a86-9f4c-8b0e6d2a1c75",
"status": "accepted"
},
{
"filename": "broken.bin",
"status": "failed",
"error": "Unsupported file type 'application/octet-stream'."
}
]
}{
"detail": "At most 10 files per request"
}{
"detail": "Invalid or expired token"
}{
"detail": "Insufficient permissions"
}{
"detail": "Case not found"
}{
"detail": [
{
"type": "missing",
"loc": [
"body",
"bank_code"
],
"msg": "Field required",
"input": {}
}
]
}{
"code": "rate_limit_exceeded",
"message": "Too many requests. Please slow down."
}Authorizations
The access token (JWT) of a signed-in console user, from POST /v1/auth/login. It lasts 30 minutes. It is not an API key: a partner API key is refused here. There is no cookie.
Path Parameters
Body
multipart/form-data
Response
Accepted
The response is of type Response Upload Case Documents Api V1 Cases Case Id Documents Post · object.