Delete multiple clients
Deactivates (marks as deleted) multiple clients in a single operation. **Soft delete:** Clients are not physically deleted, only marked as inactive. **Partial behavior:** Valid clients will be deactivated, failures are reported in the errors array.
API Key authentication.
Format: X-API-Key: beel_sk_<key>
Obtaining Keys: API Keys are managed from the BeeL dashboard
Security: API Keys are secret credentials. Do not share them or store them in source code
In: header
Query Parameters
Comma-separated client IDs
Response Body
application/json
application/json
application/json
application/json
curl -X DELETE "https://app.beel.es/api/v1/clientes/bulk?ids=550e8400-e29b-41d4-a716-446655440000%2C550e8400-e29b-41d4-a716-446655440001"{
"success": true,
"data": {
"total": 10,
"exitosas": 8,
"fallidas": 2,
"desactivados": [
"550e8400-e29b-41d4-a716-446655440000"
],
"errores": [
{
"cliente_id": "550e8400-e29b-41d4-a716-446655440000",
"error": {
"code": "CLIENTE_CON_FACTURAS",
"message": "Cannot deactivate client because it has associated invoices"
}
}
]
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"error": {
"code": "BAD_REQUEST",
"message": "Invalid request"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "123e4567-e89b-12d3-a456-426614174000"
}
}{
"success": false,
"error": {
"code": "INTERNAL_ERROR",
"message": "Internal server error"
},
"meta": {
"timestamp": "2025-01-15T10:30:00Z",
"request_id": "123e4567-e89b-12d3-a456-426614174000"
}
}Deactivate client DELETE
Deactivates (marks as deleted) a client. **Soft delete:** The client is not physically deleted, only marked as inactive. **Restriction:** Cannot deactivate a client with associated invoices.
Import clients from CSV with structured preview POST
Imports multiple clients from a CSV file with full preview of all records. **Key features**: - **Structured preview**: Returns all parsed records (valid and with errors) - **Parallel validation**: NIFs validated concurrently against VeriFactu - **Granular feedback**: Client-specific errors and warnings - **Editable data**: Structured JSON for editable table in frontend **Recommended flow**: 1. **Initial upload**: Call with `dry_run=true` to get preview 2. **Display table**: Frontend shows parsed data with errors/warnings 3. **Inline editing**: User corrects data directly in the table 4. **Final import**: Send corrected data with `dry_run=false` **Format**: Must follow CSV template format (downloadable from `/clientes/template-csv`). **Security limits**: - Max size: 5MB - Max 1,000 records per file - Rate limiting: 3 imports per hour **Validation**: - Required headers per template - Full validation of each row with business rules - Parallel NIF validation against AEAT registry (VeriFactu) - Duplicate detection in CSV and database **Validation statuses**: - `VALID`: Client valid, ready to import - `WARNING`: Client valid but with warnings (eg: missing email) - `ERROR`: Client invalid, cannot process - `DUPLICATE`: Duplicate client (in CSV or DB) - `NIF_INVALID`: NIF invalid in AEAT registry