MuleSoft · JSON Threat Protection policy
400 Bad Request from the JSON Threat Protection policy
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
400 - Bad Request02Likely 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
- Compare the rejected body with the policy's five limits in API Manager. A value of
-1means no limit. - If the request is legitimate, raise the limit it exceeds.
- 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
→Related errors
- HTTP:BAD_REQUESTHTTP:BAD_REQUEST means the server could not understand the request the HTTP Request operation sent because its syntax was invalid (HTTP 400). Log the outgoing request, compare it with what the server expects, and correct the body, headers or parameters.
- APIKIT:BAD_REQUESTAPIKIT:BAD_REQUEST is the APIkit for REST error type that maps to HTTP status 400 with the response message "Bad request". APIkit validates incoming requests against your RAML or OAS API specification, so compare the failing request with the specification.
- JSON:SCHEMA_NOT_HONOUREDJSON:SCHEMA_NOT_HONOURED means the JSON Module's Validate schema operation found that the document does not match its JSON schema. The error description holds a JSON array with one object per validation error, so read it to see which fields failed.
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