# 21656: The ContentVariables Parameter is invalid

Log Type: APPLICATION

Log Level: ERROR

## Description

Twilio returns this error when your `ContentVariables` value is invalid for a message request that uses `ContentSid`. Send `ContentVariables` as a JSON string of key value pairs that map template variable numbers to substitution values. If a value is omitted, Twilio uses the template's default placeholder value.

### Possible causes

* `ContentVariables` is not a valid JSON string.
* A variable placeholder in the template is malformed, such as `{{example}`.
* A variable placeholder is empty, such as `{{}}`.
* The `ContentVariables` payload is improperly formatted when you send the message.
* One or more variables resolve to `null` or an empty string at send time.
* A variable value used in the body contains a newline, a tab, or more than four consecutive spaces.

### Possible solutions

* Send `ContentVariables` as a JSON string, such as `{"1":"coupon_code","2":"docs"}`.
* Check every template placeholder and use valid double curly brace syntax. Do not use incomplete or empty placeholders.
* Make sure each variable has a non-empty value when you send the message. Do not pass `null` or an empty string.
* Remove newlines, tabs, and long runs of spaces from variable values used in the body.
* If you want Twilio to substitute a fallback value, define a default placeholder value in the template before you send the message.

#### Additional resources

* [Using Variables with Content Templates](/docs/content/using-variables-with-content-api)
* [Messages resource](/docs/messaging/api/message-resource)
* [Content API FAQs and Troubleshooting](/docs/content/faqs-and-troubleshooting)
