livekit-phone-admin

Sync Dispatch Rules

Synchronize dispatch rules between database and LiveKit Cloud.

Detects:

  • Orphaned rules: in LiveKit but not in DB (can auto-adopt)
  • Missing rules: in DB but not in LiveKit (can auto-recreate)

Auto-adopt matches orphaned rules to existing phone numbers by comparing the rule's inbound_numbers against the PhoneNumber table, then links them by populating inbound_voice_agent_id and livekit_dispatch_rule_id.

Run this if dispatch rules were manually created via LiveKit dashboard or if you suspect the database is out of sync.

post/api/v1/admin/livekit/phone-assignments/sync

Request body

auto_recreate_missingboolean

Recreate rules in DB but not in LiveKit

auto_adopt_orphanedboolean

Adopt orphaned rules by matching their trunk numbers to PhoneNumber rows and linking them

Response

Successful Response

checkedinteger required

Number of DB rules checked

orphaned_countinteger required

Rules in LiveKit but not in DB

missing_countinteger required

Rules in DB but not in LiveKit

deleted_orphanedinteger required

Orphaned rules deleted (if auto)

recreated_missinginteger required

Missing rules recreated (if auto)

adopted_countinteger

Orphaned rules adopted (linked to existing phones)

orphaned_rule_idsstring[]

IDs of orphaned rules

missing_rule_idsstring[]

IDs of missing rules

adopted_rule_idsstring[]

IDs of adopted rules

errorsstring[]

Any errors

Changes

No recorded changes to this endpoint across all 1 revision of this API.