TACNow

Quickstart

Overview

TACNow is a delivery-only SMS OTP API. You send a message with a {{code}} placeholder; TACNow substitutes a generated code and delivers it via SMS. You handle verification on your side — TACNow never stores or checks codes.

Base URL

https://api.tacnow.co/v1

All requests require Content-Type: application/json and an Authorization header.


Authentication

Authenticate every request with a Bearer token using an API key from your project dashboard.

Authorization: Bearer sk_live_your_api_key_here

TACNow issues two key types per project:

Key prefixBehaviour
sk_live_Sends real SMS, deducts credits
sk_test_No real SMS, no credit deduction

Keep your live keys secret. Rotate them from the console at any time.


Send OTP

POST /v1/otp/send

Send an OTP to a phone number. TACNow generates a numeric code, replaces {{code}} in your message, and delivers it.

Request body

FieldTypeRequiredDescription
phonestringE.164 format — e.g. +60123456789
messagestringMessage template. Must contain {{code}}. Max 160 chars.
codeLengthintegerOTP length, 4–8 digits. Default: 6
expiresInintegerTTL in seconds (informational only — TACNow doesn't verify). Default: 300

Response

{
  "ok": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "status": "enqueued",
    "mode": "live",
    "phoneMasked": "****6789"
  }
}
curl -X POST https://api.tacnow.co/v1/otp/send \
-H "Authorization: Bearer sk_live_your_key" \
-H "Content-Type: application/json" \
-d '{
  "phone": "+60123456789",
  "message": "Your verification code is {{code}}. Valid for 5 minutes.",
  "codeLength": 6
}'

Test Mode

Use a sk_test_ API key to develop and test without sending real messages or spending credits.

Authorization: Bearer sk_test_your_test_key

In test mode:

Switch to a sk_live_ key when you're ready to go live. No other code changes needed.


Error Codes

All error responses follow this shape:

{
  "ok": false,
  "error": "ERROR_CODE",
  "message": "Human-readable description"
}
CodeHTTPDescription
INVALID_API_KEY401The API key is missing, malformed, or revoked
INVALID_PHONE422Phone number is not in E.164 format or is unsupported
INVALID_TEMPLATE422Message template is missing {{code}} or exceeds 160 characters
INSUFFICIENT_CREDITS402Project wallet has insufficient credits to send
RATE_LIMITED429Request rate exceeds the project's per-minute or per-day limit
PROJECT_ARCHIVED403The project associated with this API key has been archived
IP_NOT_ALLOWED403Request IP is not in the API key's allowlist
INTERNAL_ERROR500An unexpected server error occurred — retry with exponential backoff