MuleSoft · JSON Threat Protection policy

400 Bad Request from the JSON Threat Protection policy

Short answer

An API protected by the JSON Threat Protection policy returns 400 Bad Request when the JSON body exceeds one of the limits set in the policy. Send a smaller or shallower body, or raise the limit that legitimate requests hit.

VerifiedLast verified

01Error text

MuleSoft error
400 - Bad Request

02Likely causes

  • The request's JSON exceeds a configured limit: Maximum Container Depth, Maximum String Value Length, Maximum Object Entry Name Length, Maximum Object Entry Count or Maximum Array Element Count.

03How to fix it

  1. Compare the rejected body with the policy's five limits in API Manager. A value of -1 means no limit.
  2. If the request is legitimate, raise the limit it exceeds.
  3. Otherwise change the client to send a body within the limits.

iNotes

The policy does not support SOAP APIs or multi-part form requests. The docs give the status code and the limits but no troubleshooting steps.

04Official documentation

Test every fix in a non-production environment before you apply it to production. See how entries are verified.

More for MuleSoft work:Open MuleSoft jobsMuleSoft rates and salariesHire a senior MuleSoft developer

The iPaaS Brief

Subscribe to The iPaaS Brief.

The iPaaS newsletter for the people who run integrations. From iPaaS Group.

Free. You finish on theipaasbrief.com and confirm by email.