Reconcile phone numbers
Verify each of a workspace's numbers against its LIVE state at the carrier, the routing-critical check. For every number bound to an agent it compares the environment of its actual voice connection at the carrier with what the DB expects (catching a number silently routing to the WRONG environment or agent) and checks the deletion lock. It also flags a number bound to another workspace's agent (cross-workspace binding, calls answered by another tenant) or to a deleted agent, these are never auto-repaired; repair is unassign_phone_number then re-assign inside the owning workspace. Reports only by default; pass apply=true to auto-repair the SAFE drift (set the deletion lock on live numbers + re-stamp inventory labels from the DB, skipped for a number with a tenancy issue OR connection drift, so apply can't stamp the wrong workspace's slug onto a contested number, or stamp the expected env onto a number that routes somewhere else and hide the fault). Connection drift is REPORTED, never auto-repointed in bulk, repair it one number at a time with assign_phone_number, which repoints it onto this environment's voice connection. Numbers with no stored provider_sid are flagged (they can't be matched to a number at the carrier). Workspace-scoped. This is the strict superset write: it covers everything `sync_phone_number_labels` does (the label re-stamp) PLUS the routing + deletion-lock verification, use sync_phone_number_labels instead when you only need to repair inventory labels and don't need the routing check.
Authorization
bearerAuth A personal access token from Settings > API tokens.
In: header
Header Parameters
A key you choose, such as a UUID, that makes this POST safe to retry. Within 24 hours the same key and request answers with the first successful answer and runs nothing, the same key with a different request answers 422 idempotency_key_reused, and a key whose request is still running answers 409 idempotency_key_in_use. A failed request keeps nothing, so the same key runs it again.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/operations/reconcile_phone_numbers" \ -H "Content-Type: application/json" \ -d '{ "workspace": "string" }'{}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}Re-analyse call POST
Run the post-call analysis again on a call that already has one, with today's analysis prompt, and replace the call's outcome, failure reason, summary and facts. Use it after the analysis changes, to re-grade calls it judged wrong. It sends nothing: a call's first analysis is what sends its alerts, webhooks and follow-ups, so a call with no analysis yet is refused. Returns the outcome and failure reason before and after. Costs one analysis's tokens.
Reject agent prompt improvement POST
Reject an Optimise-Prompt proposal, dismiss a 'proposed' session without applying it. Use this when you don't want the loop's proposed prompt. It marks the session rejected and stores your optional reason for the audit trail; nothing is written to the agent. Only a 'proposed' session can be rejected; an already-resolved one is refused. The session must belong to the current workspace and agent.