bad_request
HTTP 400 · code bad_request
The request was malformed: invalid JSON, a missing field, or a value the handler could not use.
When Photon sends it
Section titled “When Photon sends it”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.
What the client should do
Section titled “What the client should do”Fix the request. Retrying the same request will fail the same way.
Example response
Section titled “Example response”{ "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.