---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/api/errors/21256#article
headline: "21256: Invalid ruleset"
url: https://www.twilio.com/docs/api/errors/21256
inLanguage: en
dateModified: 2026-06-09T11:00:42.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# 21256: Invalid ruleset

Log Type: APPLICATION

Log Level: ERROR

## Description

Twilio could not process the ruleset in your request because the ruleset is not valid. This error usually occurs when the JSON structure does not match the expected schema or when the ruleset contains duplicate rule names.

### Possible causes

* The request body contains invalid JSON.
* The ruleset structure does not match the schema expected by the API.
* A required ruleset property is missing.
* A property value uses the wrong data type.
* The ruleset contains duplicate rule names.
* The request includes unsupported or misspelled fields.

### Possible solutions

* Validate that your request body contains well-formed JSON before you send it to Twilio.
* Compare your ruleset payload to the API schema for the resource you are updating and remove any unsupported fields.
* Confirm that all required properties are present and that each property uses the expected data type and format.
* Make sure each rule name in the ruleset is unique.
* If you generate the ruleset programmatically, log the final payload and inspect it for serialization issues, missing values, or duplicate entries.
* Retry the request only after you correct the ruleset payload.

#### Additional resources

* [Elastic SIP Trunking](/docs/sip-trunking)
