21705: The Messaging Service is invalid
MESSAGING
ERROR
This error occurs when the MessagingServiceSid in your request is not a valid Messaging Service SID. When you send a message with a Messaging Service, include MessagingServiceSid instead of a From number when appropriate. The value must be a Messaging Service SID that starts with MG and matches the expected SID pattern ^MG[0-9a-fA-F]{32}$.
- The
MessagingServiceSidvalue does not start withMGor does not match the required SID pattern^MG[0-9a-fA-F]{32}$. - You supplied a SID for a different Twilio resource instead of a Messaging Service SID. Twilio resource SIDs are identified by their prefixes, and Messaging Service SIDs use the
MGprefix. - The SID was copied incorrectly when you added it to the request. Messaging Service SIDs are 34 characters long and are shown when you create or manage a Messaging Service.
- Update the request to use a valid
MessagingServiceSidthat starts withMGand matches^MG[0-9a-fA-F]{32}$. - Copy the Messaging Service SID directly from Messaging > Services in the Twilio Console, then resend the request with that exact value.
- If you just created the Messaging Service, use the SID returned for that service and confirm that you are passing the service SID, not another resource SID.