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.
- Open your Terraform configuration file (e.g., main.tf) or your API request payload.
- Locate the display_name attribute for the failing function.
- Append a version number, timestamp, or unique suffix to the name (for example, change "Example Destination" to "Example Destination v2").
- 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.