EmailTemplates.List
List email templates for the authenticated account (table email_template). Use ids with Chat.SendCustomer from=send_email as template_id or email_template_id, and with Ticket.AutomationSave as email_template_id (customer mail under Send email). Same templates as the dashboard EMAIL composer / ticket automation Email template select.
Permissions
- User must be logged in with a valid bearer token.
- The user must be from the same company domain as the request Host (call the API on that account subdomain or allowed custom domain). A token from another company returns success=0, error user_not_in_company.
- Returned or changed records are limited by the user permissions, team access, folder access, and account settings.
Action
- Returns EmailTemplates rows as JSON.
- Supports the documented filters and paging fields.
- List responses are capped at 25 rows per call.
Push Service
No push is sent because this function only reads data or returns helper information.
Automation
No automation is run for this function.
Special Instructions
- Send the bearer token on protected calls with Authorization: Bearer YOUR TOKEN.
- 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.
- Send parameters as POST body fields exactly as documented.
- For paging, do not request more than 25 rows.
- For total rows, call the matching Count function with the same filters.
Required Parameters
No body parameters are required for this function.
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
limitpost | int | 25 | Maximum rows to return. Values above 25 are capped. |
startpost | int | 0 | Offset for paging. |
searchpost | string | welcome | Searches template name, subject, and source. |
statuspost | int | 1 | Filter by status (1 = active). |
default_quick_emailpost | int | 1 | Filter templates marked as default quick email. |
order_bypost | string | id | Sort field: id, tamplate_name, subject, status, default_quick_email. |
order_dirpost | string | desc | Sort direction: asc or desc. |
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\/EmailTemplates.List",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"status": "1",
"limit": "25"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/EmailTemplates.List",
"url_domain": "https:\/\/{domain}\/app\/EmailTemplates.List"
}Endpoint
POST /app/EmailTemplates.List
POST https://{user}.bull36.com/app/EmailTemplates.List
POST https://{domain}/app/EmailTemplates.ListSample Output
{
"success": 1,
"count": 1,
"recordsTotal": 1,
"data": [
{
"id": 42,
"template_id": 42,
"email_template_id": 42,
"name": "Welcome",
"template_name": "Welcome",
"subject": "Hello",
"status": 1
}
]
}Count Only
Use the matching count route with the same filters when the UI only needs total rows for paging.
{
"url": "\/app\/EmailTemplates.Count",
"url_user": "https:\/\/{user}.bull36.com\/app\/EmailTemplates.Count",
"url_domain": "https:\/\/{domain}\/app\/EmailTemplates.Count",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"status": "1"
},
"sample_output": {
"success": 1,
"count": 123
},
"notes": {
"count": "Use EmailTemplates.Count for only the count with the same filters, or read count\/recordsTotal from this response."
}
}Count JavaScript
const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('status', '1');
const res = await fetch('https://{domain}/app/EmailTemplates.Count', {
method: 'POST',
headers: { Authorization: `Bearer ${token}` },
body
});
const data = await res.json();
console.log(data.count);JavaScript Example
const token = 'YOUR TOKEN';
const body = new URLSearchParams({ status: '1', limit: '25' });
const res = await fetch('/app/EmailTemplates.List', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
const data = await res.json();
console.log(data);Error Example
{
"success": "0",
"error": "bearer_token_required",
"message": "Authorization bearer token is required. Send header: Authorization: Bearer YOUR TOKEN"
}