Skip to the page

Errors

unsupported_media_type

415 Unsupported media type. The body isn’t a type the endpoint reads: JSON for most, a multipart form for file uploads, and only the file types listed for files.

StatusCodeRetry?
415 Unsupported media typeunsupported_media_typeAfter fixing it

What it means

The body isn’t a type the endpoint reads: JSON for most, a multipart form for file uploads, and only the file types listed for files.

Common causes

  • Content-Type is missing or isn’t application/json.
  • A file upload isn’t multipart/form-data.
  • The file is a type Messages can’t send.

What to do

Send Content-Type: application/json.

Can I retry it?

Only after you fix what the message names. Until then the same request gets the same answer.

What the answer looks like

Response415
{
  "error": {
    "code": "unsupported_media_type",
    "message": "Send `Content-Type: application/json`.",
    "hint": "Send `Content-Type: application/json`.",
    "doc_url": "https://usebluebot.com/docs/errors/unsupported_media_type",
    "request_id": "req_1Hq2LxW9cVbN3mKpRtYs0a"
  }
}

Branch on code, which never changes. message and hint are written for people and may be reworded. Quote request_id when you write to support.

  • Errors: the envelope and every code
  • Idempotency: retrying without sending twice
  • Limits: every cap and what happens when you reach it