SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Destination Function Creation Fails via Terraform API

Issue

When creating a Destination function via the Segment API or Terraform, the deployment fails or times out after approximately 50 seconds. The functions do not appear in the Segment Workspace UI, and Function Admin tokens cannot query or delete them. The deployment logs will show a 400 Bad Request error containing the message: "validation: Destination name cannot be the same as an existing previous name."

 

Product

Segment

 

Environment

Segment Console

 

Cause

The Segment API enforces a strict unique naming rule for functions across a workspace to prevent data routing conflicts. If a function is deleted or renamed, its previous name is retained as a historical record in the backend. When a new function attempts to use this exact previously used name, the API rejects the request immediately. Because the creation is blocked at the API level, the function is never actually created, which is why it remains invisible in the UI and inaccessible via the API.

 

Resolution

To resolve the naming collision and allow the function creation to succeed, you must provide a completely unique display name.

  1. Open your Terraform configuration file (e.g., main.tf) or your API request payload.
  2. Locate the display_name attribute for the failing function.
  3. Append a version number, timestamp, or unique suffix to the name (for example, change "Example Destination" to "Example Destination v2").
  4. Save the configuration and re-run your terraform apply or resubmit your API request.

 

Additional Information 

Because the creation request is rejected upfront by the API, there are no hidden or "stuck" functions that need to be manually deleted using your Function Admin token. Updating the display name is the only required action to unblock the deployment.

Have more questions? Submit a request
Powered by Zendesk