API Reference
Complete reference for all Cleavr Connect API endpoints.
Full Specification: Download the OpenAPI Spec or view in Swagger UI for complete details.
Base URL
https://api.cleavr.frAuthentication
All API requests require Bearer token authentication.
Authorization: Bearer {access_token}Cleavr-Version: 2025-08-28Content-Type: application/jsonEndpoints
Authentication
OAuth Authorization
GET /oauth/authorizeStart the OAuth flow to authorize your platform.
Parameters:
client_id- Your platform identifierredirect_uri- Callback URLresponse_type- Must becodescope- Space-separated permissionsstate- CSRF protection token
Exchange Authorization Code
POST /oauth/tokenExchange authorization code for access token.
Body:
grant_type-authorization_codeorrefresh_tokencode- Authorization code (if grant_type=authorization_code)refresh_token- Refresh token (if grant_type=refresh_token)client_id- Your platform identifierclient_secret- Your platform secret
Users
Create User
POST /v1/usersCreate a new user account for recovery services.
Get Onboarding Status
GET /v1/users/{id}/onboarding-statusCheck user's KYB verification status and capabilities.
Get Requirements
GET /v1/users/{id}/requirementsList missing documents or information needed for onboarding.
Receivables
Submit Receivable
POST /v1/receivablesSubmit an unpaid invoice for recovery.
Submit via OCR
POST /v1/receivables/ocrExtract invoice data from PDF and create receivable.
Body: Multipart form with PDF file
Get Receivable Status
GET /v1/receivables/{id}Retrieve current status and recovery progress.
Cancel Recovery
POST /v1/receivables/{id}/cancelStop recovery process for a receivable.
Submit Dispute Evidence
POST /v1/receivables/{id}/evidenceUpload documents to resolve a dispute.
Commission
Calculate Fees
POST /v1/commission/calculateCalculate commission for a given amount and debt age.
Body:
{ "amount": 5000.00, "days_overdue": 60}Get Rate Table
GET /v1/commission/ratesRetrieve current commission rate structure.
Webhooks
Register Endpoint
POST /v1/webhooksConfigure a webhook endpoint to receive events.
Body:
{ "url": "https://yourapp.com/webhooks/cleavr", "events": ["receivable.*", "user.onboarding.completed"], "description": "Production webhook"}Rotate Secret
POST /v1/webhooks/{id}/rotate-secretGenerate new webhook signing secret for security.
Reports
Get Statistics
GET /v1/reports/statsRetrieve recovery performance metrics.
Query Parameters:
from- Start date (ISO 8601)to- End date (ISO 8601)user_id- Filter by specific user (optional)
Response Format
All API responses follow this structure:
Success Response
{ "data": { // Response data }, "meta": { "request_id": "req_xxxxx", "timestamp": "2025-08-28T10:00:00Z" }}Error Response
{ "error": { "code": "MISSING_EMAIL_CONTACT", "message": "At least one contact with email is required", "details": { "field": "debtor.contacts", "received": [] } }, "meta": { "request_id": "req_xxxxx", "timestamp": "2025-08-28T10:00:00Z" }}Rate Limits
| Tier | Requests/Minute | Requests/Hour |
|---|---|---|
| Standard | 100 | 3,000 |
| Receivables | 50/min | - |
| OCR | 10/min | - |
Rate limit headers are included in every response:
X-RateLimit-Limit: 100X-RateLimit-Remaining: 95X-RateLimit-Reset: 1640995200