Send a text from your code.
TextRail is a simple SMS API. Get a key, top up, and send any text up to 160 characters, worldwide, for 2 cents.
Sample recipient: To +1 416 555 0123
40 of 160
Fits in one SMS. 2 cents.
curl https://textrail.devflovv.com/api/v1/sms \
-H "Authorization: Bearer $TEXTRAIL_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "+14165550123",
"message": "Your table for two is ready. Come on in."
}'Nothing is sent from this page. Run the request with your own key.
Verification codes are built in.
Ask for a code and TextRail makes one and texts it. Send back what your user typed and get a yes or a no. Codes have 6 digits, last 5 minutes and allow 5 tries.
Each code is one message at the normal price. How it works
curl https://textrail.devflovv.com/api/v1/otp/send \
-H "Authorization: Bearer $TEXTRAIL_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"phoneNumber": "+14165550123",
"purpose": "login"
}'curl https://textrail.devflovv.com/api/v1/otp/verify \
-H "Authorization: Bearer $TEXTRAIL_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"requestId": "otp_01KA7QX8C2HF6TN3PV9WD4MK7S",
"code": "482913"
}'You pay for what was sent.
Every message reports where it is, so your code never has to guess. If a message does not go out, it costs nothing.
- Queued
Accepted. 2 cents is held from your balance.
- Sending
On its way out.
- Sent
Sent to the carrier. The 2 cents is charged.
- Delivered
The carrier reported that it arrived.
Any other ending is free. The hold goes back to your balance.
- Failed
It did not go out.
- Expired
It could not go out in time.
- Unknown
We could not confirm it, so it is not resent.
One price, everywhere.
Top up your balance and each message spends 2 cents, whichever country it goes to.
- Price
- 2 cents per SMS
- Top-up
- $10 minimum
- Subscription
- None
Know what it isn’t.
A few things TextRail leaves out on purpose.
Outgoing only
TextRail sends messages. It can’t receive replies.
One SMS per message
Text over the limit is refused, never split into parts. Emoji and scripts outside the GSM alphabet allow 70 characters.
Prepaid
There are no invoices. When your balance runs out, sending stops until you top up.