Platform API 422 on nice_cxone_ai_bot intent_mapping serialization in provider 1.20.4

The 03:45 JST state sync pipeline choked on the virtual agent configuration again. Terraform 1.9.8 paired with nice-cxone 1.20.4 throws a 422 Unprocessable Entity when pushing updates to nice_cxone_ai_bot. The intent_mapping block refuses to accept the nested entity_resolution array. Console logs show the payload structure matches the OpenAPI spec exactly. Platform doesn’t accept the current format. State drift backup ran successfully at 02:00 JST, so the local state file remains clean.

Tried flattening the nested arrays into a single stringified JSON block. Provider still chokes. Switched to using the raw_api_data argument to bypass the schema validation layer. API returns the same 422 code with a slightly different message about malformed intent thresholds. Checked the CXone UI directly. The bot definition saves fine through the web interface. It’s pointing to a serialization mismatch in the provider request builder.

Sync pipeline usually handles routing skill sets without breaking. This bot resource keeps doing jack all but throwing validation errors. Network traces show the request hits the /api/v2/ai/bots endpoint correctly. Headers include the proper OAuth2 bearer token. Response body contains a generic validation failure. We’ve confirmed the OAuth scope matches the documentation. Provider logs indicate the intent_mapping block gets converted to a flat key-value map before serialization. That conversion strips the required entity_resolution_type enum values. Manual PATCH requests through Postman work fine when the nested structure stays intact.

Current workaround involves exporting the bot definition via REST, running it through a custom JSON formatter, and importing it back into Terraform as a data source. Process works but defeats the purpose of infrastructure as code. State file won’t stop showing phantom diffs on every plan run.

terraform plan output:

nice_cxone_ai_bot.main will be updated in-place

~ resource “nice_cxone_ai_bot” “main” {
~ intent_mapping = {

  • “default_fallback” = true
  • “entity_resolution” =
    }

Changelog doesn’t mention intent_mapping changes. Sync pipeline’s still running.