For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
SupportDashboard
DocsAPI ReferenceWebhooksMethodsUI ComponentsMCP ServerChangelog
  • Documentation
    • Introduction
    • Authentication
    • RCS Support
  • Quickstart
    • SMS
      • Python
        • Send
        • Receive
      • TypeScript
      • Ruby
    • RCS
  • Guides
    • Purchase Phone Numbers
    • Brands
    • Campaigns
    • Messages
    • Branded Test Agents
    • Handling Expired URLs
LogoLogo
SupportDashboard
QuickstartSMSPython

Sending SMS Messages

1from rcs import Pinnacle
2from dotenv import load_dotenv
3import os
4
5# Load environment variables
6load_dotenv()
7
8API_KEY = os.getenv("PINNACLE_API_KEY")
9SENDER_NUMBER = os.getenv("SENDER_NUMBER")
10
11# Initialize the Pinnacle client
12client = Pinnacle(
13 api_key=API_KEY,
14)
15
16# Send an SMS message
17client.messages.sms.send(
18 from_=SENDER_NUMBER,
19 text="Hello, world!",
20 to="+14154746461", # Recipient's phone number
21)
Was this page helpful?
Previous

Receiving SMS Messages

Next
Built with

Prerequisites

Before proceeding, ensure you have obtained a phone number and API key as described in the prerequisites.

Installation

Create a Python virtual environment:

$python3 -m venv venv

Activate the virtual environment:

$source venv/bin/activate

Install the Pinnacle Python SDK:

$pip install rcs

This guide uses version rcs>=2.0.4. Requires: Python <4.0, >=3.8

Configuration

Create an .env file in your project root and add your Pinnacle API key:

PINNACLE_API_KEY="your_api_key" # pnclk_
SENDER_NUMBER="your_phone_number" # +12345678910

Sending Your First SMS

Create a new Python file (e.g., main.py) and add the following code to the right.

Run the script:

$python main.py

If successful, the recipient will receive your SMS message!