# Auto Queues

Manage Auto Queues for sequenced multi-step workflows (drip campaigns, follow-up sequences). Legacy path /event-queues is also accepted.

**Base URL:** `https://api.trustpager.com/functions/v1/api/v1`

## Endpoints

### GET /auto-queues

List all auto queues.

**Scopes:** `automations:read` — [full detail](./auto-queues/get-auto-queues.md)

### GET /auto-queues/:id

Retrieve an auto queue with its steps.

**Scopes:** `automations:read` — [full detail](./auto-queues/get-auto-queues-id.md)

### POST /auto-queues

Create an auto queue.

**Scopes:** `automations:write` — [full detail](./auto-queues/post-auto-queues.md)

### PATCH /auto-queues/:id

Update an auto queue.

**Scopes:** `automations:write` — [full detail](./auto-queues/patch-auto-queues-id.md)

### DELETE /auto-queues/:id

Delete an auto queue.

**Scopes:** `automations:write` — [full detail](./auto-queues/delete-auto-queues-id.md)

### POST /auto-queues/:id/steps

Add a step to an auto queue.

**Scopes:** `automations:write` — [full detail](./auto-queues/post-auto-queues-id-steps.md)

### PATCH /auto-queues/:id/steps/:stepId

Update an auto queue step.

**Scopes:** `automations:write` — [full detail](./auto-queues/patch-auto-queues-id-steps-stepId.md)

### DELETE /auto-queues/:id/steps/:stepId

Delete an auto queue step.

**Scopes:** `automations:write` — [full detail](./auto-queues/delete-auto-queues-id-steps-stepId.md)

### GET /auto-queues/:id/enrollments

List enrollment timer tasks for an auto queue. Shows all scheduled step executions with their status, scheduled_for time, enrollment_time (the anchor time used for delay calculation when set via attach_to_event_queue action config), and linked CRM entity IDs (contact, customer, deal). Supports optional status filter and cursor pagination.

**Scopes:** `automations:read` — [full detail](./auto-queues/get-auto-queues-id-enrollments.md)

### POST /auto-queues/:id/bulk-enroll

Enrol contacts (or deals) into an auto queue in bulk. Requires EXACTLY ONE of four mutually exclusive targeting modes:

- contact_ids -- explicit list of contact UUIDs (max 500)
- deal_ids -- explicit list of opportunity/deal UUIDs (max 500). Server resolves each deal to its contacts via crm_deals.contact_id + crm_deal_contacts join, then enrols each unique contact. The originating deal_id is passed as trigger_data.deal_id so downstream automation actions have full deal context.
- contact_filter -- filter by contact-level fields (individual-person fields: contact_type, source, email, first_name, last_name, job_title, city, state, country)
- customer_filter -- filter by company/customer-level fields (account_type, industry, is_customer, is_supplier, city, state, country) -- resolves to all contacts linked to matching customers

ENTITY AXIS DISTINCTION: contact_type lives on crm_contacts (use contact_filter). account_type lives on crm_customers (use customer_filter). opportunity_type lives on crm_deals -- use deal_ids to target specific deals or automations with deal triggers for filter-based targeting.

Idempotent by default: contacts already enrolled with a pending step are skipped (set skip_if_already_enrolled: false to override). Capped at 500 contacts per call; if the filter would match more, has_more: true is returned and you should call again to page through.

**Scopes:** `automations:write` — [full detail](./auto-queues/post-auto-queues-id-bulk-enroll.md)
