Error
70002: Bad request
Twilio could not parse the request because the request body or parameters are not in the expected format. This error usually occurs when you send malformed JSON, provide a value with the wrong data type, or submit a request that does not match the API's expected schema.
- The request body contains invalid JSON
- A parameter value uses the wrong data type, such as sending a string where an integer is required
- The request includes malformed or unsupported parameter formatting
- The request body does not match the expected structure for the API endpoint
- The
Content-Typeheader does not match the payload format you sent
- Validate the request body before you send it and make sure the JSON is well formed
- Confirm that every parameter uses the expected type and format for the endpoint you are calling
- Review the endpoint documentation and make sure the request body matches the required schema
- Verify that the
Content-Typeheader matches the payload format, such asapplication/jsonfor JSON requests - Log the outgoing request in your application so you can inspect the exact payload and headers being sent
- If you build the request manually, use an official Twilio helper library when possible to reduce formatting errors