additionalProperties 🔌 API

API Error: Request failed schema validation (must NOT have additional properties / Additional properties are not allowed)

The JSON body doesn’t match the endpoint’s schema — an unknown property, wrong nesting, or a missing required object.

Seen on: REST API

Meaning

Many APIs validate bodies against a JSON Schema or OpenAPI definition. Ajv reports “must NOT have additional properties” or “must have required property 'x'”, Python jsonschema “Additional properties are not allowed ('x' was unexpected)”, OpenAPI validators “request.body should have required property”.

Strict schemas reject extra fields, so a typo in a field name or a field from a newer API version fails even though everything else is right.

Common causes

  • Unknown or misspelled property in the body
  • Object nested at the wrong level (flat vs wrapped in "data")
  • Required sub-object or array item missing
  • Sending a field that only exists in another API version

⚡ Quick fix

  1. Validate the payload against the published schema/OpenAPI file
  2. Remove fields the schema doesn’t define
  3. Check nesting against a docs example

Detailed fix by platform

Node.js

  1. javascript
    import Ajv from 'ajv';
    const validate = new Ajv({ allErrors: true }).compile(schema);
    if (!validate(body)) console.log(validate.errors);

Python

  1. python
    from jsonschema import validate
    validate(instance=payload, schema=schema)  # raises with the exact path

How to diagnose

  1. Path — Which instancePath / field does the error point to?
  2. Schema — additionalProperties, required, nesting
  3. Version — Is the schema for your API version?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.