انتقل إلى المحتوى الرئيسي

Change the status of many leads

POST 

/v1/agents/:agentId/leads/change-status

x-scope: "leads:write"
x-rate-limit-per-minute: 10

Changes every lead that matches the filters to new_status. There is no undo. The filters are listLeads' own and combine the same way, so listLeads with the same query lists the leads this takes (those already in new_status are left alone and not counted). status is required, so a call always names the statuses it takes leads from (422 invalid_request_body without it); limit and cursor aren't taken (422 invalid_request_body). Each lead that changes gets a status-change note on its contact's timeline, as updateLead writes, and a new last_activity_at; nobody is assigned, and the agent's status flow is not applied. dry_run is required: send dry_run: true first, which returns how many leads would change and changes nothing. A changed of 0 means there is nothing to change: don't send the real call. Otherwise send the same query with dry_run: false and that number as max_changes: if more would change by then, nothing changes (409 too_many_leads); send a dry run again and confirm the new number. Leads change in batches of 1,000, so if a call fails part way, the leads already changed stay changed: send a dry run again to see how many are left, then the call with that number. Admin rank on the agent, as in the dashboard.

Request​

Responses​

How many leads changed, or would change on a dry run.

Response Headers
    X-Correlation-ID

    Correlation id for this request — paste into support tickets.