Batch Create Debts
Debts API
Batch Create Debts
Create multiple debts in a single request for efficient bulk imports
POST
Batch Create Debts
Overview
This endpoint allows you to create multiple debt records in a single API call. It’s designed for bulk imports and can process up to 1,000 debts per request. Each debt is validated individually, and the endpoint returns both successful creations and any failures.Authentication
Requires a valid OAuth 2.0 access token with thedebts:write scope.
Request
Bearer token for authentication
Must be
application/jsonRequest Body
Custom name for this import batch (optional). Appears in the dashboard import filter. Default: “API Batch - DD/MM/YYYY HH:mm”
Batch-level opt-in for expensive destinations (DOM-TOM, Maghreb, etc.). When set to
true, all debts in the batch with expensive destination phone numbers will be accepted. Can also be set per-debt inside the debts array. If not set, debts with expensive destination phones will fail validation with a specific error.Enables automatic civility/title completion for created debts where
civility is missing and firstname is present. Default: true. Charged at 1 credit per 100 debts needing civility detection, rounded up.Enables email deliverability validation for created debts in the batch. Default:
false. Emails are deduplicated before validation. Charged at 1 credit per 5 billable validation results. Invalid addresses are saved but marked as suppressed to prevent sending.Array of debt objects to create. Maximum 1,000 debts per request. Each debt object has the same structure as the Create Debt endpoint.
Example Request
Response
Always
false for successful batch requests (even if some individual debts failed)Success message
Batch operation results
Success Response
Partial Success Response
Error Responses
Validation Rules
Validation Update (2025): Phone number validation is now strictly enforced to match the web interface behavior. Phone numbers are validated using international standards (libphonenumber library). If you were previously sending phone numbers without proper formatting or French overseas mobile numbers (069X prefix), these will now be rejected. You can now use
email as an alternative to phone.Batch Limits
Batch Limits
- Maximum 1,000 debts per batch request
- Each debt is validated individually
- Failed debts don’t stop processing of successful ones
Individual Debt Validation
Individual Debt Validation
Each debt is validated using the same rules as the web import interface:Required Fields:
firstname: Debtor’s first name (required)lastname: Debtor’s last name (required)amount: Must be a positive number (> 0)currency: Required, must be valid ISO 4217 code
phoneORemail: At least one must be validphone: Must be a valid phone number. International format recommended (e.g.,+33123456789)- Unsupported: French overseas mobile numbers with 069X prefix (e.g.,
0690123456) - Supported: French mainland, most international numbers, French overseas fixed lines
- Unsupported: French overseas mobile numbers with 069X prefix (e.g.,
email: Must be a valid email format
- Date fields: Must be in YYYY-MM-DD format if provided
phone: Validated and normalized to E.164 format. French numbers without country code are automatically normalized. Invalid phones are rejected with specific error messages.- All other fields are optional
- Empty rows are automatically skipped
- Instruction rows (starting with
*, containing “champs obligatoires”, etc.) are skipped
Expensive Destinations
Expensive Destinations
Phone numbers in certain regions cost significantly more credits for AI calls. Debts with expensive destination phones will fail validation unless you opt in:
Failed debts will include the destination details and cost in the
- Batch-level: Set
"accept_expensive_destination": trueat the top level (next todebtsarray) to accept all expensive destinations in the batch - Per-debt: Set
"accept_expensive_destination": trueon individual debt objects
| Destination | Credits per call | Multiplier |
|---|---|---|
| France (mainland) | 25 | 1.0x |
| EU countries | 30 | 1.2x |
| DOM-TOM (Réunion, Guadeloupe, Martinique, etc.) | 100 | 4.0x |
| Maghreb (Morocco, Algeria, Tunisia) | 125 | 5.0x |
errors field.Timeline Processing
Timeline Processing
timeline_id: Must be valid and belong to your companytimeline_start_mode: Applies individually to each debt- Invalid timeline IDs are silently ignored per debt
- Public holidays and excluded days are respected for
next_daymode
Rate Limiting
This endpoint is subject to rate limiting. See the Rate Limits documentation for details. Rate Limit: 50 requests per hour (batch operations) Note: Each batch request can contain up to 1,000 debts, making this much more efficient than individual creation.Best Practices
Use temp_id
Always provide a
temp_id for each debt to easily match responses to your original data.Handle Partial Success
Always check
created, failed, and skipped arrays. Process successful debts, identify why failures occurred using the detailed errors field, and retry or fix validation issues.Batch Size Strategy
While you can send 1,000 debts, consider batches of 100-500 for better error handling and progress tracking.
Validate Before Sending
Pre-validate data on your side to minimize API failures. Key checks: phone format (avoid 069X French overseas mobile), email format, positive amounts, required fields.
Use Detailed Error Messages
Each failed debt includes the original data and specific field-level errors. Use this to build error reports for manual correction or automated retry logic.
Timeline Assignment
Assign the same
timeline_id to all debts in a batch for consistent AI-powered collection workflows.Monitor Progress
Use the
summary object to track overall success rate and identify issues quickly.Performance Considerations
- All debts in a batch are processed in a single database transaction
- Failed validations don’t affect successful creations
- Expected processing time: ~100-500ms for 100 debts
- Timeline calculations (next_day mode) add minimal overhead
After Batch Creation
Once debts are created via batch:- Store Debt IDs: Map returned
debt_idvalues to yourtemp_idorinternal_id - Process Failures: Review the
failedarray for validation errors. Each failed item includes:- Original data (
datafield) to identify which row failed - Detailed field-level errors (
errorsfield) to understand why - Common fixes: Update invalid phone numbers (avoid 069X), fix email formats, ensure required fields
- Original data (
- Handle Skipped Rows: Check the
skippedarray for empty or instruction rows that were automatically filtered - Monitor Workflows: If timelines are assigned, collection actions will start automatically for successfully created debts
- Track Progress: Use the statistics endpoints to monitor collection progress
Related Endpoints
- Create Debt - Create a single debt
- List Debts - Get all debts for your company
- Update Debt - Modify individual debts
- Get Debt - Retrieve specific debt details