POST
Documents.Count
Return only the number of customer documents/files matching the same filters used by Documents.List.
Permissions
- User must be logged in with a valid bearer token.
- Returned or changed records are limited by the user permissions, team access, folder access, and account settings.
Action
- Returns only the count for Documents using the same filters as the list function.
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.
- Send parameters as POST body fields exactly as documented.
Required Parameters
No body parameters are required for this function.
Optional Parameters
| Name | Type | Sample | What it gives |
|---|---|---|---|
customer_idpost | int | 123 | Optional customer filter. Omit it to list documents for the logged-in account. You may also send cust_id. |
typepost | string | invoice | Optional document type filter, such as invoice, receipt, delivery_invoice, purchase_orders, or order_proposals. |
document_typepost | string | receipt | Alias for type. |
paidpost | int | 1 | Payment status filter on documents.paid: 0=unpaid, 1=paid, 2=partly paid, 3=canceled. Alias: paid_status. Omit or send all for no filter. |
paid_statuspost | int | 1 | Dashboard alias for paid (Payment module uses this name). |
user_statuspost | string | paid | Optional document user-status filter when used by the account. |
payment_project_idpost | int | 5 | Optional payment project filter. You may also send project_id. |
default_value_folderpost | string|int | all | Folder filter. Use all for every visible folder, or send a folder/type id. |
limitpost | int | 25 | Optional caller-side max. Values above 25 are capped before forwarding. |
sortpost | string | date_desc | Optional caller-side sort hint; backend output is normally grouped by stored file order/date. |
startpost | int | 0 | First row offset for paging. |
lengthpost | int | 25 | Maximum number of rows to return. Values above 25 are capped to 25. |
per_pagepost | int | 25 | Alternative page-size field. Values above 25 are capped to 25. |
drawpost | int | 1 | Optional DataTables draw counter. |
searchpost | string | john | Search text for list routes when supported. |
search[value]post | string | john | DataTables search text when supported. |
filter_datapost | string | john | Legacy/general filter text when supported. |
from_datepost | date | 2026-07-01 | Filters rows from this date when the list supports date filtering. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
to_datepost | date | 2026-07-17 | Filters rows until this date when the list supports date filtering. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
date_fieldpost | string | date_created | Date column selector when supported, such as date_created, last_updated, updated, or followup. |
created_frompost | date | 2026-07-01 | Filters rows created from this date when supported. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
created_topost | date | 2026-07-17 | Filters rows created until this date when supported. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
updated_frompost | date | 2026-07-01 | Filters rows updated from this date when supported. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
updated_topost | date | 2026-07-17 | Filters rows updated until this date when supported. Send date filters and date values as UTC Y-m-d H:i:s when the route accepts date/time; date-only table columns store the Y-m-d date part. |
order_bypost | string | date_created | Column/key to order by when supported. |
order_dirpost | string | desc | Order direction: asc or desc. |
order[0][column]post | int | 0 | DataTables column index to order by when supported. |
order[0][dir]post | string | desc | DataTables order direction: asc or desc. |
folder_idpost | mixed | 1 | Folder filter when the list supports folders. |
folderpost | mixed | 1,2 | One or more folder ids/names when the list supports folders. |
status_idpost | mixed | 1 | Status filter when the list supports statuses. |
tagpost | mixed | 1 | Tag filter when the list supports tags. |
tag_idpost | mixed | 1 | Tag id filter when the list supports tags. |
sourcepost | mixed | website | Source filter when the list supports source values. |
team_member_idpost | mixed | 47 | Filter by document creator (documents.created_by_user_id). Single id, comma list, or JSON array. Same as dashboard filter_tm on Payment documents. Alias: filter_tm. |
filter_tmpost | mixed | 47 | Dashboard alias for team_member_id (created_by_user_id). |
father_user_idpost | mixed | 47 | Filter by documents.father_user_id (parent/assignee team member on some document types). |
custom_fieldpost | string | vip_level | Custom field name for list filtering when supported. |
custom_field_valuepost | mixed | gold | Custom field value paired with custom_field when supported. |
Authentication
Send the bearer token returned by Login in the request header.
Authorization: Bearer YOUR TOKEN
Sample Request
{
"url": "\/app\/Documents.Count",
"body": {
"customer_id": "123",
"default_value_folder": "all"
},
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"url_user": "https:\/\/{user}.bull36.com\/app\/Documents.Count",
"url_domain": "https:\/\/{domain}\/app\/Documents.Count"
}Endpoint
POST /app/Documents.Count
POST https://{user}.bull36.com/app/Documents.Count
POST https://{domain}/app/Documents.CountSample Output
{
"success": 1,
"count": 12
}Count Only
Use the matching count route with the same filters when the UI only needs total rows for paging.
{
"url": "\/app\/Documents.Count",
"url_user": "https:\/\/{user}.bull36.com\/app\/Documents.Count",
"url_domain": "https:\/\/{domain}\/app\/Documents.Count",
"method": "POST",
"headers": {
"Authorization": "Bearer YOUR TOKEN"
},
"body": {
"customer_id": "123",
"default_value_folder": "all"
},
"sample_output": {
"success": 1,
"count": 123
},
"notes": {
"count": "Total documents\/files matching the sent customer and folder filters."
}
}Count JavaScript
const token = 'YOUR TOKEN';
const body = new URLSearchParams();
body.set('customer_id', '123');
body.set('default_value_folder', 'all');
const res = await fetch('https://{domain}/app/Documents.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();
// Fill body fields from the Sample Request JSON above.
const res = await fetch('/app/Documents.List', { method: 'POST', headers: { Authorization: 'Bearer ' + token }, body });
const data = await res.json();
console.log(data);Error Example
{
"success": 0,
"message": "permission denied"
}