Test with cURL
Test the YourSend API directly from your terminal using cURL.
Send an email
curl -X POST https://api.yoursend.dev/v1/send \
-H "Authorization: Bearer ys_live_..." \
-H "Content-Type: application/json" \
-d '{
"channel": "email",
"to": "user@example.com",
"from": "hello@yourdomain.com",
"subject": "Hello from YourSend",
"html": "<h1>It works!</h1>"
}'Send an SMS
curl -X POST https://api.yoursend.dev/v1/send \
-H "Authorization: Bearer ys_live_..." \
-H "Content-Type: application/json" \
-d '{
"channel": "sms",
"to": "+14155551234",
"body": "Your verification code is 123456"
}'Send OTP
A send becomes an OTP automatically when it has no body, html, or template_id — YourSend generates and sends the code for you. The response includes a message_id you pass to /v1/check to verify.
curl -X POST https://api.yoursend.dev/v1/send \
-H "Authorization: Bearer ys_live_..." \
-H "Content-Type: application/json" \
-d '{
"channel": "sms",
"to": "+14155551234"
}'Verify OTP
curl -X POST https://api.yoursend.dev/v1/check \
-H "Authorization: Bearer ys_live_..." \
-H "Content-Type: application/json" \
-d '{
"message_id": "8f14e45f-ceea-467a-9b3a-1d2c3e4f5a6b",
"code": "123456"
}'