Lead operations
Count leads by SLA state
Return the Lead-Ops counters for a period.
Returns how many leads arrived, were answered inside the SLA, breached it, and closed. Use it for a health read on response times instead of paging the whole queue. Read-only and rate-limited to 20 calls per minute.
Count leads by SLA state › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successList the Lead-Ops queue
Return leads with their SLA state, owner and waiting time.
Returns the Lead-Ops queue: each lead with how long it has waited, its SLA state (AI_ACTIVE, NEEDS_CS, AT_RISK or HANDLED), who owns it and its closing state. Use it to find the leads that need a human or are about to go at risk; filter by temperature, source, treatment and the last time the customer wrote. Read-only. Paginated: follow meta.pagination.nextCursor until hasMore is false. The configuration behind it is readable with leadOps.config and cannot be changed through this API.
query Parameters
limitRows to return, 1-100. Defaults to 25.
Rows to return, 1-100. Defaults to 25.
cursorThe meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
The meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
slaStateLead-Ops SLA state, one of AI_ACTIVE, NEEDS_CS, AT_RISK, HANDLED.
Lead-Ops SLA state, one of AI_ACTIVE, NEEDS_CS, AT_RISK, HANDLED.
closingStateClosing state, one of CLOSED, OPEN.
Closing state, one of CLOSED, OPEN.
assignedToOnly leads owned by this agent, user id from assignments.assignableUsers.
Only leads owned by this agent, user id from assignments.assignableUsers.
assignmentassigned (has an owner) or unassigned (no owner yet).
assigned (has an owner) or unassigned (no owner yet).
channelChannel the lead arrived on, one of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
Channel the lead arrived on, one of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
sourceKindHow the lead was attributed, one of META_AD, META_POST, REFERRAL_CONVERSION, CTA_TEXT_ONLY, LANDING_PAGE (ad, post, referral, text-only click-to-chat or a landing-page tracked link).
How the lead was attributed, one of META_AD, META_POST, REFERRAL_CONVERSION, CTA_TEXT_ONLY, LANDING_PAGE (ad, post, referral, text-only click-to-chat or a landing-page tracked link).
leadTemperatureLead temperature, one of UNKNOWN, COLD, WARM, HOT.
Lead temperature, one of UNKNOWN, COLD, WARM, HOT.
treatmentKeyOnly leads matched to this treatment key, from leadOps.config.
Only leads matched to this treatment key, from leadOps.config.
lastInboundFromOnly leads whose customer last wrote at or after this ISO-8601 UTC time ending in Z.
Only leads whose customer last wrote at or after this ISO-8601 UTC time ending in Z.
lastInboundToOnly leads whose customer last wrote at or before this ISO-8601 UTC time ending in Z.
Only leads whose customer last wrote at or before this ISO-8601 UTC time ending in Z.
qFree-text search over the lead and customer.
Free-text search over the lead and customer.
List the Lead-Ops queue › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successClosing counters for the last days
Return how many leads closed in the last N days.
Returns the closing counters Lead-Ops keeps for the trailing window (default 30 days, maximum 90). Use it for a quick "how are we closing" read. Read-only. For a filterable period with revenue and attribution use leadOps.closingsStats or leadOps.dashboardRevenue.
query Parameters
daysTrailing window in days, 1-90. Defaults to 30.
Trailing window in days, 1-90. Defaults to 30.
Closing counters for the last days › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successList recorded closings
Return the closings Lead-Ops recorded, newest first, with who closed each one.
Returns each recorded closing with its customer, time, source, amount, payment method and whether the AI or a human closed it. Use it to audit what counted as a closing or to reconcile revenue. Read-only. Paginated: follow meta.pagination.nextCursor until hasMore is false. The period defaults to the last 30 days and cannot exceed 90.
query Parameters
limitRows to return, 1-100. Defaults to 25.
Rows to return, 1-100. Defaults to 25.
cursorThe meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
The meta.pagination.nextCursor value from the previous call. Omit it to read the first page.
fromStart of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
Start of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
toEnd of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
End of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
leadMetricWhat counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
What counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
timezoneIANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
IANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
sourceChannelOnly this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
Only this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
channelAccountIdOnly this connected account on that channel. Requires sourceChannel.
Only this connected account on that channel. Requires sourceChannel.
customerTagOnly customers carrying this tag. Repeat the parameter to require several tags.
Only customers carrying this tag. Repeat the parameter to require several tags.
treatmentKeyOnly leads matched to this treatment key (see leadOps.config).
Only leads matched to this treatment key (see leadOps.config).
branchIdOnly this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
Only this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
agentIdOnly closings credited to this human agent, id from assignments.assignableUsers.
Only closings credited to this human agent, id from assignments.assignableUsers.
attributionWho closed it: AI (the AI agent) or HUMAN (a team member).
Who closed it: AI (the AI agent) or HUMAN (a team member).
List recorded closings › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successClosing totals for a period
Return closing counts and revenue for a filtered period, split by AI and human.
Returns the aggregate of recorded closings for the period and filters you give: totals, revenue, and the AI-versus-human split. Use it for a period report. Read-only. It is an analytics calculation run on the isolated analytics worker, so it is rate-limited to 20 calls per minute and may answer analytics_unavailable with a Retry-After; retry after a few seconds rather than in a tight loop.
query Parameters
fromStart of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
Start of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
toEnd of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
End of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
leadMetricWhat counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
What counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
timezoneIANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
IANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
sourceChannelOnly this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
Only this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
channelAccountIdOnly this connected account on that channel. Requires sourceChannel.
Only this connected account on that channel. Requires sourceChannel.
customerTagOnly customers carrying this tag. Repeat the parameter to require several tags.
Only customers carrying this tag. Repeat the parameter to require several tags.
treatmentKeyOnly leads matched to this treatment key (see leadOps.config).
Only leads matched to this treatment key (see leadOps.config).
branchIdOnly this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
Only this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
agentIdOnly closings credited to this human agent, id from assignments.assignableUsers.
Only closings credited to this human agent, id from assignments.assignableUsers.
attributionWho closed it: AI (the AI agent) or HUMAN (a team member).
Who closed it: AI (the AI agent) or HUMAN (a team member).
Closing totals for a period › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successLead-Ops dashboard overview
Return the Lead-Ops dashboard numbers for a period.
Returns the dashboard headline numbers for the period: active-inbound and new-lead totals, closings and conversion rate, the comparison with the previous period, peak hours, the open pipeline (needs owner, assigned, stale), lead aging and the funnel. Use it first when asked how the team is doing. Read-only. This is an analytics calculation run on the isolated analytics worker (ADR-0092), so it is rate-limited to 20 calls per minute and may answer analytics_unavailable with a Retry-After; retry after a few seconds. The period defaults to the last 30 days and cannot exceed 90.
query Parameters
fromStart of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
Start of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
toEnd of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
End of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
leadMetricWhat counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
What counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
timezoneIANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
IANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
sourceChannelOnly this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
Only this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
channelAccountIdOnly this connected account on that channel. Requires sourceChannel.
Only this connected account on that channel. Requires sourceChannel.
customerTagOnly customers carrying this tag. Repeat the parameter to require several tags.
Only customers carrying this tag. Repeat the parameter to require several tags.
treatmentKeyOnly leads matched to this treatment key (see leadOps.config).
Only leads matched to this treatment key (see leadOps.config).
branchIdOnly this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
Only this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
ownerIdOnly leads whose current owner is this user id (see assignments.assignableUsers), or "unassigned" for leads with no owner.
Only leads whose current owner is this user id (see assignments.assignableUsers), or "unassigned" for leads with no owner.
Lead-Ops dashboard overview › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successDashboard responder breakdown
Return how each responder (AI or team member) performed in a period.
Returns the per-responder breakdown for the period using the current lead cohort and responder classification. branchId filters that cohort; AI detail and Meta Ads remain global. Use it to compare agents or to see how much the AI handled. Read-only. This is an analytics calculation run on the isolated analytics worker (ADR-0092), so it is rate-limited to 20 calls per minute and may answer analytics_unavailable with a Retry-After; retry after a few seconds. The period defaults to the last 30 days and cannot exceed 90.
query Parameters
fromStart of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
Start of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
toEnd of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
End of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
leadMetricWhat counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
What counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
timezoneIANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
IANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
sourceChannelOnly this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
Only this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
channelAccountIdOnly this connected account on that channel. Requires sourceChannel.
Only this connected account on that channel. Requires sourceChannel.
customerTagOnly customers carrying this tag. Repeat the parameter to require several tags.
Only customers carrying this tag. Repeat the parameter to require several tags.
treatmentKeyOnly leads matched to this treatment key (see leadOps.config).
Only leads matched to this treatment key (see leadOps.config).
branchIdOnly this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
Only this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
ownerIdOnly leads whose current owner is this user id (see assignments.assignableUsers), or "unassigned" for leads with no owner.
Only leads whose current owner is this user id (see assignments.assignableUsers), or "unassigned" for leads with no owner.
Dashboard responder breakdown › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successDashboard revenue
Return the revenue the dashboard attributes to leads in a period.
Returns PAID revenue by paidAt for the period. branchId filters the payment branch snapshot, including totals and every payment split; none selects unset snapshots. Responder splits use the branch-filtered current lead cohort and current responder classification; payments without a matching lead are unmatched. AI detail and Meta Ads remain global. Read-only. This is an analytics calculation run on the isolated analytics worker (ADR-0092), so it is rate-limited to 20 calls per minute and may answer analytics_unavailable with a Retry-After; retry after a few seconds. The period defaults to the last 30 days and cannot exceed 90.
query Parameters
fromStart of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
Start of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
toEnd of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
End of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
leadMetricWhat counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
What counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
timezoneIANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
IANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
sourceChannelOnly this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
Only this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
channelAccountIdOnly this connected account on that channel. Requires sourceChannel.
Only this connected account on that channel. Requires sourceChannel.
customerTagOnly customers carrying this tag. Repeat the parameter to require several tags.
Only customers carrying this tag. Repeat the parameter to require several tags.
treatmentKeyOnly leads matched to this treatment key (see leadOps.config).
Only leads matched to this treatment key (see leadOps.config).
branchIdOnly this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
Only this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
ownerIdOnly leads whose current owner is this user id (see assignments.assignableUsers), or "unassigned" for leads with no owner.
Only leads whose current owner is this user id (see assignments.assignableUsers), or "unassigned" for leads with no owner.
Dashboard revenue › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successDashboard attribution
Return where leads came from in a period: ads, posts, referrals.
Returns the lead-source attribution breakdown for the period (Meta ad, Meta post, referral, text-only click-to-chat). Use it to see which source produced the leads. Read-only. This is an analytics calculation run on the isolated analytics worker (ADR-0092), so it is rate-limited to 20 calls per minute and may answer analytics_unavailable with a Retry-After; retry after a few seconds. The period defaults to the last 30 days and cannot exceed 90.
query Parameters
fromStart of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
Start of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
toEnd of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
End of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
leadMetricWhat counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
What counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
timezoneIANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
IANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
sourceChannelOnly this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
Only this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
channelAccountIdOnly this connected account on that channel. Requires sourceChannel.
Only this connected account on that channel. Requires sourceChannel.
customerTagOnly customers carrying this tag. Repeat the parameter to require several tags.
Only customers carrying this tag. Repeat the parameter to require several tags.
treatmentKeyOnly leads matched to this treatment key (see leadOps.config).
Only leads matched to this treatment key (see leadOps.config).
branchIdOnly this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
Only this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
ownerIdOnly leads whose current owner is this user id (see assignments.assignableUsers), or "unassigned" for leads with no owner.
Only leads whose current owner is this user id (see assignments.assignableUsers), or "unassigned" for leads with no owner.
Dashboard attribution › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successDashboard response times
Return first-response and handling-time distributions for a period.
Returns the response-time statistics for the period. Prefer leadOps.dashboard unless you specifically need response times. Read-only. This is an analytics calculation run on the isolated analytics worker (ADR-0092), so it is rate-limited to 20 calls per minute and may answer analytics_unavailable with a Retry-After; retry after a few seconds. The period defaults to the last 30 days and cannot exceed 90.
query Parameters
fromStart of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
Start of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
toEnd of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
End of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
leadMetricWhat counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
What counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
timezoneIANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
IANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
sourceChannelOnly this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
Only this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
channelAccountIdOnly this connected account on that channel. Requires sourceChannel.
Only this connected account on that channel. Requires sourceChannel.
customerTagOnly customers carrying this tag. Repeat the parameter to require several tags.
Only customers carrying this tag. Repeat the parameter to require several tags.
treatmentKeyOnly leads matched to this treatment key (see leadOps.config).
Only leads matched to this treatment key (see leadOps.config).
branchIdOnly this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
Only this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
ownerIdOnly leads whose current owner is this user id (see assignments.assignableUsers), or "unassigned" for leads with no owner.
Only leads whose current owner is this user id (see assignments.assignableUsers), or "unassigned" for leads with no owner.
Dashboard response times › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successRead the SLA state of a conversation
Return the Lead-Ops SLA state and when it next changes for one conversation.
Returns the conversation's current SLA state (AI_ACTIVE, NEEDS_CS, AT_RISK or HANDLED), when it will next transition, and whether an AI workflow would answer on that channel. Use it before deciding whether a human should step in. Read-only. A WEB conversation has no Lead-Ops state and answers null.
path Parameters
conversationTypeChannel of the conversation. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, WEB, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
Channel of the conversation. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, WEB, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
conversationIdConversation id from conversations.list.
Conversation id from conversations.list.
Read the SLA state of a conversation › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successRead the Lead-Ops configuration
Return the SLA thresholds, auto-assignment mode, closing definition and treatment rules.
Returns how Lead-Ops is configured for this workspace: the hours before a lead needs a human and before it is at risk, whether and how leads are auto-assigned, what counts as a closing, and the treatment rules (their keys are what leads.list treatmentKey filters by). Read-only. This API cannot change any of it; it is edited in the dashboard.
Read the Lead-Ops configuration › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successWrite an AI summary of the dashboard
Generate (or return the cached) plain-language narrative of the Lead-Ops dashboard.
Asks the workspace's AI provider to write a short narrative of the dashboard for the period. This calls an LLM through the workspace's AI provider and may consume its AI credit: a call returns the cached summary when one exists for the same period and filters, and regenerate=true discards that cache and pays for a fresh generation, overwriting the stored summary. Use regenerate only when the numbers have changed. Changes nothing a customer sees. Limited to 20 calls per minute; answers summary_unavailable (503) when the AI provider cannot be reached.
Write an AI summary of the dashboard › Request Body optional
fromStart of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to 30 days before "to".
toEnd of the period. ISO-8601 UTC datetime ending in Z, e.g. 2026-09-01T00:00:00Z. Defaults to now.
leadMetricWhat counts as a lead: activeInbound (leads that wrote in during the period, the default) or newLeads (leads created in the period).
timezoneIANA timezone used to cut days, e.g. Asia/Jakarta. Defaults to UTC.
sourceChannelOnly this channel. One of WHATSAPP, INSTAGRAM, MESSENGER, TELEGRAM, REPLIZ_COMMENT, TIKTOK, TIKTOK_COMMENT, META_COMMENT.
channelAccountIdOnly this connected account on that channel. Requires sourceChannel.
customerTagOnly customers carrying this tag. Repeat the parameter to require several tags.
treatmentKeyOnly leads matched to this treatment key (see leadOps.config).
branchIdOnly this branch: a branch id from branches.list, or "none" for no branch. On the dashboard it is the branch of the lead's own conversation; on the closings it is the branch recorded on the closing. Ad reports ignore it.
ownerIdOnly leads whose current owner is this user id (see assignments.assignableUsers), or "unassigned" for leads with no owner.
localeLanguage of the narrative: id (default) or en.
regeneratetrue discards the cached summary and pays for a new LLM generation. Defaults to false.
Write an AI summary of the dashboard › Responses
The API key is missing, malformed, expired, or its owner is inactive.
successAssign a lead to a team member
Give a Lead-Ops lead to a named agent, or let Lead-Ops pick one.
Assigns the lead through the Lead-Ops assignment policy. With assigneeId it gives the lead to that user; WITHOUT assigneeId it auto-assigns to the next eligible team member by the workspace's strategy (least assigned or round robin). It does NOT unassign: to release a lead use assignments.clear. The policy refuses a lead already held by another person (already_assigned), a lead not yet needing a human when auto-assigning (lead_not_assignable) and a user who is not an eligible owner (no_eligible_owner). Prefer this over assignments.set when you work from the Lead-Ops queue (leads.list) because it applies those rules and records the assignment reason; use assignments.set to hand over any conversation by its channel and id regardless of Lead-Ops state. Writes the assignment; no message goes to the customer.
path Parameters
idLead id from leads.list.
Lead id from leads.list.
Assign a lead to a team member › Request Body optional
assigneeIdAgent user id from assignments.assignableUsers. Omit it to auto-assign to the next eligible agent (this does not unassign).
Assign a lead to a team member › Responses
The API key is missing, malformed, expired, or its owner is inactive.
success