Skip to contentSkip to navigationSkip to topbar
Page toolsOn this pageProducts used
Looking for more inspiration?Visit the

21705: The Messaging Service is invalid


ERROR: 21705

error-21705 page anchor
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}$.

Possible causes

possible-causes page anchor
  • The MessagingServiceSid value does not start with MG or 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 MG prefix.
  • 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 MessagingServiceSid that starts with MG and 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.

Additional resources

additional-resources page anchor