> For the complete documentation index, see [llms.txt](https://www.docpartner.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.docpartner.dev/en/api/sms-partner/rcs/rcs-scenario.md).

# RCS Scenario

This request starts an RCS scenario for a list of numbers from its identifier (token).

{% hint style="info" %}
To enable this feature, please [contact the technical team](https://www.smspartner.fr/contact/)
{% endhint %}

## Overview

An **RCS scenario** is an automated dialogue configured on the platform: an entry message, clickable suggestions, and bot replies depending on the recipient's choices.

This route **starts a scenario** for a list of numbers by simply providing its identifier (`scenarioToken`), without having to rebuild its content. Once the entry message has been sent, the rest of the dialogue (bot replies to clicks) is **handled automatically** by the platform.

The identifier can also be pasted into our modules and connectors (PrestaShop, WooCommerce, Zapier, Make…) wherever an “RCS scenario identifier” is requested.

{% hint style="info" %}
The identifier only designates the scenario to start. It does not expire, is not an authentication secret, and is recognized only for the account that owns the scenario (resolution based on the `apiKey`). The `apiKey` remains mandatory.
{% endhint %}

The identifier is available in **RCS Scenarios** (`/dashboard/rcs/scenario`), “API Identifier” column, **Copy identifier** button.

## URL

<mark style="color:green;">`POST`</mark> `https://api.smspartner.fr/v1/rcs/scenario/to/send`

Rate limit: 30 requests / 60 seconds *(see* [Rate limiting)](/en/api/sms-partner/rate-limiting.md)*)*

{% hint style="warning" %}
The platform does not send commercial SMS messages between **8 PM and 8 AM on weekdays and on Sundays and public holidays** (legal restriction). If a commercial SMS is sent, the message is **paused until the next working day at 8 AM**.\
Not sending commercial SMS messages? Contact us to disable this restriction: <help@smspartner.fr>
{% endhint %}

#### **Required Parameters**

<table data-full-width="false"><thead><tr><th width="180">Name</th><th>Value</th></tr></thead><tbody><tr><td><code>apiKey</code></td><td><a href="https://my.smspartner.fr/dashboard/api/paramaters">Your API key</a></td></tr><tr><td><code>scenarioToken</code></td><td>Identifier of the RCS scenario to start. The scenario must be <strong>validated / activated</strong> on the platform.</td></tr><tr><td><code>phoneNumbers</code></td><td><p>Recipient phone numbers.<br>To send to multiple recipients, the numbers must be separated by commas. <strong>The limit per request is 500 numbers.</strong><br>They can be:</p><ul><li>in national format (06xxxxxxxx) or international format (+336xxxxxxxx), for French numbers.</li><li>in international format (+496xxxxxxxx), for non-French numbers.</li></ul></td></tr></tbody></table>

{% hint style="info" %}
You do **not** send any `richContent`: the content comes from the scenario.
{% endhint %}

#### **Optional Parameters**

<table><thead><tr><th width="227">Name</th><th>Value</th></tr></thead><tbody><tr><td><code>sender</code></td><td>Sender of the fallback SMS (<code>failover</code>).</td></tr><tr><td><code>tag</code></td><td>Free label to find the send later (3 to 20 characters, no spaces).</td></tr><tr><td><code>scheduledDeliveryDate</code></td><td>Send date in <code>dd/mm/YYYY</code> format (scheduled send).</td></tr><tr><td><code>time</code></td><td><p>Send time (0-24 format).</p><div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p>If <code>scheduledDeliveryDate</code> is set, this parameter is required.</p></div></td></tr><tr><td><code>minute</code></td><td><p>Send minute (0-55 format, in five-minute intervals).</p><div data-gb-custom-block data-tag="hint" data-style="danger" class="hint hint-danger"><p>If <code>scheduledDeliveryDate</code> is set, this parameter is required.</p></div></td></tr><tr><td><code>scheduledAt</code></td><td>Scheduled send as a single value: absolute date (<code>2026-05-20 10:15</code>, <code>20/05/2026 10:15</code>, ISO 8601…) or relative delay (<code>+2 hours</code>, <code>+3 days</code>…). Replaces <code>scheduledDeliveryDate</code> / <code>time</code> / <code>minute</code>. The resulting date must be in the future and at most 3 months ahead.</td></tr><tr><td><code>sandbox</code></td><td><code>true</code> = simulation, no real send.</td></tr><tr><td><code>urlDlr</code></td><td>Callback URL for delivery receipts.</td></tr><tr><td><code>urlResponse</code></td><td>Callback URL for replies / interactions.</td></tr><tr><td><code>failover</code></td><td>Fallback SMS if the RCS is not delivered: <code>{ "message": "...", "sender": "..." }</code>.</td></tr></tbody></table>

#### Requests

{% tabs fullWidth="true" %}
{% tab title="PHP" %}

```php
<?php
        // Prepare data for POST request
        $fields = array(
            'apiKey'=> 'YOUR API KEY',
            'scenarioToken'=> 'SCENARIO_TOKEN',
            'phoneNumbers'=> '+336xxxxxxxx',
            'tag'=> 'cart-reminder',
            'failover'=> array(
                'sender'=> 'MyBrand',
                'message'=> 'Your cart is waiting: https://example.com/cart'
            )
        );


        $curl = curl_init();
        curl_setopt($curl, CURLOPT_URL,'https://api.smspartner.fr/v1/rcs/scenario/to/send');
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_TIMEOUT, 10);
        curl_setopt($curl, CURLOPT_POST, 1);
        curl_setopt($curl, CURLOPT_POSTFIELDS,json_encode($fields));

        $result = curl_exec($curl);
        curl_close($curl);

        // Process your response here
        echo $result;
?>
```

{% endtab %}

{% tab title="VB.net" %}

```vbnet
Imports System.IO
Imports System.Net

Module Module1

  Sub Main()

    Dim base_url As String = "https://api.smspartner.fr/v1/"
    Dim apiKey As String = "YOUR_APIKEY"

    #start rcs scenario
    url = base_url & "rcs/scenario/to/send"
    #note: use a JSON library in production, for example:
    #https//www.nuget.org/packages/Newtonsoft.Json/
    Dim parameters As String = String.Format(
        "{{""apiKey"":""{0}"",""scenarioToken"":""{1}"",""phoneNumbers"":""{2}""}}",
        apiKey,
        "SCENARIO_TOKEN",
        "+33XXXXXXXXX")
    Console.Write(parameters)
    apiRequest("POST", url, parameters)

  End Sub

  Function apiRequest(method As String, url As String, parameters As String) As String

    Dim request As HttpWebRequest
    request = WebRequest.Create(url)
    request.Method = method
    request.Timeout = 10000   # timeout in ms
    request.ContentType = "application/json; charset=utf-8"
    request.ContentLength = 0

    #set POST data
    If Not String.IsNullOrEmpty(parameters) Then
      request.ContentLength = parameters.Length
      Using reqStream As StreamWriter = New StreamWriter(request.GetRequestStream())
        reqStream.Write(parameters)
      End Using
    End If

    #get response
    Dim returnValue As String = Nothing
    Using response As HttpWebResponse = request.GetResponse()
      If response.StatusCode = HttpStatusCode.OK Then
        Using resStream = response.GetResponseStream()
          If resStream IsNot Nothing Then
            Using reader As New StreamReader(resStream)
              returnValue = reader.ReadToEnd()
            End Using
          End If
        End Using
      End If
    End Using
    apiRequest = returnValue

  End Function

End Module
```

{% endtab %}

{% tab title="Python" %}

```python
# std
import json
from collections import OrderedDict

# 3p
import requests

API_KEY = "MY API KEY"
URL = "https://api.smspartner.fr/v1"


def start_scenario(scenario_token, phone_numbers):
    data = OrderedDict([
        ("apiKey", API_KEY),
        ("scenarioToken", scenario_token),
        ("phoneNumbers", phone_numbers),
    ])

    r = requests.post(URL + "/rcs/scenario/to/send", data=json.dumps(data))
    r_json = r.json()
    print(r_json)
    return r_json.get("success") is True
```

{% endtab %}

{% tab title="cURL" %}

```
curl -H  "Content-Type: application/json" -X POST -d '{"apiKey":"xxxxx","scenarioToken":"SCENARIO_TOKEN","phoneNumbers":"+336xxxxxxxx"}' https://api.smspartner.fr/v1/rcs/scenario/to/send
```

{% endtab %}

{% tab title="Nodejs" %}

```javascript
const https = require('https');

// Prepare the data for the POST request
let data = JSON.stringify({
  apiKey: 'YOUR API KEY',
  // identifier of the RCS scenario created and activated in your SMS Partner account
  scenarioToken: 'SCENARIO_TOKEN',
  phoneNumbers: '+336XXXXXXXX',
  tag: 'cart-reminder',
  failover: {
    sender: 'MyBrand',
    message: 'Your cart is waiting: https://example.com/cart'
  }
});

let options = {
  hostname: 'api.smspartner.fr',
  path: '/v1/rcs/scenario/to/send',
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length
  }
};

let req = https.request(options, (res) => {
  let data = '';
  res.on('data', (chunk) => {
    data += chunk;
  });

  res.on('end', () => {
    console.log(JSON.parse(data));
  });

}).on("error", (err) => {
  console.log("Error: " + err.message);
});

req.write(data);
req.end();
```

{% endtab %}

{% tab title="JAVA" %}

```java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;

public class ScenarioRcs {
    public static void main(String[] args) {
        try {
            String apiKey = "your_api_key";
            String scenarioToken = "SCENARIO_TOKEN";
            String phoneNumbers = "+336XXXXXXXX";

            String jsonPayload = "{\"apiKey\": \"" + apiKey + "\", \"scenarioToken\": \"" + scenarioToken +
                    "\", \"phoneNumbers\": \"" + phoneNumbers + "\"}";

            URL url = new URL("https://api.smspartner.fr/v1/rcs/scenario/to/send");
            HttpURLConnection connection = (HttpURLConnection) url.openConnection();
            connection.setRequestMethod("POST");
            connection.setRequestProperty("Content-Type", "application/json");
            connection.setDoOutput(true);

            OutputStream outputStream = connection.getOutputStream();
            outputStream.write(jsonPayload.getBytes());
            outputStream.flush();
            outputStream.close();

            BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));
            StringBuilder response = new StringBuilder();
            String line;
            while ((line = reader.readLine()) != null) {
                response.append(line);
            }
            reader.close();

            System.out.println(response.toString());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
```

{% endtab %}

{% tab title="Swift" %}

```swift
import Foundation

let apiKey = "YOUR_API_KEY"
let scenarioToken = "SCENARIO_TOKEN"
let phoneNumber = "+336xxxxxxxx"

let url = URL(string: "https://api.smspartner.fr/v1/rcs/scenario/to/send")!

var request = URLRequest(url: url)
request.httpMethod = "POST"
request.addValue("application/json", forHTTPHeaderField: "Content-Type")

let parameters: [String: Any] = [
    "apiKey": apiKey,
    "scenarioToken": scenarioToken,
    "phoneNumbers": phoneNumber
]

request.httpBody = try? JSONSerialization.data(withJSONObject: parameters)

let task = URLSession.shared.dataTask(with: request) { (data, response, error) in
    if let error = error {
        print("Error: \(error)")
    } else if let data = data {
        print(String(data: data, encoding: .utf8) ?? "")
    }
}

task.resume()
```

{% endtab %}

{% tab title="Go" %}

```go
package main

import (
	"bytes"
	"encoding/json"
	"io/ioutil"
	"log"
	"net/http"
	"time"
)

func main() {
	data := map[string]interface{}{
		"apiKey":        "YOUR API KEY",
		"scenarioToken": "SCENARIO_TOKEN",
		"phoneNumbers":  "+336xxxxxxxx",
	}

	payload, err := json.Marshal(data)
	if err != nil {
		log.Fatalf("Error preparing data: %v", err)
	}

	client := &http.Client{Timeout: 10 * time.Second}
	req, err := http.NewRequest("POST", "https://api.smspartner.fr/v1/rcs/scenario/to/send", bytes.NewBuffer(payload))
	if err != nil {
		log.Fatalf("Error creating request: %v", err)
	}

	req.Header.Set("Content-Type", "application/json")

	resp, err := client.Do(req)
	if err != nil {
		log.Fatalf("Error sending request: %v", err)
	}
	defer resp.Body.Close()

	body, err := ioutil.ReadAll(resp.Body)
	if err != nil {
		log.Fatalf("Error reading response body: %v", err)
	}

	log.Printf("Response: %s", body)
}
```

{% endtab %}

{% tab title="C#" %}

```csharp
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json;

class Program
{
    private static readonly HttpClient client = new HttpClient();

    static async Task Main(string[] args)
    {
        var request = new
        {
            apiKey = "YOUR_API_KEY",
            scenarioToken = "SCENARIO_TOKEN",
            phoneNumbers = "+336xxxxxxxx"
        };

        var content = new StringContent(
            JsonConvert.SerializeObject(request),
            Encoding.UTF8,
            "application/json");

        HttpResponseMessage response = await client.PostAsync("https://api.smspartner.fr/v1/rcs/scenario/to/send", content);

        if (response.IsSuccessStatusCode)
        {
            var result = await response.Content.ReadAsStringAsync();
            Console.WriteLine(result);
        }
        else
        {
            Console.WriteLine("POST request failed with status code: " + response.StatusCode);
        }
    }
}
```

{% endtab %}
{% endtabs %}

#### Example with SMS fallback and scheduling

```json
{
    "apiKey": "YOUR_API_KEY",
    "scenarioToken": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0",
    "phoneNumbers": ["+33612345678"],
    "tag": "cart-reminder",
    "scheduledAt": "+1 hour",
    "failover": {
        "message": "Your cart is waiting: https://example.com/cart",
        "sender": "MyBrand"
    }
}
```

#### What happens next

1. The scenario's **entry message** is sent to the provided numbers.
2. When a recipient **clicks a suggestion**, the RCS webhook automatically triggers the send of the **next node** of the scenario.

#### **Response**

{% tabs %}
{% tab title="json" %}

```json
{
   "success": true,
   "code": 200,
   "message_id": 123456,
   "nb_rcs": 2,
   "cost": 0.10,
   "cost_conversation": 0.04,
   "currency": "EUR"
}
```

{% endtab %}
{% endtabs %}

#### Errors

{% tabs %}
{% tab title="json" %}

```json
{
    "success": false,
    "code": 64,
    "message": "The RCS scenario is not activated"
}
```

{% endtab %}
{% endtabs %}

#### **Error codes**

<table><thead><tr><th width="234">Response code</th><th>Response</th></tr></thead><tbody><tr><td>1</td><td>The API key is required</td></tr><tr><td>2</td><td><code>phoneNumbers</code> is required</td></tr><tr><td>13</td><td>No default price to this destination</td></tr><tr><td>14</td><td>Number in the STOP list</td></tr><tr><td>50</td><td><code>scenarioToken</code> is required (missing parameter)</td></tr><tr><td>55</td><td>No valid number to send to</td></tr><tr><td>63</td><td>RCS scenario not found: the token does not match any scenario in your account</td></tr><tr><td>64</td><td>The RCS scenario is not activated: the scenario exists but has not been validated / activated on the platform</td></tr><tr><td>65</td><td>The RCS scenario has no entry message / is empty: no valid first node (complete it on the platform)</td></tr><tr><td>96</td><td>IP not allowed</td></tr><tr><td>401</td><td>Account not authorized for RCS</td></tr><tr><td>403</td><td>User not authorized (invalid API key, disabled account…)</td></tr></tbody></table>

All other validations (numbers, scheduling, field sizes, credits…) are identical to a standard RCS send.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://www.docpartner.dev/en/api/sms-partner/rcs/rcs-scenario.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
