APIYard
Back to APIs
CommunicationBearer TokenFree tier

Twilio

Programmatically send SMS, make and receive phone calls, and build WhatsApp integrations with one unified API.

Base URL

https://api.twilio.com/2010-04-01
SMSvoiceWhatsAppphone numbersverify

Endpoints

POST/Accounts/{AccountSid}/Messages.json

Send an SMS message to a phone number.

const response = await fetch("https://api.twilio.com/2010-04-01/Accounts/YOUR_ACCOUNT_SID/Messages.json", {
  method: "POST",
  headers: {
  "Content-Type": "application/json",
  "Authorization": "Bearer YOUR_ACCESS_TOKEN"
  },
  body: JSON.stringify({
  "From": "+15551234567",
  "To": "+15557654321",
  "Body": "Hello from Twilio!"
})
});

const data = await response.json();
console.log(data);

Response Preview

{
  "sid": "SM123abc",
  "status": "queued",
  "from": "+15551234567",
  "to": "+15557654321",
  "body": "Hello from Twilio!",
  "price": "-0.0079",
  "date_created": "2024-01-15T12:00:00Z"
}