# POST /voices/sync-provider-catalog

**Resource:** [Voices](./voices.md)  
**Scopes:** `voices:write`  
**Write operation:** yes

Idempotent sync: pulls the upstream provider catalogue, finds same-provider name matches for every local voice (workspace + platform) missing a mapping, and writes the provider voice ID. Already-mapped voices are skipped unless force=true. Returns matched/skipped/unmatched counts per voice.

## Parameters

| Name | In | Type | Required | Description |
|------|----|------|----------|-------------|
| `force` | body | boolean | no | re-evaluate voices that already have a mapping (default false) |
| `voice_id` | body | string | no | Scope sync to a single local voice UUID |

## Request example

```bash
curl -X POST "https://ucqwijexmjctglmrxlej.supabase.co/functions/v1/api/v1/voices/sync-provider-catalog" \
  -H "Authorization: Bearer tp_live_..." \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Response example

```json
{
  "data": {
    "matched": [
      {
        "id": "voice-uuid",
        "name": "Noah",
        "retell_voice_id": "11labs-Noah"
      }
    ],
    "skipped_already_mapped": [],
    "unmatched": [],
    "matched_count": 1,
    "skipped_count": 0,
    "unmatched_count": 0
  },
  "meta": {
    "credits_remaining": 4499
  }
}
```

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