Skip to content
v2.7

Openwave SMS

SMS to your app's users through carrier-approved templates, from the console or the REST API, with Idempotency-Key, delivery status, and unsubscribe.

Openwave SMS sends SMS from your app without you having to hire a provider: order notices, reminders, offers. Every SMS goes out from a template (a text with {{variables}}) that the carrier reviews and approves before the first send. There is no free text and no bulk send by topic: each send is one SMS to one number.

In the console, it’s under Messaging → SMS (Openwave): templates, sending, history, and unsubscribed numbers.

Openwave SMS is enabled per organization, by Openwave. Without it, the tab shows “Talk to Openwave to unlock Openwave SMS for this organization”, and creating a template, sending, or unsubscribing a number responds 403 owbase_sms_not_enabled (viewing and removing numbers from the list still work).

Each SMS part costs US$ 0.08 and is charged even if it isn’t delivered. Sending is limited to Brazilian numbers (+55); other countries require Openwave’s approval for your organization, at the agreed price (plan and pricing). A part holds up to 160 characters; accents such as ã, õ, and á, and emoji, drop it to 70 per part (long text becomes several parts; the console preview shows how many). The month’s parts appear in the organization’s usage (“SMS Openwave”).

Under SMS (Openwave) → New template:

  • Name: 3 to 30 lowercase letters, numbers, or _ (like order_update). It’s unique within the project; other projects can’t see or use your templates.
  • Category: transactional (notices, codes, order updates) or marketing (offers and promotions).
  • Text: up to 1,000 characters, with variables between double braces: Your order {{order}} is out for delivery.
  • Example for each variable: required. The size of the example sets the variable’s maximum size when sending (3 times the example, between 40 and 100 characters).

Carrier review rules:

  • at least 20 fixed characters (not counting the variables);
  • no link shorteners (bit.ly and similar): use the full address on your domain;
  • marketing must say how to opt out: a link, website, WhatsApp, or phone number to unsubscribe (“reply STOP” doesn’t count);
  • a link inside a variable only passes with the domain that is in the template.

The template starts In review. Review can take a while and doesn’t notify you: Refresh checks again. If rejected, the template shows the reason. An approved template can’t be edited: to change the text, create another one. The carrier may reclassify a transactional template as marketing.

From the console: Send SMS, with the number, the approved template, the variable values, and the preview with the parts.

Through the REST API, with an API key that has the messages.write scope:

sms-openwave.ts (server)
import { ID } from '@owbase/node';
// Openwave SMS through the Owbase REST API (outside the SDK): API key with messages.write, project in the header.
const response = await fetch('https://cloud.owbase.dev/_owbase/sms/messages', {
method: 'POST',
headers: {
'content-type': 'application/json',
'x-owbase-project': '<PROJECT_ID>',
'x-owbase-key': process.env.OWBASE_API_KEY ?? '',
// One key per message: repeating the request with the same key (up to 24 h) does not send the SMS again.
'idempotency-key': ID.unique(),
},
body: JSON.stringify({ to: '+5511987654321', template: 'order_update', variables: { order: 'A1234' } }),
});
const body = (await response.json()) as { id?: string; segments?: number; type?: string; message?: string };
if (!response.ok) throw new Error(`${response.status} ${body.type}: ${body.message}`);
// { id, to, template, category, segments, status: 'sent', createdAt, …, replayed: false }
console.log(body.id, body.segments);

The same send with curl:

Terminal window
curl -X POST https://cloud.owbase.dev/_owbase/sms/messages \
-H 'content-type: application/json' \
-H 'x-owbase-project: <PROJECT_ID>' \
-H "x-owbase-key: $OWBASE_API_KEY" \
-H "idempotency-key: order-A1234-notice" \
-d '{"to": "+5511987654321", "template": "order_update", "variables": {"order": "A1234"}}'
  • Idempotency-Key (up to 64 visible characters): one per message. Repeating the request with the same key within 24 hours returns the same send with replayed: true, without sending another SMS or charging again. The same key with a different number, template, or variables is refused with 409 owbase_sms_idempotency_conflict. Without the header, Owbase generates one (so a repeat sends another SMS).
  • The variables must be exactly the template’s, each up to its maximum size.
  • A 503 owbase_sms_uncertain response means the send couldn’t be confirmed (the carrier didn’t respond, or accepted it and recording the send failed) and the SMS may have gone out. Repeat with the same Idempotency-Key: the SMS won’t go out twice, and the repeat returns the send if it did go out. Without the header there’s no safe way to repeat: always send your own key.

A send starts as Sent. Delivery is checked automatically every 10 minutes during the first 24 hours, or immediately with Check status in the history (or POST /_owbase/sms/messages/<id>/status, with messages.read). The statuses are: Sent, Delivered, Failed (with the reason), and Uncertain (the 503 above).

The history (GET /_owbase/sms/messages, with messages.read) shows the last 90 days of sends, newest first, 25 per page (?cursor=<id> for the next one), with the number masked.

Anyone who no longer wants marketing SMS from your app goes on the project’s list of unsubscribed numbers (in the console or POST /_owbase/sms/opt-outs with {"number": "+5511987654321"}, scope messages.write). Marketing SMS to a number on the list is refused with 422 owbase_sms_recipient_opted_out, before it goes out. Removing the number from the list (DELETE /_owbase/sms/opt-outs/<number>) applies to this project only. Transactional SMS doesn’t check the list. Each project’s list holds up to 10,000 numbers.

Marketing SMS carries the template’s unsubscribe method. Anyone who opts out through the carrier’s unsubscribe link leaves marketing SMS for all Openwave customers, and Owbase can’t undo that: sending to that number is refused with 422 owbase_sms_recipient_opted_out, and the message says the request applies to all senders.

  • Each SMS counts 1 recipient toward the project’s email and SMS daily limit (10,000 per day; 50,000 on Scale).
  • Openwave’s SMS account has a daily limit of parts, shared among all customers. If it runs out, sending is refused with 429 owbase_sms_platform_limit until 00:00 (Brasília time).
  • The carrier accepts up to 10 SMS per hour to the same number (429 owbase_sms_recipient_rate_limited).
  • Marketing SMS only goes out during the hours the carrier allows for marketing (422 owbase_sms_outside_marketing_hours).
type Status When
owbase_sms_not_enabled 403 The organization isn’t enabled.
owbase_sms_template_invalid 400 The template doesn’t follow the rules (the message says which).
owbase_sms_template_taken 409 A template with that name already exists in the project.
owbase_sms_template_not_found 404 The template doesn’t exist in this project.
owbase_sms_template_not_approved 422 The template is still in review or was rejected.
owbase_sms_variable_invalid 422 A variable is missing, an extra one was sent, or a value exceeds the maximum size.
owbase_sms_number_invalid 400 Number not in international format.
owbase_sms_country 400 Non-Brazilian number without approval for the organization (refused before sending, at no cost).
owbase_sms_idempotency_invalid 400 Idempotency-Key longer than 64 characters or containing a space.
owbase_sms_idempotency_conflict 409 The same Idempotency-Key with a different request.
owbase_sms_recipient_opted_out 422 Marketing to an unsubscribed number (in the project or at the carrier).
owbase_sms_outside_marketing_hours 422 Marketing outside the allowed hours.
owbase_sms_send_failed 422 The carrier couldn’t send it (not charged). Check the number and the template.
owbase_sms_recipient_rate_limited 429 Too many SMS to the same number in the last hour.
owbase_sms_platform_limit 429 Openwave’s SMS account daily limit is exhausted.
owbase_messaging_daily_limit 429 The project’s daily recipient limit is exhausted.
owbase_sms_uncertain 503 The SMS may have gone out: repeat with the same Idempotency-Key.
owbase_sms_unavailable 503 Openwave SMS is down right now. Try again in a moment.

All under https://cloud.owbase.dev/_owbase/sms, with the project in the X-Owbase-Project header and an API key (X-Owbase-Key) or the console session:

Route Scope
GET /_owbase/sms/summary (enablement and today’s usage) providers.read
GET /_owbase/sms/templates providers.read
POST /_owbase/sms/templates {name, category, text, examples} providers.write
DELETE /_owbase/sms/templates/<name> providers.write
POST /_owbase/sms/messages {to, template, variables} messages.write
GET /_owbase/sms/messages and POST /_owbase/sms/messages/<id>/status messages.read
GET /_owbase/sms/opt-outs messages.read
POST /_owbase/sms/opt-outs and DELETE /_owbase/sms/opt-outs/<number> messages.write

In the responses, a message’s status is sent, delivered, failed or uncertain, and a template’s is in_review, approved or rejected. Integrations written for the earlier Portuguese routes (/_owbase/sms/envios, /_owbase/sms/modelos…) keep working unchanged.

Was this page helpful?