POST
Customer.Remove
Same as Customer.Delete. Move a customer to dashboard trash (folder 5) when the active user has permission.
Permissions
- On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
- User must be allowed to remove this customer.
- Permanent delete from trash requires delete-from-trash permission.
Action
- Moves the customer to dashboard trash by setting folders to ["5"] and archive = 1.
- Keeps the customer id so Customer.Restore can put the customer back in folder 1.
- If the customer is already in trash (folder 5) or spam (folder 6), send confirm_delete_forever=1 for a permanent delete.
Push Service
Pushes the removed customer id to team members so active lists can refresh.
Automation
Runs automation event customer.deleted with customer_id when enabled.
Special Instructions
- On a company subdomain (e.g. https://{user_domain}.bull36.com) the user must match that Host — Login and protected APIs reject another company with success=0, error user_not_in_company. On a main brand host (bull36.com, biz1.co.il, mastrocrm.com, …) the company domain gate is skipped.
- Dashboard trash is folder 5, not archive-only. Response customer_id is the database id of the row that was updated.
- Customers with documents (except order_proposals) cannot be deleted, same as the dashboard.
- Permanent delete from trash requires owner/member-admin and confirm_delete_forever=1.
Required Parameters
| Name | Type | Sample | Explanation |
|---|---|---|---|
customer_idpost | int | 123 | Customer id to delete. You may also send id. |
Optional Parameters
No optional body parameters are defined for this function.
Authentication
Send the bearer token returned by Login in the request header. The user must be from the same company domain as this Host — a token from another company is rejected (user_not_in_company).
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Customer.Remove",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": [],
"url_user": "https:\/\/{user}.bull36.com\/app\/Customer.Remove",
"url_domain": "https:\/\/{domain}\/app\/Customer.Remove"
}Endpoint
POST /app/Customer.Remove
POST https://{user}.bull36.com/app/Customer.Remove
POST https://{domain}/app/Customer.RemoveSample Output
{
"success": 1,
"message": "Customer moved to trash",
"customer_id": 123,
"automation_event": "customer.deleted",
"socket_event": "customer.deleted"
}Fail Response
{
"success": 0,
"message": "You have no permission to delete customer"
}JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams();
// Fill body fields from the Sample Request JSON above.
const res = await fetch('/app/Customer.Remove', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
const data = await res.json();
console.log(data);Error Example
{
"success": 0,
"message": "You have no permission to delete customer"
}