Skip to content

Unsupported media type

HTTP 415unsupported_media_type

When the API answers 415 unsupported_media_type, and how to fix it.

Version v1.1, updated

The type field of every unsupported_media_type response links to this page.

On this page

The body was not sent as JSON. Every write takes a JSON body, with Content-Type: application/json.

At a glance

  • Status: 415 Unsupported Media Type

  • Code: unsupported_media_type

  • Retry: No. Fix the cause first: the same request gets the same answer.

Causes and fixes

Likely cause

How to fix it

The Content-Type header is missing or names another type, such as application/x-www-form-urlencoded.

Send Content-Type: application/json.

Your HTTP library sends a form or a file upload.

Send the body as JSON text, as the examples do.

Example

415 unsupported_media_typeJSON
{
  "code": "unsupported_media_type",
  "detail": "Send the request body as JSON, with \"Content-Type: application/json\".",
  "instance": "/v1/categories",
  "request_id": "a1b2c3d4-0000-4000-8000-0000000000ee",
  "status": 415,
  "title": "Unsupported media type",
  "type": "https://birp.io/developers/errors/unsupported_media_type"
}
  • requests
  • invalid-json
  • errors-overview