4xx
415 Unsupported Media Type
The server does not support the media type of the request body.
What is HTTP 415?
This status code indicates that the server refuses to accept the request because the content type or encoding of the payload is in a format the server does not support for this endpoint. For example, sending XML to an endpoint that only accepts JSON, or uploading an image format the server cannot process. The server should indicate which media types it does support in the response.
Defined in RFC 9110
Common Causes
- Sending a request with Content-Type: application/xml to an endpoint that only accepts application/json
- Uploading a file format that the server does not support, such as sending a TIFF to a JPEG-only endpoint
- Missing or incorrect Content-Type header that does not match the actual body format
- Using a content encoding that the server does not recognize
How to Fix
- Set the correct Content-Type header to match what the server expects
- Convert your data to a format the server supports before sending
- Check the API documentation for the list of accepted media types for each endpoint
- Ensure the Content-Type header matches the actual format of your request body