# Agents

Manage AI voice agents and text agents under the unified /agents endpoint. Use ?type=voice or ?type=text to filter listings. The type field is required in the create body.

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

## Endpoints

### GET /voice-agents/calls/:call_id|str

Fetch a voice-agent call by id (UUID or Retell call_id).

**Scopes:** `calls:read` — [full detail](./voice-agents/get-voice-agents-calls-call-id-str.md)

### GET /voice-agents/calls/:call_id|str/recording

Get signed playback URL for a voice-agent call recording.

**Scopes:** `calls:read` — [full detail](./voice-agents/get-voice-agents-calls-call-id-str-recording.md)

### POST /voice-agents/calls/:call_id|str/recording/rehost

Re-host a voice-agent call recording into private storage.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents-calls-call-id-str-recording-rehost.md)

### GET /voice-agents

List voice agents in the workspace.

**Scopes:** `voice-agents:read` — [full detail](./voice-agents/get-voice-agents.md)

### POST /voice-agents

Create a voice agent.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents.md)

### GET /voice-agents/:agent_id

Fetch a voice agent by UUID.

**Scopes:** `voice-agents:read` — [full detail](./voice-agents/get-voice-agents-agent-id.md)

### PATCH /voice-agents/:agent_id

Update a voice agent.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/patch-voice-agents-agent-id.md)

### DELETE /voice-agents/:agent_id

Delete a voice agent.

**Scopes:** `voice-agents:delete` — [full detail](./voice-agents/delete-voice-agents-agent-id.md)

### POST /voice-agents/:agent_id/sync

Sync a voice agent config with the upstream provider.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents-agent-id-sync.md)

### POST /voice-agents/:agent_id/call

Initiate an outbound voice call via this agent.

**Scopes:** `calls:initiate` — [full detail](./voice-agents/post-voice-agents-agent-id-call.md)

### GET /voice-agents/:agent_id/calls

List calls handled by a voice agent.

**Scopes:** `calls:read` — [full detail](./voice-agents/get-voice-agents-agent-id-calls.md)

### POST /voice-agents/:agent_id/update-flow

Replace the voice-agent conversation flow.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents-agent-id-update-flow.md)

### POST /voice-agents/:agent_id/patch-flow

Partial update to the voice-agent flow.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents-agent-id-patch-flow.md)

### POST /voice-agents/:agent_id/update-settings

Update voice-agent settings.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents-agent-id-update-settings.md)

### POST /voice-agents/:agent_id/publish

Publish a voice agent draft to live.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents-agent-id-publish.md)

### POST /voice-agents/:agent_id/provision

Provision a voice agent that was created as an orphan row.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents-agent-id-provision.md)

### POST /voice-agents/:agent_id/apply-template

Stamp a profile/source template onto a target voice agent.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents-agent-id-apply-template.md)

### GET /voice-agents/:agent_id/website-config

List website configs on a voice agent.

**Scopes:** `voice-agents:read` — [full detail](./voice-agents/get-voice-agents-agent-id-website-config.md)

### POST /voice-agents/:agent_id/website-config

Bind a voice agent to a website.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents-agent-id-website-config.md)

### PATCH /voice-agents/:agent_id/website-config/:config_id

Update a voice-agent website config.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/patch-voice-agents-agent-id-website-config-config-id.md)

### DELETE /voice-agents/:agent_id/website-config/:config_id

Delete a voice-agent website config.

**Scopes:** `voice-agents:delete` — [full detail](./voice-agents/delete-voice-agents-agent-id-website-config-config-id.md)

### GET /voice-agents/:agent_id/outbound-config

List outbound-call configs on a voice agent.

**Scopes:** `voice-agents:read` — [full detail](./voice-agents/get-voice-agents-agent-id-outbound-config.md)

### POST /voice-agents/:agent_id/outbound-config

Enable OUTBOUND dialling for a voice agent. Set default_phone_number_id to an imported number: that number becomes the caller ID and is all outbound needs (each call passes the agent itself, so no number-level binding is required and ONE number can be the default for many agents). Do NOT use update_phone_number to bind the number to the agent for outbound; that binding is inbound-only. Per-agent, no website required.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents-agent-id-outbound-config.md)

### PATCH /voice-agents/:agent_id/outbound-config/:config_id

Update an outbound-call config.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/patch-voice-agents-agent-id-outbound-config-config-id.md)

### DELETE /voice-agents/:agent_id/outbound-config/:config_id

Delete an outbound-call config.

**Scopes:** `voice-agents:delete` — [full detail](./voice-agents/delete-voice-agents-agent-id-outbound-config-config-id.md)

### GET /voice-agents/:agent_id/toolkit-access

Check whether a voice agent has toolkit access enabled (a non-expiring agent_toolkit:use key) and whether its in-call booking tools are on the native session-bound endpoints.

**Scopes:** `voice-agents:read` — [full detail](./voice-agents/get-voice-agents-agent-id-toolkit-access.md)

### POST /voice-agents/:agent_id/toolkit-access

Enable agent toolkit access for a voice agent: mint a non-expiring agent_toolkit:use key named after the agent, attach it, migrate the agent in-call booking tools (check_calendar_availability / book_appointment) off the legacy scheduling endpoints onto the session-bound native endpoints carrying that key, and publish. Fixes silent in-call booking failures caused by hand-pasted expiring keys. Idempotent.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/post-voice-agents-agent-id-toolkit-access.md)

### DELETE /voice-agents/:agent_id/toolkit-access

Disable agent toolkit access: deactivate the agent dedicated toolkit key. In-call booking stops working until re-enabled.

**Scopes:** `voice-agents:write` — [full detail](./voice-agents/delete-voice-agents-agent-id-toolkit-access.md)
