19056: Input request content type is invalid
API
ERROR
This error is returned when an API request's Content-Type header is not one of the formats Twilio APIs accept for requests, causing Twilio to reject the payload. Twilio's error entry lists this as "Input request content type is invalid," and Twilio documents that API requests must use application/x-www-form-urlencoded or multipart/form-data.
- The request was sent with
application/jsoninstead ofapplication/x-www-form-urlencodedormultipart/form-datarequired for Twilio REST API requests. Some endpoints explicitly documentapplication/x-www-form-urlencodedas the encoding type. - The body encoding does not match the declared
Content-Typeheader (for example, JSON data while declaringapplication/x-www-form-urlencoded). Twilio guidance emphasizes that body content must align with the declared content type. - An endpoint that expects file uploads was called without providing the appropriate
Content-Typeand payload format (for example, media upload workflows that require settingContent-Typeto the file's MIME type and sending the file content accordingly).
- Set the
Content-Typeheader to an accepted type for Twilio API requests—application/x-www-form-urlencodedormultipart/form-data—and ensure the payload is encoded to match. - Check the specific endpoint's API reference for its required encoding and adjust your request accordingly (for example, some Messaging resources state "Encoding type: application/x-www-form-urlencoded").
- For media or file-upload endpoints, set
Content-Typeto the correct MIME type and send the payload in the documented format (e.g., binary body when instructed).