Skip to content

bad_request

HTTP 400 · code bad_request

The request was malformed: invalid JSON, a missing field, or a value the handler could not use.

Returned by photon.DecodeJSON when the body is not valid JSON, contains trailing data after the JSON value, or does not match the target type, and by your own handlers through photonerr.BadRequest(msg). The message names the problem without echoing the request content.

Fix the request. Retrying the same request will fail the same way.

{
"type": "https://photon.agenticmarket.dev/errors/bad_request",
"title": "bad request",
"status": 400,
"code": "bad_request"
}

Match on the code field rather than on title, which is meant for people and may change. See all error codes.