Taratxt logo

API Reference (v1)

Integrate Taratxt into your applications and gateway devices.

Introduction

The Taratxt REST API allows external systems (such as your CRM, E-commerce platform, or custom backend) to integrate seamlessly with our messaging gateway. You can use these endpoints to send SMS, check message statuses, and manage your messaging traffic programmatically.

Note: IoT Gateway devices connect to Taratxt via MQTT for real-time communication. This REST API is strictly for your application-to-Taratxt integration.

Base URL

https://taratxt.com/api/v1

Authentication

Authenticate your requests by including your API Key (Personal Access Token) in the Authorization header.

Authorization: Bearer YOUR_TOKEN_HERE

Messages API

Endpoints to manage and send SMS messages.

List Messages

Fetch a paginated list of your outbound and inbound messages.

GET /messages

Send Message

Enqueue a new outbound message to be sent by your connected gateway device.

POST /messages

Request Body

Field Type Description
to string The recipient's phone number (international format recommended, e.g. +639...). Required
message string The text content of the SMS. Required
device_id integer Optional. The ID of the specific device to send from. If omitted, Taratxt will automatically route the message through one of your online devices.

Retrieve Message Status

Get the current status (pending, sent, delivered, failed) and details of a specific message.

GET /messages/{id}

Direct Device Messaging

Send a message directly through a specific device, bypassing automatic routing.

POST /devices/{id}/messages

Force Send

By default, Taratxt will reject messages if the target device is offline. You can override this behavior by passing force=true in the request body. The message will be queued and sent as soon as the device reconnects.

OTP (One-Time Password)

Simplified API to generate, send, and verify verification codes.

Send OTP

POST /otp/send
{
  "number": "+639...",
  "length": 6,
  "expires_in": 5
}

Verify OTP

POST /otp/verify
{
  "number": "+639...",
  "code": "123456"
}

Advanced Routing & Security

Auto Number Pinning

When you send a message without specifying a device_id, Taratxt maps that recipient number to the selected gateway device. Future messages to that same number will automatically "sticky" to that device. You can view and reset these pins in the Pinned Numbers section of your device settings.

Per-Number Safe Word

For every pinned number, Taratxt generates a unique Safe Word. This word is sent to your gateway device and can be used to authenticate incoming requests or bypass specific SIM-level filters. These words can be reset or manually edited in your dashboard.