On this page

API

invalid_json

HTTP 400. Invalid JSON

What it means

The body is not a JSON object.

What to do

Send a JSON object with Content-Type: application/json. A bare array, a string or a body that is cut off all end here. With curl, use -d @file.json or --data-binary so that the body is not altered.

Retrying

Do not retry the same request. Change it first.

Example

json
{
  "type": "https://reuseforge.com/docs/api/errors/invalid_json",
  "title": "Invalid JSON",
  "status": 400,
  "detail": "The request body is not valid JSON.",
  "instance": "/api/v1/items/acme/invoice-extractor",
  "code": "invalid_json",
  "request_id": "req_c4v8n2m6x1z3"
}

Every error is application/problem+json (RFC 9457). Branch on code, show detail to people and quote request_id when you ask for help. See the error catalogue.