Twilio API (SMS and Voice, SG numbers)

Commercial

by Twilio

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

  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"}

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

Related APIs