Quickstart
rcs-relay sends Google RCS Business Messaging messages straight to Google RBM over HTTPS. Open RCS keeps the Google credentials, rate limits and billing; you send JSON and read events.
API endpoint: https://relay.open-rcs.io — every sample below targets it.
1. Create an account
POST /accounts is public. Omit password and the service returns a generated one, once — capture it. Confirm the emailed code with POST /accounts/confirm; the response is {"status":"provisioning"} while your API key, usage plan and per-user tables are created asynchronously.
curl -X POST https://relay.open-rcs.io/accounts \
-H 'content-type: application/json' \
-d '{"email":"you@company.fr"}'
# -> { "status": "validation_pending", "password": "<generated>" }
2. Log in
POST /login exchanges the credentials for the Cognito token set. MFA is optional and SMS is the only factor: the default response is the token set itself, and only SMS-enrolled accounts get a {"challenge_name":"SMS_MFA","session":"…"} challenge to replay with mfa_code.
curl -X POST https://relay.open-rcs.io/login \
-H 'content-type: application/json' \
-d '{"username":"you@company.fr","password":"<password>"}'
# -> { "id_token": "eyJ…", "access_token": "…", "refresh_token": "…", "expires_in": 3600 }
Account routes are authorized by API Gateway's Cognito user-pools authorizer. Send Authorization: Bearer <id_token> — not the access_token — then poll GET /account until status is ready.
3. Get the API key
GET /account/api-keys lists your keys (names and dates, never values); open one with GET /account/api-keys/:id to read the value. Messaging routes take it as the x-api-key header.
4. Send a message
curl -X POST https://relay.open-rcs.io/send \
-H "x-api-key: $API_KEY" \
-H 'content-type: application/json' \
-d '{
"agent_id": "cloud_media_test_cigvywkd_agent",
"phone_number": "+33612345678",
"tracking": "campaign-123",
"message": { "text": "Hello from rcs-relay" }
}'
message is passed to Google as contentMessage verbatim, so anything the RBM AgentMessage schema accepts works — text, rich cards, carousels, suggestions. message_id is your idempotency key: retrying it reuses the stored event and does not double-count stats. ttl defaults to 86400 seconds.
A draft agent can only reach its testers. Register handsets with POST /agents/{agent_id}/testers (cap 10). Only a launched agent may message any destination; destinations outside the allowed prefixes (+33 by default) are rejected.
5. Read what happened
GET /events returns the history for a date range of at most 31 days; GET /stats returns zero-filled per-day counters. Both retain data for 365 days.
| event | emitted when |
|---|---|
SENT | the relay accepted the send and called Google |
DELIVERED | the handset acknowledged receipt |
READ | the subscriber opened the message |
FAILED | Google or the carrier rejected it |
USER_MESSAGE | the subscriber replied |
SUGGESTION_RESPONSE | the subscriber tapped a suggestion |
UNSUBSCRIBE | the subscriber opted out |
Every event is also forwarded to your endpoint — see the user-webhook contract.