50341: Invalid messaging service SID
CHAT
ERROR
You supplied MessagingServiceSid with a value that does not identify a valid Messaging Service. Use a Messaging Service SID only in requests that accept MessagingServiceSid, and make sure it matches the required MG SID format.
- The
MessagingServiceSidvalue does not match the required pattern. A valid Messaging Service SID starts withMGand is followed by 32 hexadecimal characters. - You passed a SID from a different resource type, such as
IS,CH,AC, orSM, instead of a Messaging Service SID. Twilio uses resource-specific SID prefixes, andMessagingServiceSidonly accepts anMGSID. - The SID was truncated, copied with extra characters or whitespace, or otherwise changed so it no longer matches the exact service SID returned by the Console or API.
- If you are migrating a Programmable Chat channel, you included
MessagingServiceSidin the migration request but used a value that is not a valid Messaging Service for that request.
- Copy the Messaging Service SID directly from Messaging > Services in Console, or retrieve it from the Messaging Services API, then resend the request with the exact value.
- Validate
MessagingServiceSidbefore you send the request. It must be exactly 34 characters long and match^MG[0-9a-fA-F]{32}$. - Do not use an Account, Chat Service, Channel, or Message SID in the
MessagingServiceSidfield. Send only theMGSID for the Messaging Service you want to use. - If you are migrating a Chat channel so you can add SMS or WhatsApp participants in Conversations (classic), create or identify the correct Messaging Service first, then include that
MessagingServiceSidin the migration request.