CMSCommercial ยท Twilio

Twilio API (SMS and Voice, SG numbers)

Programmable SMS, voice, WhatsApp and verification APIs with Singapore phone numbers and local compliance handling (SGNIC registration for SMS sender IDs). The default CPaaS for SG OTP and notification flows.

How to authenticate

4 stops to a working call

  1. 1Sign up at twilio.com; trial account works immediately with verified numbers.
  2. 2Copy Account SID and Auth Token from the console (or create API keys).
  3. 3For SG alphanumeric sender IDs, register via Twilio per SGNIC/IMDA rules (mandatory since 2023, otherwise SMS shows LIKELY-SCAM).
  4. 4Send requests with HTTP Basic auth (SID as username, token as password).

Example request

Request
curl -X POST 'https://api.twilio.com/2010-04-01/Accounts/ACXXXX/Messages.json' -u ACXXXX:AUTH_TOKEN -d 'To=+65XXXXXXXX' -d 'From=SENDER_ID' -d 'Body=Your OTP is 123456'

Example response

Response (truncated)
{"sid":"SMXXXXXXXX","status":"queued","to":"+65XXXXXXXX","from":"SENDERID","body":"Your OTP is 123456"}

Twilio API (SMS and Voice, SG numbers): common questions

Is the Twilio API (SMS and Voice, SG numbers) free?

The Twilio API (SMS and Voice, SG numbers) is listed as paid. Check the official Twilio docs for current pricing.

Does the Twilio API (SMS and Voice, SG numbers) need an API key?

Yes. It uses API key. Sign up at twilio.com; trial account works immediately with verified numbers. Copy Account SID and Auth Token from the console (or create API keys). For SG alphanumeric sender IDs, register via Twilio per SGNIC/IMDA rules (mandatory since 2023, otherwise SMS shows LIKELY-SCAM). Send requests with HTTP Basic auth (SID as username, token as password).

What is the Twilio API (SMS and Voice, SG numbers) endpoint?

The base URL is https://api.twilio.com/2010-04-01. A working example: curl -X POST 'https://api.twilio.com/2010-04-01/Accounts/ACXXXX/Messages.json' -u ACXXXX:AUTH_TOKEN -d 'To=+65XXXXXXXX' -d 'From=SENDER_ID' -d 'Body=Your OTP is 123456'

Notes for AI agents

SG-specific gotcha: unregistered alphanumeric sender IDs get rewritten to LIKELY-SCAM by the national SMS registry; register the sender ID before launch. Trial accounts can only message verified numbers.

Machine-readable version: /api/apis/twilio

On the same line