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 (Corrupted - Cleanup Failed)
  • Cleanup Process
  • Failure Handling
  • Common Error Scenarios
  • Invalid Twilio Credentials
  • Network Errors
  • Important Notes
  • See Also
Real-Time AgentsAgent Phone Numbers

Delete Phone Number

Was this page helpful?
Previous

Force Delete Phone Number

Next
Built with

Delete a phone number and clean up external resources (Twilio trunk configuration).

HTTP Request

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

URL Parameters

ParameterTypeDescription
idintegerThe phone number ID

Example Request

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

Response (Success)

1{
2 "success": true,
3 "message": "Phone number deleted successfully"
4}

Response (Corrupted - Cleanup Failed)

1{
2 "success": false,
3 "errors": {
4 "base": ["Failed to cleanup external resources. Phone number marked as corrupted. Please see documentation for manual cleanup: https://docs.resemble.ai/phone-numbers/cleanup"]
5 },
6 "message": "Failed to delete phone number"
7}

Cleanup Process

When deleting a phone number:

  1. Status Update: Phone number is marked as “deleting”
  2. Twilio Cleanup (if configured):
    • Deletes SIP trunk
    • Removes credential lists
    • Removes connection policies
  3. Database Deletion: Phone number record is deleted

Failure Handling

If Twilio cleanup fails:

  • Phone number is marked as “corrupted”
  • Phone number record is kept in database
  • Error message includes cleanup instructions
  • Use Force Delete to remove corrupted phone numbers

Common Error Scenarios

Invalid Twilio Credentials

If Twilio credentials are invalid or expired during deletion:

1{
2 "success": false,
3 "errors": {
4 "base": ["Failed to cleanup external resources. Phone number marked as corrupted."]
5 },
6 "message": "Failed to delete phone number"
7}

Resolution:

  1. Manually clean up Twilio trunk in Twilio console
  2. Use Force Delete to remove the phone number record

Network Errors

If network issues prevent communication with Twilio:

1{
2 "success": false,
3 "errors": {
4 "base": ["Failed to cleanup external resources. Phone number marked as corrupted."]
5 },
6 "message": "Failed to delete phone number"
7}

Resolution:

  1. Wait for network connectivity to restore
  2. Retry deletion (system will attempt cleanup again)
  3. If issues persist, manually clean up and use Force Delete

Important Notes

  • Agent unlinking: Phone numbers are automatically unlinked from agents before deletion
  • Permanent action: Deletion cannot be undone
  • External cleanup: Twilio resources are removed to prevent orphaned configurations
  • Corrupted state: Failed cleanup results in corrupted state requiring manual intervention

See Also

  • Force Delete Phone Number - Force delete corrupted phone numbers
  • Phone Numbers Overview - Learn about phone number management