Send a text message via Sinch Conversation API (SMS/RCS only)
Sends SMS messages to phone numbers using the Sinch Conversation API.
/plugin marketplace add sinch/sinch-plugins/plugin install sinch-claude-plugin@sinch--to=<phone> --message=<text> [--channel=SMS|RCS]api/messages/Send a text message to a recipient using the Sinch Conversation API. Currently supports SMS only (RCS comming soon).
--to / -t: Recipient phone number (E.164 format, e.g., +14155551234) - required--message / -m: Text content - required--channel / -c: Channel (SMS) - optional, defaults to SMS$ARGUMENTS
Parse and validate arguments from $ARGUMENTS:
--to is provided and in E.164 format (e.g., +14155551234)--message is provided and non-empty--channel is not provided, default to "SMS"Call mcp__sinch__send-text-message with the recipient, message, and channel.
Report the result or handle any errors returned by the tool.
If the tool call fails with an error, call mcp__sinch__sinch-mcp-configuration to verify MCP server availability:
mcp__sinch__send-text-message is in the list of available/enabled toolsmcp__sinch__send-text-message is not available. Run /sinch-claude-plugin:sinch-mcp-setup to see setup instructions."Fallback (if MCP is unavailable OR the MCP tool keeps failing): build a direct Conversation API curl request.
Retrieve configuration from environment variables:
CONVERSATION_PROJECT_IDCONVERSATION_REGIONCONVERSATION_APP_IDCONVERSATION_KEY_IDCONVERSATION_KEY_SECRETIf any are missing, report: "Sinch API is not configured. Please set: CONVERSATION_PROJECT_ID, CONVERSATION_KEY_ID, CONVERSATION_KEY_SECRET, CONVERSATION_REGION, CONVERSATION_APP_ID"
Then output a ready-to-run command (do not write scripts/files):
CHANNEL="<SMS>" \
TO="<+14155551234>" \
MESSAGE="<Hello>" \
curl -sS -X POST \
"https://${CONVERSATION_REGION}.conversation.api.sinch.com/v1/projects/${CONVERSATION_PROJECT_ID}/messages:send" \
-u "${CONVERSATION_KEY_ID}:${CONVERSATION_KEY_SECRET}" \
-H "Content-Type: application/json" \
-d "$(cat <<'JSON'
{
\"app_id\": \"${CONVERSATION_APP_ID}\",
\"recipient\": {
\"identified_by\": {
\"channel_identities\": [
{
\"channel\": \"${CHANNEL}\",
\"identity\": \"${TO}\"
}
]
}
},
\"message\": {
\"text_message\": {
\"text\": \"${MESSAGE}\"
}
}
}
JSON
)"
If the direct API call still fails, show the HTTP status + response body, and suggest verifying:
CONVERSATION_APP_IDCONVERSATION_REGION matches where the project is provisioned (e.g., us, eu, br)Send an SMS message:
/sinch-claude-plugin:api:messages:send --to=+14155551234 --message="Hello"