post
https://api.lodgestory.com/api/wp-crm/reports/
Request generation of a CRM report for your organisation.
Supported report types:
| Type | Description |
|---|---|
CHAT | All chats with filters for assignees, labels, priority, bot status, date range, etc. |
CONTACT | Contact records with filters for search, channels, creation date, custom fields |
TICKET | Tickets with filters for resolution status, priority, assignees, date range |
CALL_LOG | Call logs with filters for direction, status, agents, duration, date range |
GOAL | Goal events with filters for date range, goal IDs, channels, tracker values |
BOOKING | Calendar bookings with filters for type, status, agent, contact, date range |
FOLLOW_UPS | Agent follow-up reminders with filters for agent, status, kind, due-date range |
SURVEY_RESPONSES | Survey submissions (one dynamic column per question) with filters for form, status, source, date range, channel |
FLOW_RESPONSES | WhatsApp Flow submissions (one dynamic column per captured field) with filters for flow, source, date range |
CHAT_STATE_HISTORY | One row per workflow stage a chat entered (entered/left/time in stage, who moved it); closed chats included. Filters: stateFromDate, stateToDate, stateMovedByUserIds, stateMachineIds, plus the CHAT filters (channelIds, assignedToUserIds, isResolved, ...) |
DISPOSITIONS | One row per captured disposition — outcome, notes, who captured it, the contact, the source chat/booking/call, and one dynamic column per template field. Filters: dispositionFromDate, dispositionToDate, dispositionTemplateIds, dispositionSourceTypes (CHAT / CALENDAR_BOOKING / CALL), dispositionCreatedByUserIds |
LEAD | One row per lead — track, stage (resolved to its label) and stage type, status, lead type, owner, source and source detail, contact name/phone/email, score, priority, attempts, connects, last outcome, last-contacted and next-action times, time in stage, time to first dial, SLA due/breached, when a won or lost lead was decided — plus one dynamic column per lead-type field. Filters: leadFromDate, leadToDate, leadTrackIds, leadTypeIds, leadStatuses (OPEN / WON / LOST / JUNK / MERGED), leadStageIds, leadOwnerUserIds, leadSources |
LEAD_ACTIVITY | One row per dial attempt — attempt no, start/end, channel, agent, outcome, connected (1/0 so it sums), talk and wrap seconds, track, the stage the lead was in at the attempt, contact name/phone, call log id, script and the script blocks walked. The per-agent, per-hour calling report. Same filters as LEAD, except leadFromDate/leadToDate bound the attempt start rather than the lead's creation |
Required steps before calling:
- Obtain a JWT via
POST /api/wp-crm/token - Choose a
reportTypeand optionally add filter fields to narrow the report scope
Security:
- The
organisationIdin the URL path must match the organisation your JWT was issued for. The token is cryptographically bound to a specific organisation — requests targeting a different organisation will fail with 401 Unauthorized. - Only users with
CRM_ADMINorACCOUNT_OWNERrole in the organisation can request reports. Other roles will receive a 403 Forbidden.
Rate limiting: Only one report per type per organisation can be generated every 5 minutes. If a report is already being generated or was recently completed, you'll receive a 409 Conflict.
Returns a report record with status PENDING. Poll GET /api/wp-crm/reports/:organisationId to check when it completes, then use the download endpoint.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
401Unauthorized — invalid/expired JWT or organisation ID does not match the token
403Forbidden — user does not have CRM_ADMIN or ACCOUNT_OWNER role
409A report of this type is already being generated or was recently completed. Wait 5 minutes between requests of the same type.
