Request Report Generation

Request generation of a CRM report for your organisation.

Supported report types:

TypeDescription
CHATAll chats with filters for assignees, labels, priority, bot status, date range, etc.
CONTACTContact records with filters for search, channels, creation date, custom fields
TICKETTickets with filters for resolution status, priority, assignees, date range
CALL_LOGCall logs with filters for direction, status, agents, duration, date range
GOALGoal events with filters for date range, goal IDs, channels, tracker values
BOOKINGCalendar bookings with filters for type, status, agent, contact, date range
FOLLOW_UPSAgent follow-up reminders with filters for agent, status, kind, due-date range
SURVEY_RESPONSESSurvey submissions (one dynamic column per question) with filters for form, status, source, date range, channel
FLOW_RESPONSESWhatsApp Flow submissions (one dynamic column per captured field) with filters for flow, source, date range
CHAT_STATE_HISTORYOne 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, ...)
DISPOSITIONSOne 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
LEADOne 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_ACTIVITYOne 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
CUSTOM_QUERYA saved analytics query your admins published to Reports & API, run with the variable values you pass. Fields: customQueryId (required), variables (object keyed by variable name), timezone (IANA, default Asia/Kolkata). Discover the queries and their variables via GET /api/wp-crm/reports/:organisationId/custom-queries. Capped at 100,000 rows (the report's filters.truncated flags a cut-off)
AGENT_AVAILABILITYChat availability, call availability (Lodgestory Voice) and app online (Lodgestory open in a web tab or the mobile app) side by side. DAILY (default): one row per agent per local day — first online, last offline, online time, break time and count, one column per break type, plus on calls / unreachable / drops / occupancy for calls and sittings for the app. TIMELINE: one row per stretch (Online / a break / Offline / On a call / Unreachable / Open), split at local midnight. Fields: availabilityFromDate and availabilityToDate (YYYY-MM-DD, required, at most 31 days), timezone (IANA, default Asia/Kolkata), availabilitySources (CHAT / CALLS / APP, default all), availabilityLayout (DAILY / TIMELINE), availabilityUserIds, availabilityTeamIds, availabilityBreakTypes (only those break types), availabilityOnlineSource + availabilityOnlineMinMinutes / availabilityOnlineMaxMinutes (only agent-days with that much online time; APP max 1 = never opened Lodgestory), availabilityTimeFrom / availabilityTimeTo (hours of the day, HH:mm; an end before the start is a night shift)

Required steps before calling:

  1. Obtain a JWT via POST /api/wp-crm/token
  2. Choose a reportType and optionally add filter fields to narrow the report scope

Security:

  • The organisationId in 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_ADMIN or ACCOUNT_OWNER role 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 (for CUSTOM_QUERY, per saved query and set of variable values). 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
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required

Your organisation UUID (returned as org from the /token endpoint)

Body Params
string
enum
required

Type of report to generate

boolean

Filter by archived status

boolean

Filter by resolved/closed status. Omitted = all chats (open and resolved); true = only resolved/closed chats; false = only open chats.

boolean

Filter by high priority status

boolean

Filter chats handled by bot (autopilot OR active bot journey)

boolean

Filter unanswered chats (last message from guest)

boolean

Filter by assignee presence (true=assigned, false=unassigned)

boolean

Filter chats with active agent-transferred bot session

boolean

Filter chats with closed/completed bot session

assignedToUserIds
array of strings

Filter chats assigned to specific user IDs

assignedToUserIds
assignedToTeamIds
array of strings

Filter chats assigned to specific team IDs

assignedToTeamIds
boolean

Filter by primary assignee status

boolean

Filter chats with no primary assignee

boolean

Filter chats that have contacts attached

string

Search contacts by name or phone

stateMachineIds
array of strings

Filter by specific state machine IDs (CHAT: chats with the machine attached; CHAT_STATE_HISTORY: stage rows of these machines)

stateMachineIds
currentStateIds
array of strings

Filter by current state IDs

currentStateIds
boolean

Filter chats that have state machines attached

string

Fuzzy search across chat names, external items, and contact names

string

Filter by chat type

channelIds
array of strings

Filter by specific channel IDs

channelIds
string

Filter chats updated after this date (ISO string)

string

Filter chats updated before this date (ISO string)

string

Filter chats created after this date (ISO string)

string

Filter chats created before this date (ISO string)

labelIds
array of strings

Filter chats that have any of these label IDs (OR logic)

labelIds
boolean

Filter chats that have labels attached

allLabelIds
array of strings

Filter chats that have ALL of these label IDs (AND logic)

allLabelIds
string

Search contacts by name, phone, or email (CONTACT report)

contactChannelIds
array of strings

Filter contacts by channel IDs (CONTACT report)

contactChannelIds
boolean

Filter contacts that have linked chats (CONTACT report)

string

Filter contacts created after this date (CONTACT report)

string

Filter contacts created before this date (CONTACT report)

contactCreatedByUserIds
array of strings

Filter contacts created by specific user IDs (CONTACT report)

contactCreatedByUserIds
string

JSON-encoded array of custom field filter rules for CONTACT reports. Each rule: { field, operator, value }.

boolean

Filter tickets by resolution status (TICKET report)

ticketPriorityLevels
array of strings

Filter tickets by priority levels (TICKET report)

ticketPriorityLevels
ticketAssignedToUserIds
array of strings

Filter tickets by assigned user IDs (TICKET report)

ticketAssignedToUserIds
ticketCreatedByUserIds
array of strings

Filter tickets by creator user IDs (TICKET report)

ticketCreatedByUserIds
ticketMachineIds
array of strings

Filter tickets by ticketing machine IDs (TICKET report)

ticketMachineIds
string

Filter tickets created after this date (TICKET report)

string

Filter tickets created before this date (TICKET report)

string

Search tickets by ticket number ("#42" or "42"), remarks, chat name, or issue names (TICKET report)

string

Filter calls by direction: INBOUND or OUTBOUND (CALL_LOG report)

callStatuses
array of strings

Filter calls by statuses (CALL_LOG report)

callStatuses
callAgentUserIds
array of strings

Filter calls by agent user IDs (CALL_LOG report)

callAgentUserIds
string

Filter calls by calling account ID (CALL_LOG report)

string

Filter calls by Lodgestory Voice department ID (CALL_LOG report): calls routed, failed over or transferred into the department's queue, plus outbound calls placed by the department's current members

string

Filter calls initiated after this date (CALL_LOG report)

string

Filter calls initiated before this date (CALL_LOG report)

string

Search calls by phone number — matches callerNumber, calledNumber, and linked chat wpChatId (CALL_LOG report)

boolean

Filter calls linked to a chat (true) or not linked (false) (CALL_LOG report)

boolean

Filter calls that have a recording available (true) or not (false) (CALL_LOG report)

boolean

Filter calls that arrived while the business-hours schedule was closed — outside hours, a holiday, or closed manually (true), or every other call, including calls that never passed a schedule (false) (CALL_LOG report, Lodgestory Voice)

number

Minimum talk duration in seconds (CALL_LOG report)

number

Maximum talk duration in seconds (CALL_LOG report)

string

Search calls by hangup cause (CALL_LOG report)

string

Search by contact name, phone, or email via linked chat (CALL_LOG report)

string

Filter goal events recorded after this date (GOAL report)

string

Filter goal events recorded before this date (GOAL report)

goalIds
array of strings

Filter by specific goal IDs (GOAL report)

goalIds
goalChannelIds
array of strings

Filter by specific channel IDs (GOAL report)

goalChannelIds
string

JSON-encoded array of tracker value filter rules for GOAL reports. Each rule: { field, operator, value }.

bookingTypes
array of strings

BOOKING: filter by types (ONLINE, OFFLINE_VISIT, PERSONAL_BLOCK).

bookingTypes
bookingStatuses
array of strings

BOOKING: filter by statuses (SCHEDULED, CONFIRMED, COMPLETED, CANCELLED, NO_SHOW).

bookingStatuses
bookingAgentUserIds
array of strings

BOOKING: filter by agent user ids.

bookingAgentUserIds
string

BOOKING: filter to a single contact.

string

BOOKING: bookings starting on/after this ISO date.

string

BOOKING: bookings starting on/before this ISO date.

followUpAgentUserIds
array of strings

FOLLOW_UPS: filter by owning agent user ids.

followUpAgentUserIds
followUpStatuses
array of strings

FOLLOW_UPS: filter by statuses (PENDING/DUE/COMPLETED/CANCELLED/EXPIRED).

followUpStatuses
string

FOLLOW_UPS: filter by kind (CHAT or CALL).

string

FOLLOW_UPS: due on/after this ISO date.

string

FOLLOW_UPS: due on/before this ISO date.

surveyFormIds
array of strings

SURVEY_RESPONSES: restrict to these survey form ids.

surveyFormIds
surveyStatuses
array of strings

SURVEY_RESPONSES: filter by statuses (IN_PROGRESS/COMPLETED/ABANDONED).

surveyStatuses
surveySources
array of strings

SURVEY_RESPONSES: filter by source (INVITE/PUBLIC_LINK/API).

surveySources
string

SURVEY_RESPONSES: started on/after this ISO date.

string

SURVEY_RESPONSES: started on/before this ISO date.

string

SURVEY_RESPONSES: filter by channel value.

flowIds
array of strings

FLOW_RESPONSES: restrict to these WhatsApp Flow ids (organisationWpChannelFlowId).

flowIds
flowSources
array of strings

FLOW_RESPONSES: filter by how the flow was sent (journey/campaign/chat_template/test_send).

flowSources
string

FLOW_RESPONSES: responded on/after this ISO date.

string

FLOW_RESPONSES: responded on/before this ISO date.

string

CHAT_STATE_HISTORY: only stage rows entered on/after this ISO date.

string

CHAT_STATE_HISTORY: only stage rows entered on/before this ISO date.

stateMovedByUserIds
array of strings

CHAT_STATE_HISTORY: only stage rows moved (attached/transitioned) by these user ids.

stateMovedByUserIds
string

DISPOSITIONS: only dispositions captured on/after this ISO date.

string

DISPOSITIONS: only dispositions captured on/before this ISO date.

dispositionTemplateIds
array of strings

DISPOSITIONS: restrict to these disposition template ids (inactive templates allowed).

dispositionTemplateIds
dispositionSourceTypes
array of strings

DISPOSITIONS: filter by source type (CHAT / CALENDAR_BOOKING / CALL).

dispositionSourceTypes
dispositionCreatedByUserIds
array of strings

DISPOSITIONS: only dispositions captured by these user ids.

dispositionCreatedByUserIds
string

LEAD: only leads created on/after this ISO date. LEAD_ACTIVITY: only attempts started on/after it.

string

LEAD: only leads created on/before this ISO date. LEAD_ACTIVITY: only attempts started on/before it.

leadTrackIds
array of strings

LEAD / LEAD_ACTIVITY: restrict to these track ids.

leadTrackIds
leadTypeIds
array of strings

LEAD / LEAD_ACTIVITY: restrict to these lead type ids (inactive types allowed).

leadTypeIds
leadStatuses
array of strings

LEAD / LEAD_ACTIVITY: filter by lead status (OPEN / WON / LOST / JUNK / MERGED). Unset exports every status — the live list defaults to OPEN, an export does not.

leadStatuses
leadStageIds
array of strings

LEAD / LEAD_ACTIVITY: restrict to these stage ids. A stage id is the track's own key (SIMPLE) or a workflow node id (MACHINE), so it is only meaningful together with its track.

leadStageIds
leadOwnerUserIds
array of strings

LEAD / LEAD_ACTIVITY: restrict to leads owned by these user ids.

leadOwnerUserIds
leadSources
array of strings

LEAD / LEAD_ACTIVITY: restrict to these source values (exact match). Stamped values: MANUAL, CSV_IMPORT, WEB_FORM, PUBLIC_API, WEBHOOK, CHAT, CALL_INBOUND, CALL_MISSED, CALL_OUTBOUND, GOAL, DISPOSITION, TICKET, AUTOMATION; an HTTP intake default or a CREATE_LEAD step may stamp free text.

leadSources
string

AGENT_AVAILABILITY (required): first local day, YYYY-MM-DD, in timezone. The range may cover at most 31 days.

string

AGENT_AVAILABILITY (required): last local day, YYYY-MM-DD, inclusive. A day after today is clipped to today.

availabilitySources
array of strings

AGENT_AVAILABILITY: which availability to include — CHAT (the chat availability toggle), CALLS (Lodgestory Voice presence), APP (Lodgestory open: a web tab or the mobile app in front). Default all three.

availabilitySources
Allowed:
string
enum

AGENT_AVAILABILITY: DAILY (default) = one row per agent per day; TIMELINE = one row per stretch (Online / a break / Offline / Unreachable / On a call / Open), split at local midnight.

Allowed:
availabilityUserIds
array of strings

AGENT_AVAILABILITY: only these members.

availabilityUserIds
availabilityTeamIds
array of strings

AGENT_AVAILABILITY: only members of these teams (combined with availabilityUserIds as OR).

availabilityTeamIds
availabilityBreakTypes
array of strings

AGENT_AVAILABILITY: only these break types (names as in Settings → Break types). DAILY: their columns only, instead of every type plus "Other breaks" (the On break / Breaks (n) totals still count every break). TIMELINE: only those break stretches. Needs CHAT or CALLS.

availabilityBreakTypes
string
enum

AGENT_AVAILABILITY: the source an online-time filter reads (must be one of availabilitySources). Keeps only agent-days whose online time there is at least availabilityOnlineMinMinutes and under availabilityOnlineMaxMinutes. APP counts a day with no sitting as 0, so { APP, max 1 } lists who never opened Lodgestory; CHAT needs a known chat state that day; CALLS only agents on Lodgestory Voice.

Allowed:
number

AGENT_AVAILABILITY: online at least this many minutes that day (0–1440).

number

AGENT_AVAILABILITY: online less than this many minutes that day (1–1440; 1 = never came online).

string

AGENT_AVAILABILITY: hours of the day, local HH:mm in timezone (with availabilityTimeTo). Each day is cut to [from, to); a to at or before from runs into the next morning — a night shift, reported on the day it starts.

string

AGENT_AVAILABILITY: end of the hours of the day, local HH:mm (see availabilityTimeFrom).

string

CUSTOM_QUERY: id of a saved analytics query that is active and switched on for Reports & API (discover them via GET …/custom-queries).

variables
object

CUSTOM_QUERY: variable values keyed by variable name, e.g. { "date_range": "last_month", "channels": ["WHATSAPP"], "sort": { "column": "chats", "direction": "desc" } }. Date ranges accept a preset (today, yesterday, last_7_days, last_30_days, this_week, last_week, this_month, last_month, this_quarter, this_year) or { "start": "YYYY-MM-DD", "end": "YYYY-MM-DD" }.

string

CUSTOM_QUERY: IANA timezone the relative date presets resolve in. AGENT_AVAILABILITY: the timezone whose local days the report uses. Default Asia/Kolkata.

Responses

401

Unauthorized — invalid/expired JWT or organisation ID does not match the token

403

Forbidden — user does not have CRM_ADMIN or ACCOUNT_OWNER role

409

A report of this type is already being generated or was recently completed. Wait 5 minutes between requests of the same type.

Language
Credentials
Bearer
JWT
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json