Skip to main content

Get Customer Visit Coverage

GET 

/api/crm/customers/:customer/coverage

Get a customer's visit coverage: grade, visit frequency, "Do not schedule visits", the interval that applies, last visit, next visit due date and coverage status.

Required scope: customers:read

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Authentication: Requires Bearer token with the customers scope and the crm_activities.index permission.

The CRM activities feature must be switched on for the account; otherwise every CRM endpoint returns 404.

Visibility: a user who may view all customers, or all CRM activities, can open any customer. Anyone else can open only customers whose default sales rep is their own sales rep; any other customer returns 404, never 403.

Fields: grade is A, B, C or null (Unclassified). interval_days is visit_frequency_days when set, else the grade's interval from CRM settings. next_visit_due_on is the date of the last completed visit (or completed call, when CRM settings count calls) plus interval_days; a customer with an interval but no visit yet is due on grade_set_on. It is null when no interval applies or the customer is excluded from visit planning. last_visit_at counts completed visits only; last_coverage_contact_at is the contact the due date is counted from (the last completed visit, or call when calls count, at its check-in, else start, else completion; UTC). next_planned_visit_at is the earliest planned visit still ahead.

Coverage status (coverage_status.value), against today in the account timezone:

  • on_track: next visit due more than 7 days from today
  • due_soon: due today or within the next 7 days
  • overdue: the due date has passed
  • planned: a planned visit falls on or before the due date; replaces due soon and overdue (an overdue customer whose only planned visit is after the due date stays overdue)
  • not_scheduled: no visit interval applies (no grade and no frequency, or the grade has no interval), or the customer is set to "Do not schedule visits"

Request​

Responses​

OK

Response Headers
    Content-Type