# Event Queues

Manage event queues for sequenced multi-step workflows (drip campaigns, follow-up sequences).

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

## Endpoints

### GET /event-queues

List all event queues.

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

### GET /event-queues/:id

Retrieve an event queue with its steps.

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

### POST /event-queues

Create an event queue.

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

### PATCH /event-queues/:id

Update an event queue.

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

### DELETE /event-queues/:id

Delete an event queue.

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

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

Add a step to an event queue.

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

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

Update an event queue step.

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

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

Delete an event queue step.

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

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

List enrollment timer tasks for an event 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](./event-queues/get-event-queues-id-enrollments.md)

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

Enrol contacts into an event queue in bulk. Requires EXACTLY ONE of three mutually exclusive targeting modes:

- contact_ids -- explicit list of contact UUIDs (max 500)
- 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 (not filterable here -- use automations with deal triggers instead).

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](./event-queues/post-event-queues-id-bulk-enroll.md)
