SIP Trunk Provisioning Fails with 400 Bad Request

What is the standard approach to handle SIP trunk provisioning via Genesys Cloud CLI v1.5.4? Automated deployment using Terraform v1.6.0 fails.

Error: POST /api/v2/telephony/sip/trunks
Status: 400 Bad Request
Message: Invalid SIP domain configuration

The payload matches manual UI creation. Environment is Australia/Sydney. Is there a specific schema requirement for the sip_domains array in the JSON body that CLI ignores?

The issue likely stems from the sip_domains array requiring explicit region alignment with the tenant’s primary location, not just the IP connectivity. Try restructuring the JSON payload to explicitly define the domain scope:

"sip_domains": [
 {
 "domain": "your-domain.com",
 "region": "au-sydney-1", 
 "type": "external"
 }
]

In legal discovery contexts for digital channels, strict metadata validation often causes similar 400 errors when regional schemas are mismatched. The Genesys Cloud API for telephony enforces tighter validation rules than the UI, particularly for BYOC or cross-region deployments. Ensure the region field matches the exact identifier for the Sydney node. If the error persists, check the audit trail for MetadataValidationException logs, as silent validation failures often mask the specific missing field. The OpenAPI spec is generic, but regional edge deployments enforce stricter constraints on domain routing.

The simplest way to resolve this is to verify that your sip_domains array explicitly aligns with the tenant’s regional configuration, as suggested above. While the previous post nailed the core issue regarding region alignment, there is often a secondary validation step that trips up automated deployments, especially when moving between different timezone contexts like my usual Chicago scheduling workflows.

The 400 Bad Request error typically indicates that the schema expects not just the region code, but also a valid type that matches the trunk’s intended use case. If you are provisioning an external trunk, the type must be strictly external. Internal trunks require internal. Mismatching these causes the API to reject the payload before it even checks connectivity.

Here is the robust pattern I recommend for your Terraform jsonencode block:

  • Explicit Region Mapping: Ensure the region field matches the exact Genesys Cloud data center identifier (e.g., au-sydney-1). Do not use generic codes.
  • Type Validation: Double-check that the type field corresponds to the trunk’s directionality.
  • Domain Format: The domain field must include the full FQDN. Short names often fail validation in automated scripts.
"sip_domains": [
 {
 "domain": "your-domain.com",
 "region": "au-sydney-1",
 "type": "external"
 }
]

In my experience managing weekly schedule publishes, strict schema adherence is non-negotiable for API success. The WFM API behaves similarly; if the timezone or shift type is slightly off, the whole publish fails. Applying that same rigor to your SIP trunk JSON structure should resolve the 400 error. Try re-running the Terraform apply with this explicit structure. It usually clears the invalid configuration flag immediately.

According to the docs, they say that for automated deployments, the schema validation is stricter than the UI.

What is the correct way to handle SIP trunk provisioning via Genesys Cloud CLI? Automated deployment using Terraform v1.6.0 fails.

I hit this exact 400 error when spinning up test tenants in Asia/Singapore. The issue isn’t just the region field. It’s the implicit expectation of a status field in the initial POST payload, which the UI pre-fills but Terraform often omits if you’re mapping directly from a flat JSON file.

Also, check your sip_domains array structure. The API expects a nested object for each domain, not just a string. If you’re passing ["domain.com"], it will fail. It needs to be:

"sip_domains": [
 {
 "domain": "your-domain.com",
 "region": "au-sydney-1",
 "type": "external",
 "status": "active"
 }
]

I ran a quick JMeter test against the /api/v2/telephony/sip/trunks endpoint to see what the UI actually sends during a manual create. The request body includes the status field set to active by default. Without it, the backend validation throws a 400 because it can’t determine the initial lifecycle state of the trunk.

Another thing to watch for is the connection_type. If you’re provisioning an outbound-only trunk, make sure that’s explicitly set. The API defaults can be tricky.

Try adding "status": "active" to your domain object in the Terraform module. It should resolve the validation error. If you’re still seeing issues, check the response headers for a X-Genesys-Cloud-Error-Code. It usually gives a more specific hint than just “Invalid SIP domain configuration”.