# List rep accounts `GET` `/api/v1/crm-connections/{crm_connection_id}/bookbuilder/reps/{rep_id}/accounts` Returns a paginated list of accounts owned by the rep, optionally scoped to on-book or off-book accounts, with optional per-account metrics. See the ``metrics`` parameter for the list of supported metric names. ## Path parameters | Name | Type | Required | Description | |------|------|----------|-------------| | crm_connection_id | string | yes | UUID of the CRM connection | | rep_id | string | yes | Salesforce User ID of the rep | ## Query parameters | Name | Type | Required | Description | |------|------|----------|-------------| | metrics | string | no | Comma-separated list of per-account metric names. Supported: total_activities, contacts_reached, open_opps, open_pipeline, created_opps, created_pipeline, activity_threshold_status, per_activity_count. When per_activity_count is included the response returns a list of {activity_id, activity_name, count} per account. start_date and end_date are required unless every requested metric is a snapshot (open_opps, open_pipeline). | | start_date | string | no | Start of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when a time-scoped metric is requested. | | end_date | string | no | End of the metrics window (inclusive), formatted as YYYY-MM-DD. Required when a time-scoped metric is requested. | | scope | string | no | Filter to accounts in the rep's book. | | query | string | no | Partial-match name search across the rep's accounts. | | sort_by | string | no | Account SObject field to sort by (e.g. Name, CreatedDate). Metric names are not supported as sort keys. | | sort_direction | string | no | ASC or DESC | | offset | integer | no | Pagination offset (default 0, max 2000). | | limit | integer | no | Page size (default 50). | | fields | string | no | Comma-separated list of additional Account fields to include in the response (up to 20). Supports dotted relationship paths, e.g. Owner.Name. Returned per account under the `fields` key. | | hierarchy_rollup_enabled | string | no | When true, expands the account list to include child accounts via the org's configured account hierarchy, with a children array per parent account. Returns 400 if account hierarchy is not configured in the Salesforce org. | ## Response `200 OK` — `application/json` | Field | Type | Description | |-------|------|-------------| | accounts | array[object] | — | | accounts.id | string | — | | accounts.name | string | — | | accounts.fields | object | Requested additional Account fields keyed by field name. Null when the caller did not request fields. | | accounts.metrics | object | Requested metrics keyed by metric name. Null when the caller did not request metrics. Scalar metrics map to int/float/string; per_activity_count maps to a list of {activity_id, activity_name, count}. | | accounts.children | array[object] | Child accounts rolled up under this account when hierarchy_rollup_enabled is true. Null when hierarchy rollup is not enabled. | | offset | integer | — | | limit | integer | — | | total | integer | — | ## Errors | Status | Description | |--------|-------------| | 400 | Bad Request | | 403 | Forbidden | | 404 | Not Found | | 422 | Unprocessable Entity | | 502 | Bad Gateway |