Skip to content
Last updated

Using AI tools with Conversation API's RCS channel

Note:

This guide includes best practices for using generative AI tools with Sinch's RCS product. Generative AI can make mistakes, and Sinch has limited influence over the output of any given generative AI tool. Ensure you review any code produced by generative AI to confirm its accuracy, stability, and security against our documentation, your environment, and your needs.

You can use various AI tools to facilitate the generation of code that you can use to send RCS messages.

While there are any number of ways to make use of AI tools, we provide guidance on the following methods:

Note that, after your AI tool generates a code sample, you must modify it and provide your account, solution, and recipient-pecific information.

Prerequisites

In order to send an RCS message using the information in this guide, you must first:

  1. Gain access to Sinch's Conversation API and create an access key and secret.
  2. Create a Conversation API app.
  3. Add the RCS channel to your Conversation API app. The guide linked in this step describes how to create an RCS agent. Note that, if you want to test your RCS capabilities without launching the agent (i.e., use the RCS agent in "test" mode prior to launch), you must add your intended recipient's phone number as a test number. This process is described in the linked guide.

Once you've completed the above prerequisites, ensure you collect the following information. You'll need this information to modify any sample code provided by your AI tool(s):

ParameterDescription
Project IDFind your project ID on your Sinch dashboard.
Access key IDYour access key ID value. Find your access key on your Sinch dashboard. This can be used to authenticate with HTTP Basic authentication or to create an OAuth 2.0 access token.
Access key secretYour access key secret value. Find your access secret on your Sinch dashboard. Note that access secrets are only available during initial key creation. This can be used to authenticate with HTTP Basic authentication or to create an OAuth 2.0 access token.
Access tokenIf you decide to use an OAuth 2.0 access token to authenticate, you'll need the token's value when updating any code samples. Note that OAuth 2.0 tokens are useable for one hour.
App IDYour app ID. Find your app ID on your Sinch dashboard.
Region or base URLThe base URL or the region (which is used in the base URL) you'd like to target. Note that you'll only be able to use Conversation API apps configured for same region as the one associated with the server you target. See the list of supported values for more information.
Recipient's phone numberThe phone number of the recipient to which you want to send the message.

Using Sinch's documentation MCP server

In order to generate code samples using AI tools, you may connect directly to Sinch's documentation MCP server. This will make several tools availabe to your system that facilitate endpoint identification, information lookups, and general context-setting.

Note:

Sinch's documentation MCP server provides tools that help you navigate Sinch's documentation. Because Sinch's documentation includes various code samples, it can also help you generate code samples. It will not make calls to the identified endpoints for you; you must include any provided code in your solution and customize it to correctly reference your account and credentials.

The tools are described in the table below. Note that, while you may not have to explicitly call out these tools when designing your prompt (or using the prompts we provide later in this document), you must still ensure the tools are activated in whatever AI environment you work in:

ToolParametersDescription
whoamiNoneReturns information about the authenticated user.
list-apisname?: stringLists available APIs with their context and purpose.
get-endpointsname: stringReturns all endpoints and their descriptions for a specific API.
get-endpoint-infoname: string``path: string``method: stringReturns comprehensive information about a specific endpoint, including parameters, security, and examples.
get-security-schemesname: string``path: string``method: stringGets the security schemes for a specific API.
get-full-api-descriptionname: stringReturns the complete OpenAPI description.
searchquery: stringSearches documentation and returns relevant content for a query.

Connecting to the MCP server

You may connect to our documentation MCP server by clicking the Connect MCP button:

Note:

The AI tools listed in the Connect MCP button drop-down list and the tools described below are for illustrative purposes. You may use our documentation MCP server with any AI tool that can connect to MCP servers.

Alternatively, copy the following URL and add it to your AI tool: https://developers.sinch.com/mcp. Some examples of how to add the Sinch documentation MCP server tools to your AI solution are detailed in the tabs below:

Connect Cursor to the MCP server

  1. In Cursor, open the command palette.
  • macOS: Command + Shift + P
  • Windows/Linux: Ctrl + Shift + P
  1. Type "Open MCP settings" in the command palette.
  2. Select "Add custom MCP".

Cursor opens the mcp.json file.

Configure the MCP server

  1. In mcp.json, add your server configuration:
{
  "mcpServers": {
    "sinch-mcp": {
      "url": "https://developers.sinch.com/mcp"
    }
  }
}
  1. Save the mcp.json file.
  2. Return to MCP settings and confirm the connection.

If authentication is required, select Needs login and complete the sign-in flow. After connecting, Cursor displays the list of available tools.

Test the Cursor connection

In Cursor chat (Agent mode), ask a question that triggers an MCP tool.

Generating code samples using the MCP server

You can use Sinch's documentation MCP server to generate code snippets for your solution. To do so, enter the following prompt after installing the Sinch documentation MCP server:

Generate {YOUR_language} code to send an RCS {YOUR_message_type} message. For authentication, use {BASIC_or_OAUTH2.0}. My app is based in the {REGION_of_YOUR_APP}. {YOUR_additional_instructions}.

Note:

If you are using this guide for testing purposes, you can use your access key and access key secret to authenticate using basic authentication. We recommend using your access key and secret to create a short-lived OAuth 2.0 token when working in production environments.

For example:

Generate Python code to send an RCS carousel message. For authentication, use basic auth (with access key + secret). My app is based in the EU. The cards should have an open URL action, pointing at sinch.com, that should open in a tall webview. For images, use this: https://sinch.com/wp-content/uploads/2025/03/SI-Photo-RCS-Playbook-Hands.png

Using an LLM to ingest Sinch's documentation

When using an LLM with Sinch's documentation site, provide the appropriate context in order to ensure that the LLM provides the best response to your prompt. To use your LLM of choice with Sinch's Conversation API Open API Spec, enter the following prompt:

Using this schema: https://developers.sinch.com/_bundle/docs/conversation/api-reference/conversation.yaml?download generate {YOUR_language} code to send an RCS {YOUR_message_type} message. For authentication, use {BASIC_or_OAUTH2.0}. My app is based in the {REGION_of_YOUR_APP}. {YOUR_additional_instructions}.

Note:

If you are using this guide for testing purposes, you can use your access key and access key secret to authenticate using basic authentication. We recommend using your access key and secret to create a short-lived OAuth2.0 token when working in production environments.

For example,

Using this schema: https://developers.sinch.com/_bundle/docs/conversation/api-reference/conversation.yaml?download generate Python code to send an RCS carousel message. For authentication, use basic auth (with access key + secret). My app is based in the EU. The cards should have an open URL action, pointing at sinch.com, that should open in a tall webview. For images, use this: https://sinch.com/wp-content/uploads/2025/03/SI-Photo-RCS-Playbook-Hands.png

Modifying the generated code samples

Regardless of the method you use to generate your code, you must modify it to include your account, solution, and recipient-specific values.

The values that most commonly must be modified or provided are described in the table below:

ParameterDescription
Project IDFind your project ID on your Sinch dashboard.
Access key IDYour access key ID value. Find your access key on your Sinch dashboard. This can be used to authenticate with HTTP Basic authentication or to create an OAuth 2.0 access token.
Access key secretYour access key secret value. Find your access secret on your Sinch dashboard. Note that access secrets are only available during initial key creation. This can be used to authenticate with HTTP Basic authentication or to create an OAuth 2.0 access token.
Access tokenIf you decide to use an OAuth 2.0 access token to authenticate, you'll need the token's value when updating any code samples. Note that OAuth 2.0 tokens are useable for one hour.
App IDYour app ID. Find your app ID on your Sinch dashboard.
Region or base URLThe base URL or the region (which is used in the base URL) you'd like to target. Note that you'll only be able to use Conversation API apps configured for same region as the one associated with the server you target. See the list of supported values for more information.
Recipient's phone numberThe phone number of the recipient to which you want to send the message.