# Auto Responders

Per-identity AI reply automation for email and SMS (AI Auto-Responders). Each config binds one phone number or email address to a reply behaviour: enabled on/off, draft-for-review vs auto-send, persona/instructions, tone, and knowledge base grounding. Use test_auto_responder to dry-run the triage+draft pipeline before enabling. All routes require agent-ops:read (reads) or agent-ops:write / agent-ops:delete (writes/deletes). The actual send/queue decision at runtime happens server-side and is not exposed here — this surface is pure config CRUD plus a dry-run test.

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

## Endpoints

### POST /auto-responders

Create or update (upsert by identity) an auto-responder config. identity_kind "phone" needs identity_ref = a phone_numbers.id; "email_config" needs identity_ref = an email_config.id. Defaults: enabled=false, mode="draft" (queues replies for human approval, never auto-sends unless mode="auto_send" is explicitly set).

**Scopes:** `agent-ops:write` — [full detail](./auto-responders/post-auto-responders.md)

### DELETE /auto-responders/:id

Delete an auto-responder config. The identity (number/email) still appears in the Hub list, just unconfigured.

**Scopes:** `agent-ops:delete` — [full detail](./auto-responders/delete-auto-responders-id.md)

### GET /auto-responders/:id

Fetch a single auto-responder config by id.

**Scopes:** `agent-ops:read` — [full detail](./auto-responders/get-auto-responders-id.md)

### GET /auto-responders

List per-identity AI auto-responder configs for the workspace (email/SMS reply automation). Optional filters: channel (sms|email), enabled (true|false).

**Scopes:** `agent-ops:read` — [full detail](./auto-responders/get-auto-responders.md)

### POST /auto-responders/:id/test

Fire a synthetic message through the auto-responder's triage and draft pipeline (TrustPager AI) WITHOUT sending or queuing anything for approval. A dry run to verify behaviour before enabling. Returns the triage category (new_enquiry, sales_pitch, complaint, etc.), the resolved action (auto_respond | escalate | do_nothing), whether the reply would be forced to the approval queue, and the drafted text when one is produced.

**Scopes:** `agent-ops:write` — [full detail](./auto-responders/post-auto-responders-id-test.md)

### PATCH /auto-responders/:id

Update an auto-responder config (enable/disable, change mode, edit persona/instructions/tone/knowledge base, context modules, tools, per-category triage actions).

**Scopes:** `agent-ops:write` — [full detail](./auto-responders/patch-auto-responders-id.md)
