Before proceeding, ensure you have obtained an RCS sandbox agent and API key as described in the prerequisites.
Create a Gemfile in your project directory:
Install the dependencies:
This guide uses version rcs 2.0.15. Requires Ruby version >= 3.3.0
Create an .env file in your project root and add your Pinnacle API key:
To receive inbound RCS messages, you need to configure a webhook in the Pinnacle dashboard:
localhost:4567/inbound-rcsOptionally, you can configure custom HTTP headers (e.g. X-API-KEY) to be
sent on every webhook delivery. Add them in the dashboard or via the
headers field on POST /webhooks/attach.
The PINNACLE-SIGNING-SECRET header is reserved.
Create a new Ruby file (e.g., main.rb) and add the following snippet to the right.
The code above creates a Sinatra endpoint that:
/inbound-rcsStart the Sinatra server:
Your server will start on http://localhost:4567. If you’re using ngrok for local development, start it in a separate terminal:
Use the ngrok URL (e.g., https://abc123.ngrok.io/inbound-rcs) as your webhook endpoint in the Pinnacle dashboard.
Go to localhost:4567/send-rcs/+12345678910 (e.g., to your whitelisted number). If there are no errors, you should see something like
and receive a message on your whitelisted device like this:

If you’re not receiving any messages, make sure you have
If you tap “Hello!”, your whitelisted device should receive a text saying “Hello! Button clicked successfully.” If you reply with a text message, the server will echo it back.
With that, your webhook should now be successfully receiving inbound RCS messages as well as message status updates for outbound messages! You can monitor delivery statuses by filtering events by direction:
For more detail about processing the message payload received, please view the process method.