Returns the authenticated user, whether the token is OAuth, and reachable accounts.
curl -s "https://twilinker.com/api/messaging/me" \ -H "Authorization: Bearer $TWILINKER_TOKEN" \ -H "Accept: application/json"
Send WhatsApp (Cloud API & OpenWA) and SMS messages, inspect delivery receipts, manage templates, configure webhooks, and monitor dispatches over a single REST interface.
All requests and responses use JSON (Accept: application/json, Content-Type: application/json).
Every per-sender endpoint is scoped by numeric {wabaSender} ID and enforces workspace ownership.
| Status | Meaning |
|---|---|
200 OK / 201 Created | Request succeeded or message/dispatch queued. |
401 Unauthorized | Missing, invalid, or expired Bearer token. |
402 Payment Required | Account subscription has ended (code: "subscription_required"). Renew to resume sending. |
403 Forbidden | OAuth token lacks the required scope or cannot reach that sender/account. |
404 Not Found | Sender, message, dispatch, or template does not exist (or does not belong to this sender/account). |
422 Unprocessable Entity | Validation error (invalid phone number, missing fields, or unsupported driver action). |
Authenticate every request with a Bearer token in the Authorization header.
Twilinker accepts both Sanctum personal API keys (full access to your workspaces) and
Passport OAuth 2.0 access tokens (scoped per sender and per ability via consent screen).
Authorization: Bearer YOUR_API_OR_OAUTH_TOKEN Accept: application/json Content-Type: application/json
Active subscription require a serving subscription when the account has a subscription record. If your subscription has ended, sending returns 402 with code: "subscription_required". Read endpoints stay available.
| Scope | Description |
|---|---|
mcp:use |
Send WhatsApp messages and manage templates through an AI assistant
Implies: messages:send, templates:write |
accounts:read |
See the details of its account |
senders:read |
See the details of this sender |
templates:read |
See the message templates of its account |
templates:write |
Create message templates and submit them for approval |
messages:read |
Read messages, their delivery status and their media |
messages:send |
Send messages from this sender |
Inspect the authenticated identity, reachable workspaces, and WhatsApp senders.
Returns the authenticated user, whether the token is OAuth, and reachable accounts.
curl -s "https://twilinker.com/api/messaging/me" \ -H "Authorization: Bearer $TWILINKER_TOKEN" \ -H "Accept: application/json"
Lists all workspace accounts reachable by the current token.
curl -s "https://twilinker.com/api/messaging/accounts" \ -H "Authorization: Bearer $TWILINKER_TOKEN" \ -H "Accept: application/json"
Lists reachable WhatsApp senders (Cloud API & OpenWA). Optional query filter: ?account_id=12.
curl -s "https://twilinker.com/api/messaging/senders?account_id=12" \ -H "Authorization: Bearer $TWILINKER_TOKEN" \ -H "Accept: application/json"
Inspect sender metadata, live connection health, approved templates, and OpenWA WhatsApp groups.
Returns sender configuration, phone number, driver (Cloud API vs OpenWA), and status.
Returns live connection state (connected, driver, and OpenWA session status when applicable).
curl -s "https://twilinker.com/api/messaging/123/status" \ -H "Authorization: Bearer $TWILINKER_TOKEN" \ -H "Accept: application/json"
Lists approved templates available for sending from this WhatsApp sender.
Lists cached WhatsApp groups (?search=, ?page_size=20) or triggers a live sync from the OpenWA gateway via POST /groups/sync.
Queue single messages, templates, bulk dispatches, or typing indicators.
Sends a single WhatsApp message (text, image, document, audio, video, location, contacts, interactive) directly over REST โ no client SDK required. On OpenWA senders, to also accepts chat IDs ([email protected], ...@lid) and group IDs ([email protected]).
curl -s -X POST "https://twilinker.com/api/messaging/123/quick-send" \
-H "Authorization: Bearer $TWILINKER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "+212600000000",
"type": "text",
"text": { "body": "Hello from Twilinker!" }
}'
const res = await fetch("https://twilinker.com/api/messaging/123/quick-send", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TWILINKER_TOKEN}`,
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({
to: "+212600000000",
type: "text",
text: { body: "Hello from Twilinker!" },
}),
});
const data = await res.json();
console.log(data);
import os, requests
res = requests.post(
"https://twilinker.com/api/messaging/123/quick-send",
headers={
"Authorization": f"Bearer {os.environ['TWILINKER_TOKEN']}",
"Accept": "application/json",
},
json={
"to": "+212600000000",
"type": "text",
"text": {"body": "Hello from Twilinker!"},
},
timeout=30,
)
print(res.json())
<?php
$ch = curl_init("https://twilinker.com/api/messaging/123/quick-send");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("TWILINKER_TOKEN"),
"Content-Type: application/json",
"Accept: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"to" => "+212600000000",
"type" => "text",
"text" => ["body" => "Hello from Twilinker!"],
]),
]);
$response = curl_exec($ch);
curl_close($ch);
echo $response;
Sends an approved WhatsApp Business template with optional variable components (Cloud API).
curl -s -X POST "https://twilinker.com/api/messaging/123/quick-send/template" \
-H "Authorization: Bearer $TWILINKER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "+212600000000",
"template": "order_shipped",
"language": "en_US",
"components": [
{
"type": "body",
"parameters": [
{ "type": "text", "text": "ORD-4821" }
]
}
]
}'
const res = await fetch("https://twilinker.com/api/messaging/123/quick-send/template", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.TWILINKER_TOKEN}`,
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({
to: "+212600000000",
template: "order_shipped",
language: "en_US",
components: [{ type: "body", parameters: [{ type: "text", text: "ORD-4821" }] }],
}),
});
console.log(await res.json());
import os, requests
res = requests.post(
"https://twilinker.com/api/messaging/123/quick-send/template",
headers={"Authorization": f"Bearer {os.environ['TWILINKER_TOKEN']}"},
json={
"to": "+212600000000",
"template": "order_shipped",
"language": "en_US",
"components": [{"type": "body", "parameters": [{"type": "text", "text": "ORD-4821"}]}],
},
)
print(res.json())
<?php
$ch = curl_init("https://twilinker.com/api/messaging/123/quick-send/template");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("TWILINKER_TOKEN"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"to" => "+212600000000",
"template" => "order_shipped",
"language" => "en_US",
"components" => [["type" => "body", "parameters" => [["type" => "text", "text" => "ORD-4821"]]]],
]),
]);
echo curl_exec($ch);
curl_close($ch);
Creates a multi-recipient dispatch and queues messages asynchronously. Returns the created dispatch ID for tracking.
Sends a typing presence indicator on OpenWA senders ({"to": "+212600000000", "state": "typing"}, or "paused").
Query inbound and outbound message history, mark inbound messages as read, and download media attachments.
Paginated message log for this sender. Supports query filters: direction (in|out), status, to, from, search, page_size (1โ100).
curl -s "https://twilinker.com/api/messaging/123/messages?direction=in&page_size=20" \ -H "Authorization: Bearer $TWILINKER_TOKEN" \ -H "Accept: application/json"
const res = await fetch("https://twilinker.com/api/messaging/123/messages?direction=in&page_size=20", {
headers: {
Authorization: `Bearer ${process.env.TWILINKER_TOKEN}`,
Accept: "application/json",
},
});
console.log(await res.json());
import os, requests
res = requests.get(
"https://twilinker.com/api/messaging/123/messages",
params={"direction": "in", "page_size": 20},
headers={"Authorization": f"Bearer {os.environ['TWILINKER_TOKEN']}"},
)
print(res.json())
<?php
$ch = curl_init("https://twilinker.com/api/messaging/123/messages?direction=in&page_size=20");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("TWILINKER_TOKEN"),
"Accept: application/json",
],
]);
echo curl_exec($ch);
curl_close($ch);
Fetches a single message and its delivery/read timestamps (sent_at, delivered_at, read_at, failed_at).
Marks an inbound WhatsApp message as read (blue ticks).
Streams or redirects to the media attachment belonging to an inbound or outbound message.
Track batch sends, inspect failed recipients, and re-queue failed messages.
Lists dispatches for this sender. Drill down with:
GET /{wabaSender}/dispatches/{dispatch} | Single dispatch summary & counts. |
GET /{wabaSender}/dispatches/{dispatch}/messages | Paginated messages in this dispatch (supports ?status=). |
GET /{wabaSender}/send/{dispatch}/failed/ | Failed messages for this dispatch. |
Re-queues failed messages on a dispatch for another delivery attempt.
Configure per-sender webhook URLs and inspect incoming/outgoing webhook delivery attempts.
Read or update webhook_url (delivery & message events) and bot_webhook_url (AI agent webhook) on this sender.
curl -s -X PUT "https://twilinker.com/api/messaging/123/webhooks" \
-H "Authorization: Bearer $TWILINKER_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"webhook_url": "https://example.com/webhooks/twilinker",
"bot_webhook_url": "https://example.com/agent/whatsapp"
}'
const res = await fetch("https://twilinker.com/api/messaging/123/webhooks", {
method: "PUT",
headers: {
Authorization: `Bearer ${process.env.TWILINKER_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
webhook_url: "https://example.com/webhooks/twilinker",
bot_webhook_url: "https://example.com/agent/whatsapp",
}),
});
console.log(await res.json());
import os, requests
res = requests.put(
"https://twilinker.com/api/messaging/123/webhooks",
headers={"Authorization": f"Bearer {os.environ['TWILINKER_TOKEN']}"},
json={
"webhook_url": "https://example.com/webhooks/twilinker",
"bot_webhook_url": "https://example.com/agent/whatsapp",
},
)
print(res.json())
<?php
$ch = curl_init("https://twilinker.com/api/messaging/123/webhooks");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer " . getenv("TWILINKER_TOKEN"),
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode([
"webhook_url" => "https://example.com/webhooks/twilinker",
"bot_webhook_url" => "https://example.com/agent/whatsapp",
]),
]);
echo curl_exec($ch);
curl_close($ch);
Returns recent webhook delivery logs with payloads, HTTP status codes, and errors. Filters: direction (out|in), event, status, page_size.
Manage account-level details and WhatsApp Business message templates (draft, submit to Meta, delete).
GET /account/{account} | Account details & balance (accounts:read). |
GET /account/{account}/senders | Senders belonging to this account (senders:read). |
GET /account/{account}/templates | All templates on this account (templates:read). |
GET /account/{account}/templates/{template} | Single template with components & Meta status (templates:read). |
POST /account/{account}/templates | Create a draft template (templates:write). |
POST /account/{account}/templates/{template}/submit | Submit a draft template to Meta for approval (templates:write). |
DELETE /account/{account}/templates/{template} | Delete a template (templates:write). |
Inspect an SMS sender and send SMS messages.
Fetch SMS sender details (GET) or send an SMS message (POST /send).