Agent Skill · Sinch

sinch-conversation-api

Sends and receives omnichannel messages with Sinch Conversation API. One unified API for SMS, WhatsApp, RCS, MMS, Viber, Messenger, and more. Use when sending texts, WhatsApp messages, rich cards, carousels, templates, batch messages, or building multi-channel messaging.

Provider: Sinch Path in repo: skills/sinch-conversation-api/SKILL.md

Skill body

Sinch Conversation API

Overview

One unified API to send and receive messages across SMS, WhatsApp, RCS, MMS, Viber Business, Facebook Messenger, Instagram, Telegram, KakaoTalk, LINE, and WeChat. The API transcodes between a generic message format and channel-specific formats automatically.

Agent Instructions

Before generating code, gather from the user (skip any item already specified in the prompt or context):

  1. Approach — SDK or direct API calls (curl/fetch/requests)?
  2. Language — for SDK: Node.js, Python, Java, or .NET. For direct API: any language, or curl.

When the user chooses SDK, refer to the sinch-sdks skill for installation and client initialization, then to the bundled webhook references and SDK reference linked in Links. Note: .NET SDK support for Conversation API is partial.

When the user chooses direct API calls, refer to the Messages API Reference linked in Links for request/response schemas.

Security: See the Security section below for url fetching policy, handling inbound webhook content, and credential handling.

Getting Started

Agent Credentials handling

Store credentials in environment variables — never hardcode tokens or keys in commands or source code:

export SINCH_PROJECT_ID="your-project-id"
export SINCH_KEY_ID="your-key-id"
export SINCH_KEY_SECRET="your-key-secret"
export SINCH_APP_ID="your-app-id"  # Conversation API App ID — found at https://dashboard.sinch.com/convapi/apps. Not the same as SINCH_PROJECT_ID.
export SINCH_REGION="us"  # us|eu|br, default: us
export SINCH_SMS_SENDER_ID="your-sms-sender-id"  # Alphanumeric or phone number, required for SMS channel

Authentication

Ensure that authentication headers are properly set when making API calls. The Conversation API uses Bearer token authentication:

-H "Authorization: Bearer $SINCH_ACCESS_TOKEN"

See sinch-authentication for full setup, most importantly how to obtain {SINCH_ACCESS_TOKEN} (OAuth2 client-credentials — do not mint your own JWT).

Base URL

Regional — must match the Conversation API app region:

Region URL
US https://us.conversation.api.sinch.com
EU https://eu.conversation.api.sinch.com
BR https://br.conversation.api.sinch.com

Note: Ensure that the base URL matches the region of your Conversation API application. For example, if your app is set up in the EU region, requests to https://us.conversation.api.sinch.com will fail and must instead be directed to https://eu.conversation.api.sinch.com.

First API Call

curl:

curl -X POST \
  "https://$SINCH_REGION.conversation.api.sinch.com/v1/projects/$SINCH_PROJECT_ID/messages:send" \
  -H "Authorization: Bearer $SINCH_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "app_id": "'$SINCH_APP_ID'",
    "recipient": {
      "identified_by": {
        "channel_identities": [{
          "channel": "SMS",
          "identity": "+15551234567"
        }]
      }
    },
    "message": {
      "text_message": {
        "text": "Hello from Sinch Conversation API!"
      }
    },
    "channel_properties": {
      "SMS_SENDER": "$SINCH_SMS_SENDER_ID"
    }
  }'

Ensure the Content-Type header is explicitly set to application/json when making API calls. For example:

-H "Content-Type: application/json"

Omitting this header will result in API errors as the server expects JSON-formatted data.

Verify that the base URL matches the region of your Sinch Conversation API application before making requests.

Using the incorrect base URL will result in 404 errors. Set the region properly in your environment variable, e.g. SINCH_REGION="us".

Key Concepts

Common Patterns

Gotchas and Best Practices

Security

Skill frontmatter

metadata: {"author" => "Sinch", "version" => "1.1.3", "category" => "Messaging", "tags" => "conversation, messaging, sms, whatsapp, rcs, mms, viber, messenger, instagram, telegram, kakao, line, wechat, webhooks, templates", "uses" => ["sinch-authentication", "sinch-sdks"]}