Connecting RingCentral
Connect a RingCentral account to your tenant using the OAuth authorization flow. Once connected, the gateway can send and receive SMS through the account's phone numbers.
When to use this
- Set up a new tenant for SMS messaging.
- Reconnect after a RingCentral account change or token expiration.
Prerequisites
- An admin API key (Authentication).
- A RingCentral account with at least one SMS-enabled phone number. See the RingCentral documentation for enabling SMS on phone numbers.
How it works
- Generate a connect token — Call
POST /v1/rc/connect-tokento receive a one-time URL that initiates the OAuth flow. - Authorize — Open the
connectUrlin a browser. The user signs in to RingCentral and authorizes the gateway application. - Callback — RingCentral redirects back to the gateway callback URL. The gateway exchanges the authorization code for access and refresh tokens and stores them securely.
- Post-connect setup — The gateway automatically discovers SMS-enabled phone numbers and creates a webhook subscription to receive inbound messages.
Step-by-step
1. Generate a connect token
Request
curl -X POST https://smsgateway-api.onrender.com/v1/rc/connect-token \-H "Authorization: Bearer YOUR_API_KEY"
200 OK
json
{"connectUrl": "/v1/rc/connect?token=abc123..."}
Connect tokens are rate-limited to 5 per tenant per hour. Each token is single-use and expires after a short period.
2. Check connection status
After the user completes the OAuth flow, verify the connection:
Request
curl https://smsgateway-api.onrender.com/v1/rc/status \-H "Authorization: Bearer YOUR_API_KEY"
200 Connected
json
{"connected": true,"expiresAt": "2026-03-08T10:00:00.000Z","rcAccountId": "000000000"}
200 Not connected
json
{"connected": false}
Token lifecycle
- Access tokens expire after approximately 1 hour. The gateway automatically refreshes them using the stored refresh token.
- Refresh tokens have a longer lifetime. If a refresh token expires, the tenant must reconnect through the OAuth flow.
- Webhook subscriptions are created with a 7-day expiration and are renewed automatically.
Phone number discovery
After a successful connection, the gateway queries the RingCentral account for all SMS-enabled phone numbers. These numbers are cached and used to resolve the correct extension when sending messages. Discovery happens automatically during the post-connect setup.
Disconnecting
To disconnect a RingCentral account, call the disconnect endpoint. This removes stored credentials, unsubscribes from webhooks, and clears cached data.
Disconnect
curl -X POST https://smsgateway-api.onrender.com/v1/rc/disconnect \-H "Authorization: Bearer YOUR_API_KEY"
200 OK
json
{"ok": true}
Disconnecting immediately stops all SMS sending and receiving for the tenant. Any messages currently in the queue will fail with a "RingCentral not connected" error.
Common errors
| Status | Error | Cause |
|---|---|---|
| 429 | Too many requests | Connect token rate limit exceeded (5 per tenant per hour). |
| 403 | Tenant suspended or inactive | The tenant is not in active status. |
Related docs
- RingCentral API Reference — Full endpoint details
- Sending SMS — Send messages after connecting
- Receiving SMS — Inbound message flow