For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Status
OverviewProductsManageAPI ReferenceTutorialsClient Libraries
OverviewProductsManageAPI ReferenceTutorialsClient Libraries
  • Voice Generation
    • Speech-to-Speech
  • Voice Creation
  • Voice Tools
  • Real-Time Agents
    • Overview
      • Overview
      • List Agent Phone Numbers
      • Get Agent Phone Number
      • Create Agent Phone Number
      • Delete Agent Phone Number
      • Force Delete Agent Phone Number
  • Safety & Detection
Status
LogoLogo
On this page
  • HTTP Request
  • URL Parameters
  • Example Request
  • Response (Success)
  • Response (Not Corrupted)
  • Response (Error)
  • Validation Rules
  • When to Use Force Delete
  • Before Force Deleting
  • Step 1: Identify Corrupted Resources
  • Step 2: Manual Cleanup in Twilio
  • Step 3: Force Delete
  • Important Warnings
  • Example Workflow
  • See Also
Real-Time AgentsAgent Phone Numbers

Force Delete Phone Number

Was this page helpful?
Previous

Agent Knowledge Base

Next
Built with

Force delete a corrupted phone number that failed normal deletion. This bypasses external resource cleanup.

HTTP Request

$DELETE https://app.resemble.ai/api/v2/phone_numbers/{id}/force

URL Parameters

ParameterTypeDescription
idintegerThe phone number ID

Example Request

$curl --request DELETE "https://app.resemble.ai/api/v2/phone_numbers/1/force" \
> -H "Authorization: Bearer YOUR_API_TOKEN" \
> -H "Content-Type: application/json"

Response (Success)

1{
2 "success": true,
3 "force_deleted": true,
4 "message": "Phone number force deleted successfully. Please manually cleanup external resources if needed. See: https://docs.resemble.ai/phone-numbers/cleanup"
5}

Response (Not Corrupted)

1{
2 "success": false,
3 "message": "Force delete is only allowed for corrupted phone numbers"
4}

Response (Error)

1{
2 "success": false,
3 "message": "Failed to force delete phone number: Database constraint violation"
4}

Validation Rules

  • Only phone numbers with status “corrupted” can be force deleted
  • Normal phone numbers must use regular delete endpoint

When to Use Force Delete

Use force delete when:

  1. Normal deletion failed: Phone number is marked as “corrupted”
  2. Twilio cleanup failed: External resources couldn’t be cleaned up automatically
  3. Manual cleanup completed: You’ve manually cleaned up Twilio resources
  4. Database cleanup needed: You want to remove the database record

Before Force Deleting

Step 1: Identify Corrupted Resources

When a phone number becomes corrupted, note the external resources that need cleanup:

  • Twilio SIP Trunk SID (from phone number details)
  • Twilio Credential Lists
  • Twilio Connection Policies
  • LiveKit Trunk ID
  • LiveKit Dispatch Rule ID

Step 2: Manual Cleanup in Twilio

  1. Log into Twilio Console
  2. Navigate to Elastic SIP Trunking > Trunks
  3. Find and delete the SIP trunk (use the Trunk SID from step 1)
  4. Navigate to Elastic SIP Trunking > Credential Lists
  5. Delete any credential lists associated with the phone number
  6. Navigate to Elastic SIP Trunking > IP Access Control Lists
  7. Delete any connection policies for the phone number

Step 3: Force Delete

Once manual cleanup is complete, use the force delete endpoint to remove the database record.

Important Warnings

  • No automatic cleanup: Force delete bypasses all external resource cleanup
  • Manual cleanup required: You must manually clean up Twilio resources before force deleting
  • Permanent action: Cannot be undone
  • Orphaned resources: If you don’t manually clean up, resources may remain in Twilio (incurring costs)

Example Workflow

$# 1. Attempt normal deletion
$curl --request DELETE "https://app.resemble.ai/api/v2/phone_numbers/1" \
> -H "Authorization: Bearer YOUR_API_TOKEN"
$# Response: Phone number marked as corrupted
$
$# 2. Note the Twilio Trunk SID from the error message or phone number details
$# Example: TK1234567890abcdef1234567890abcdef
$
$# 3. Manually clean up in Twilio Console
$# - Delete SIP trunk TK1234567890abcdef1234567890abcdef
$# - Delete associated credential lists
$# - Delete connection policies
$
$# 4. Force delete the database record
$curl --request DELETE "https://app.resemble.ai/api/v2/phone_numbers/1/force" \
> -H "Authorization: Bearer YOUR_API_TOKEN"
$# Response: Phone number force deleted successfully

See Also

  • Delete Phone Number - Normal deletion process
  • Phone Numbers Overview - Phone number management overview
  • Twilio SIP Trunking Docs - Twilio cleanup reference