# POST /agents/:id/provision

**Resource:** [Agents](./agents.md)  
**Scopes:** `voice-agents:write`  
**Write operation:** yes

Recover an orphan voice agent row (created locally with a UUID agent_id before the provisioning fix). Registers the agent with the voice provider and updates the local row with the real agent_id. Guard: rejects if the agent_id already starts with "agent_" (already provisioned). After provisioning, call /update-flow and /publish to go live.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `id` | path | uuid | yes | Voice agent ID (local row UUID) |

## Request example

```bash
curl -X POST "https://ucqwijexmjctglmrxlej.supabase.co/functions/v1/api/v1/agents/agent-uuid/provision" -H "Authorization: Bearer tp_live_..."
```

## Response example

```json
{"data": {"id": "local-uuid", "agent_id": "agent_abc123", "message": "Voice agent provisioned. Use update_voice_agent_flow / publish_voice_agent next."}}
```

---
Base URL: `https://api.trustpager.com/functions/v1/api/v1` — Auth: `Authorization: Bearer YOUR_API_KEY`