unsupported_media_type
- HTTP status
- 415
- Retry
- No
- Execution
- Nothing was done
- Admin needed
- No
Unsupported media type. The API accepts JSON bodies only. A body with any other Content-Type is refused before it is read.
What it means
The API returns HTTP 415 with error.code set to unsupported_media_type. The default message is: "Request bodies must be sent as application/json."
Common causes
Content-Typemissing or set toapplication/x-www-form-urlencoded,multipart/form-dataortext/plain.
How to identify it
Check the response status (415) and error.code (unsupported_media_type). Branch on error.code, not on the message text: messages can be reworded, codes do not change within v1. Log error.request_id (also sent as the X-Request-Id header) so support can find the request.
How to fix it
- Send
Content-Type: application/jsonwith a JSON body.
Retry guidance
Sending the request unchanged fails the same way. Fix the cause first (see How to fix it), then send it again.
Did anything happen?
This request was refused before any call was placed and before anything was charged.
Idempotency
Nothing was done. Fix the request and send it again; if you sent an Idempotency-Key you may reuse it, because a refused request is not stored.
Who can fix it
The developer who sends the request can fix it; no administrator action is normally needed.
When to contact support
If the error persists after the steps above, contact support@relationsai.com. See Support for what to include (the request_id, the time in UTC, the operation, and whether you used a test or live key) and what never to send (API keys, Authorization headers, webhook signing secrets, recording links, transcripts or customer data).
Example error response
JSON
Incorrect and corrected request
Incorrect: A form-encoded body; the API reads JSON only.
Text
Corrected: The same contact as a JSON body with Content-Type application/json.
Text
Operations that can return this error
POST /calls: Place a callPOST /campaigns: Create a campaignPATCH /campaigns/{campaign_id}: Update a campaignPOST /campaigns/{campaign_id}/recipients: Add recipientsPOST /contacts: Create a contactPOST /contacts/upsert: Create or update a contact by phone numberPATCH /contacts/{contact_id}: Update a contactPOST /dnc-entries: Add a number to the do-not-call listPOST /webhook-endpoints: Create a webhook endpointPATCH /webhook-endpoints/{webhook_endpoint_id}: Update a webhook endpointPOST /webhook-endpoints/{webhook_endpoint_id}/rotate-secret: Rotate a webhook signing secret
See all codes in the error-code reference.