Documents
Files attached to contacts, debts and receipts.
GET
/api/v1/documentsPermission: documents:read
Query parameters
contactIdstringmax. 128 charactersdebtIdstringmax. 128 characterslimitintegerNumber of entries (1–100)1–100 · Default: 25cursorstring`nextCursor` of the previous pagemax. 500 characters
Response 200
object"list"requireddataArray<Document>requiredidstringrequiredobject"document"requiredcontactIdstring | nullrequireddebtIdstring | nullrequiredfileNamestringrequiredtypestringrequireddescriptionstringrequiredcontentTypestring | nullrequiredsizeinteger | nullrequired-9007199254740991–9007199254740991downloadPathstringrequiredGET path for downloading (with Authorization header)createdAtstring (date-time)requiredTimestamp (ISO 8601)
hasMorebooleanrequirednextCursorstring | nullrequired
curl 'https://www.debt-flow.io/api/v1/documents' \
-H "Authorization: Bearer $DEBTFLOW_API_KEY"Response 200
{
"object": "list",
"data": [
{
"id": "string",
"object": "document",
"contactId": "string",
"debtId": "string",
"fileName": "string",
"type": "string",
"description": "string",
"contentType": "string",
"size": 0,
"downloadPath": "string",
"createdAt": "2026-11-01T09:30:00.000Z"
}
],
"hasMore": false,
"nextCursor": "string"
}POST
/api/v1/documentsmultipart/form-data with field file (PDF, JPG, PNG, WebP, DOC, DOCX; max. 10 MB) and optionally contactId, debtId, type, description.
Permission: documents:write
Body (multipart/form-data)
filestring (binary)requiredapplication/pdf, image/jpeg, image/png, image/webp, application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document, max. 10240 KBcontactIdstringmax. 128 charactersdebtIdstringmax. 128 characterstypeenumValues: invoice, contract, payment_reminder, reminder, final_reminder, enforcement_order, court_order, bailiff_notice, correspondence, other · Default: "other"descriptionstringmax. 500 characters
Response 201 · Document
idstringrequiredobject"document"requiredcontactIdstring | nullrequireddebtIdstring | nullrequiredfileNamestringrequiredtypestringrequireddescriptionstringrequiredcontentTypestring | nullrequiredsizeinteger | nullrequired-9007199254740991–9007199254740991downloadPathstringrequiredGET path for downloading (with Authorization header)createdAtstring (date-time)requiredTimestamp (ISO 8601)
curl
curl -X POST 'https://www.debt-flow.io/api/v1/documents' \
-H "Authorization: Bearer $DEBTFLOW_API_KEY" \
-F 'file=@file' \
-F 'contactId=…' \
-F 'debtId=…' \
-F 'type=…' \
-F 'description=…'Response 201
{
"id": "string",
"object": "document",
"contactId": "string",
"debtId": "string",
"fileName": "string",
"type": "string",
"description": "string",
"contentType": "string",
"size": 0,
"downloadPath": "string",
"createdAt": "2026-11-01T09:30:00.000Z"
}GET
/api/v1/documents/{id}Metadata; the file itself is available at downloadPath.
Permission: documents:read
Path parameters
idstringrequiredResource IDmax. 128 characters
Response 200 · Document
idstringrequiredobject"document"requiredcontactIdstring | nullrequireddebtIdstring | nullrequiredfileNamestringrequiredtypestringrequireddescriptionstringrequiredcontentTypestring | nullrequiredsizeinteger | nullrequired-9007199254740991–9007199254740991downloadPathstringrequiredGET path for downloading (with Authorization header)createdAtstring (date-time)requiredTimestamp (ISO 8601)
curl 'https://www.debt-flow.io/api/v1/documents/ID' \
-H "Authorization: Bearer $DEBTFLOW_API_KEY"Response 200
{
"id": "string",
"object": "document",
"contactId": "string",
"debtId": "string",
"fileName": "string",
"type": "string",
"description": "string",
"contentType": "string",
"size": 0,
"downloadPath": "string",
"createdAt": "2026-11-01T09:30:00.000Z"
}PATCH
/api/v1/documents/{id}Permission: documents:write
Path parameters
idstringrequiredResource IDmax. 128 characters
Body (JSON) · DocumentUpdate
typeenumValues: invoice, contract, payment_reminder, reminder, final_reminder, enforcement_order, court_order, bailiff_notice, correspondence, otherdescriptionstringmax. 500 charactersfileNamestringmax. 200 characters
Response 200 · Document
idstringrequiredobject"document"requiredcontactIdstring | nullrequireddebtIdstring | nullrequiredfileNamestringrequiredtypestringrequireddescriptionstringrequiredcontentTypestring | nullrequiredsizeinteger | nullrequired-9007199254740991–9007199254740991downloadPathstringrequiredGET path for downloading (with Authorization header)createdAtstring (date-time)requiredTimestamp (ISO 8601)
curl -X PATCH 'https://www.debt-flow.io/api/v1/documents/ID' \
-H "Authorization: Bearer $DEBTFLOW_API_KEY" \
-H 'Content-Type: application/json' \
-d '{
"type": "invoice",
"description": "string",
"fileName": "string"
}'Response 200
{
"id": "string",
"object": "document",
"contactId": "string",
"debtId": "string",
"fileName": "string",
"type": "string",
"description": "string",
"contentType": "string",
"size": 0,
"downloadPath": "string",
"createdAt": "2026-11-01T09:30:00.000Z"
}DELETE
/api/v1/documents/{id}GET
/api/v1/documents/{id}/fileReturns the file (including older files uploaded in the dashboard or in the app) from DebtFlow storage.
Permission: documents:read
Path parameters
idstringrequiredResource IDmax. 128 characters
Response 200
File (application/octet-stream).
curl 'https://www.debt-flow.io/api/v1/documents/ID/file' \
-H "Authorization: Bearer $DEBTFLOW_API_KEY"