Send a Whatsapp message
Sends a WhatsApp message using a Telnyx WhatsApp-enabled number. The message body, interactive elements, media, location, and reaction content are specified in the whatsapp_message field. Delivery progress and final disposition are reported asynchronously through messaging webhooks.
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.messages.sendWhatsapp({
from: '+13125551234',
to: '+13125551234',
whatsapp_message: {},
});
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.messages.send_whatsapp(
from_="+13125551234",
to="+13125551234",
whatsapp_message={},
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Messages.SendWhatsapp(context.TODO(), telnyx.MessageSendWhatsappParams{
From: "+13125551234",
To: "+13125551234",
WhatsappMessage: telnyx.WhatsappMessageContentParam{},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messages.MessageSendWhatsappParams;
import com.telnyx.sdk.models.messages.MessageSendWhatsappResponse;
import com.telnyx.sdk.models.messages.WhatsappMessageContent;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MessageSendWhatsappParams params = MessageSendWhatsappParams.builder()
.from("+13125551234")
.to("+13125551234")
.whatsappMessage(WhatsappMessageContent.builder().build())
.build();
MessageSendWhatsappResponse response = client.messages().sendWhatsapp(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.messages.send_whatsapp(from: "+13125551234", to: "+13125551234", whatsapp_message: {})
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->messages->sendWhatsapp(
from: '+13125551234',
to: '+13125551234',
whatsappMessage: [
'audio' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'bizOpaqueCallbackData' => 'biz_opaque_callback_data',
'contacts' => [
[
'addresses' => [
[
'city' => 'city',
'country' => 'country',
'countryCode' => 'country_code',
'state' => 'state',
'street' => 'street',
'type' => 'type',
'zip' => 'zip',
],
],
'birthday' => 'birthday',
'emails' => [['email' => 'email', 'type' => 'type']],
'name' => 'name',
'org' => [
'company' => 'company',
'department' => 'department',
'title' => 'title',
],
'phones' => [
['phone' => 'phone', 'type' => 'type', 'waID' => 'wa_id']
],
'urls' => [['type' => 'type', 'url' => 'url']],
],
],
'document' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'image' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'interactive' => [
'action' => [
'button' => 'button',
'buttons' => [
['reply' => ['id' => 'id', 'title' => 'title'], 'type' => 'reply']
],
'cards' => [
[
'action' => [
'catalogID' => 'catalog_id',
'productRetailerID' => 'product_retailer_id',
],
'body' => ['text' => 'text'],
'cardIndex' => 0,
'header' => [
'image' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'type' => 'image',
'video' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
],
'type' => 'cta_url',
],
],
'catalogID' => 'catalog_id',
'mode' => 'mode',
'name' => 'name',
'parameters' => ['displayText' => 'display_text', 'url' => 'url'],
'productRetailerID' => 'product_retailer_id',
'sections' => [
[
'productItems' => [
['productRetailerID' => 'product_retailer_id']
],
'rows' => [
[
'id' => 'id',
'description' => 'description',
'title' => 'title',
],
],
'title' => 'title',
],
],
],
'body' => ['text' => 'text'],
'footer' => ['text' => 'text'],
'header' => [
'document' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'image' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'subText' => 'sub_text',
'text' => 'text',
'video' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
],
'type' => 'cta_url',
],
'location' => [
'address' => 'address',
'latitude' => 'latitude',
'longitude' => 'longitude',
'name' => 'name',
],
'reaction' => ['emoji' => 'emoji', 'messageID' => 'message_id'],
'sticker' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'template' => [
'components' => [
[
'index' => 0,
'parameters' => [['text' => 'text', 'type' => 'text']],
'subType' => 'quick_reply',
'type' => 'header',
],
],
'language' => ['code' => 'en_US', 'policy' => 'deterministic'],
'name' => 'order_confirmation',
'templateID' => '019cd44b-3a1c-781b-956e-bd33e9fd2ac6',
],
'text' => ['body' => 'Hello from Telnyx!', 'previewURL' => true],
'type' => 'audio',
'video' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
],
messagingProfileID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
type: 'WHATSAPP',
webhookURL: 'webhook_url',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messages send-whatsapp \
--api-key 'My API Key' \
--from +13125551234 \
--to +13125551234 \
--whatsapp-message '{}'curl --request POST \
--url https://api.telnyx.com/v2/messages/whatsapp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "+13125551234",
"to": "+13125551234",
"whatsapp_message": {
"audio": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"document": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"image": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"sticker": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"video": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"interactive": {
"action": {
"name": "<string>",
"button": "<string>",
"buttons": [
{
"type": "reply",
"reply": {
"title": "<string>",
"id": "<string>"
}
}
],
"catalog_id": "<string>",
"product_retailer_id": "<string>",
"sections": [
{
"product_items": [
{
"product_retailer_id": "<string>"
}
],
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
],
"title": "<string>"
}
],
"mode": "<string>",
"parameters": {
"display_text": "<string>",
"url": "<string>",
"flow_message_version": "<string>",
"flow_token": "<string>",
"flow_id": "<string>",
"flow_name": "<string>",
"flow_cta": "<string>",
"flow_action_payload": {
"screen": "<string>",
"data": {}
}
},
"cards": [
{
"card_index": 123,
"type": "cta_url",
"header": {
"image": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"video": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
}
},
"body": {
"text": "<string>"
},
"action": {
"product_retailer_id": "<string>",
"catalog_id": "<string>"
}
}
]
},
"body": {
"text": "<string>"
},
"footer": {
"text": "<string>"
}
},
"location": {
"latitude": "<string>",
"longitude": "<string>",
"name": "<string>",
"address": "<string>"
},
"contacts": [
{
"addresses": [
{
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"country_code": "<string>",
"type": "<string>"
}
],
"birthday": "<string>",
"emails": [
{
"email": "<string>",
"type": "<string>"
}
],
"org": {
"company": "<string>",
"department": "<string>",
"title": "<string>"
},
"phones": [
{
"phone": "<string>",
"type": "<string>",
"wa_id": "<string>"
}
],
"urls": [
{
"url": "<string>",
"type": "<string>"
}
]
}
],
"reaction": {
"message_id": "<string>",
"emoji": "<string>"
},
"biz_opaque_callback_data": "<string>",
"template": {
"template_id": "019cd44b-3a1c-781b-956e-bd33e9fd2ac6",
"name": "order_confirmation",
"components": [
{
"index": 123,
"parameters": [
{
"text": "<string>",
"action": {
"flow_token": "<string>",
"flow_action_data": {}
}
}
]
}
]
}
},
"type": "WHATSAPP",
"webhook_url": "<string>",
"messaging_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"data": {
"record_type": "message",
"direction": "outbound",
"id": "4031938e-60e4-4235-a8dd-0b1c55a23e7a",
"type": "WHATSAPP",
"organization_id": "9f61d8e1-7687-4d6d-9cae-9ff682985983",
"messaging_profile_id": "4001781e-626f-4a41-a914-b1b682150f94",
"from": {
"phone_number": "<string>",
"status": "received",
"carrier": "<string>",
"line_type": "Wireline"
},
"to": [
{
"phone_number": "+13125551234",
"status": "queued",
"carrier": "Verizon Wireless",
"line_type": "Wireless"
}
],
"body": {
"audio": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"document": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"image": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"sticker": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"video": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"interactive": {
"type": "cta_url",
"action": {
"name": "<string>",
"button": "<string>",
"buttons": [
{
"type": "reply",
"reply": {
"title": "<string>",
"id": "<string>"
}
}
],
"catalog_id": "<string>",
"product_retailer_id": "<string>",
"sections": [
{
"product_items": [
{
"product_retailer_id": "<string>"
}
],
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
],
"title": "<string>"
}
],
"mode": "<string>",
"parameters": {
"display_text": "<string>",
"url": "<string>",
"flow_message_version": "<string>",
"flow_token": "<string>",
"flow_id": "<string>",
"flow_name": "<string>",
"flow_cta": "<string>",
"flow_action": "navigate",
"flow_action_payload": {
"screen": "<string>",
"data": {}
},
"mode": "draft"
},
"cards": [
{
"card_index": 123,
"type": "cta_url",
"header": {
"type": "image",
"image": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"video": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
}
},
"body": {
"text": "<string>"
},
"action": {
"product_retailer_id": "<string>",
"catalog_id": "<string>"
}
}
]
},
"body": {
"text": "<string>"
},
"footer": {
"text": "<string>"
},
"header": {
"type": "document",
"document": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"image": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"video": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"text": "<string>",
"sub_text": "<string>"
}
},
"location": {
"latitude": "<string>",
"longitude": "<string>",
"name": "<string>",
"address": "<string>"
},
"contacts": [
{
"addresses": [
{
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"country_code": "<string>",
"type": "<string>"
}
],
"birthday": "<string>",
"emails": [
{
"email": "<string>",
"type": "<string>"
}
],
"name": {
"formatted_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"middle_name": "<string>",
"suffix": "<string>",
"prefix": "<string>"
},
"org": {
"company": "<string>",
"department": "<string>",
"title": "<string>"
},
"phones": [
{
"phone": "<string>",
"type": "<string>",
"wa_id": "<string>"
}
],
"urls": [
{
"url": "<string>",
"type": "<string>"
}
]
}
],
"reaction": {
"message_id": "<string>",
"emoji": "<string>"
},
"biz_opaque_callback_data": "<string>",
"type": "audio",
"text": {
"body": "Hello from Telnyx!",
"preview_url": false
},
"template": {
"template_id": "019cd44b-3a1c-781b-956e-bd33e9fd2ac6",
"name": "order_confirmation",
"language": {
"code": "en_US",
"policy": "deterministic"
},
"components": [
{
"type": "header",
"sub_type": "quick_reply",
"index": 123,
"parameters": [
{
"type": "text",
"text": "<string>",
"action": {
"flow_token": "<string>",
"flow_action_data": {}
}
}
]
}
]
}
},
"encoding": "utf-8",
"received_at": "2023-11-07T05:31:56Z",
"wait_seconds": 0.5
}
}{
"errors": [
{
"code": "10036",
"title": "Resource is being processed",
"detail": "A request with this Idempotency-Key is already being processed.",
"source": {
"pointer": "/header/Idempotency-Key"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Payload Too Large",
"detail": "The request body exceeds the Edge replay-protection limit for idempotent requests."
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "Edge idempotency protection is temporarily unavailable. Please try again later."
}
]
}{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "/data/attributes/phone_number",
"parameter": "string"
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Optional opaque, unquoted key for safely retrying the same logical request. Keys must contain 1 to 255 letters, numbers, hyphens, or underscores. Generate a unique UUID v4 for each operation and reuse it only when retrying that operation with the same request. Invalid headers—including duplicate, empty, malformed, or overlong values—return 400 with error code 10015. A request already in progress with the same key returns 409; reusing the key with a different request returns 422. Only successful responses are replayed, for up to 24 hours. Do not include sensitive data in the key.
1 - 255^[A-Za-z0-9_-]{1,255}$Body
Whatsapp message body
Phone number in +E.164 format associated with Whatsapp account
"+13125551234"
Recipient phone number in +E.164 format, or the business-scoped user ID (BSUID) of a WhatsApp user who hides their phone number, for example US.13491208655302741918. Authentication templates cannot be sent to a BSUID.
"+13125551234"
Show child attributes
Show child attributes
Message type - must be set to "WHATSAPP"
WHATSAPP "WHATSAPP"
The URL where webhooks related to this message will be sent.
Messaging profile ID - required if the 'from' number is not SMS-enabled
Response
Successful operation
Show child attributes
Show child attributes
Was this page helpful?
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
const response = await client.messages.sendWhatsapp({
from: '+13125551234',
to: '+13125551234',
whatsapp_message: {},
});
console.log(response.data);import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
response = client.messages.send_whatsapp(
from_="+13125551234",
to="+13125551234",
whatsapp_message={},
)
print(response.data)
package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Messages.SendWhatsapp(context.TODO(), telnyx.MessageSendWhatsappParams{
From: "+13125551234",
To: "+13125551234",
WhatsappMessage: telnyx.WhatsappMessageContentParam{},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Data)
}
package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.messages.MessageSendWhatsappParams;
import com.telnyx.sdk.models.messages.MessageSendWhatsappResponse;
import com.telnyx.sdk.models.messages.WhatsappMessageContent;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
MessageSendWhatsappParams params = MessageSendWhatsappParams.builder()
.from("+13125551234")
.to("+13125551234")
.whatsappMessage(WhatsappMessageContent.builder().build())
.build();
MessageSendWhatsappResponse response = client.messages().sendWhatsapp(params);
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
response = telnyx.messages.send_whatsapp(from: "+13125551234", to: "+13125551234", whatsapp_message: {})
puts(response)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$response = $client->messages->sendWhatsapp(
from: '+13125551234',
to: '+13125551234',
whatsappMessage: [
'audio' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'bizOpaqueCallbackData' => 'biz_opaque_callback_data',
'contacts' => [
[
'addresses' => [
[
'city' => 'city',
'country' => 'country',
'countryCode' => 'country_code',
'state' => 'state',
'street' => 'street',
'type' => 'type',
'zip' => 'zip',
],
],
'birthday' => 'birthday',
'emails' => [['email' => 'email', 'type' => 'type']],
'name' => 'name',
'org' => [
'company' => 'company',
'department' => 'department',
'title' => 'title',
],
'phones' => [
['phone' => 'phone', 'type' => 'type', 'waID' => 'wa_id']
],
'urls' => [['type' => 'type', 'url' => 'url']],
],
],
'document' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'image' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'interactive' => [
'action' => [
'button' => 'button',
'buttons' => [
['reply' => ['id' => 'id', 'title' => 'title'], 'type' => 'reply']
],
'cards' => [
[
'action' => [
'catalogID' => 'catalog_id',
'productRetailerID' => 'product_retailer_id',
],
'body' => ['text' => 'text'],
'cardIndex' => 0,
'header' => [
'image' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'type' => 'image',
'video' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
],
'type' => 'cta_url',
],
],
'catalogID' => 'catalog_id',
'mode' => 'mode',
'name' => 'name',
'parameters' => ['displayText' => 'display_text', 'url' => 'url'],
'productRetailerID' => 'product_retailer_id',
'sections' => [
[
'productItems' => [
['productRetailerID' => 'product_retailer_id']
],
'rows' => [
[
'id' => 'id',
'description' => 'description',
'title' => 'title',
],
],
'title' => 'title',
],
],
],
'body' => ['text' => 'text'],
'footer' => ['text' => 'text'],
'header' => [
'document' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'image' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'subText' => 'sub_text',
'text' => 'text',
'video' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
],
'type' => 'cta_url',
],
'location' => [
'address' => 'address',
'latitude' => 'latitude',
'longitude' => 'longitude',
'name' => 'name',
],
'reaction' => ['emoji' => 'emoji', 'messageID' => 'message_id'],
'sticker' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
'template' => [
'components' => [
[
'index' => 0,
'parameters' => [['text' => 'text', 'type' => 'text']],
'subType' => 'quick_reply',
'type' => 'header',
],
],
'language' => ['code' => 'en_US', 'policy' => 'deterministic'],
'name' => 'order_confirmation',
'templateID' => '019cd44b-3a1c-781b-956e-bd33e9fd2ac6',
],
'text' => ['body' => 'Hello from Telnyx!', 'previewURL' => true],
'type' => 'audio',
'video' => [
'caption' => 'caption',
'filename' => 'filename',
'link' => 'http://example.com/media.jpg',
'voice' => true,
],
],
messagingProfileID: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
type: 'WHATSAPP',
webhookURL: 'webhook_url',
);
var_dump($response);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx messages send-whatsapp \
--api-key 'My API Key' \
--from +13125551234 \
--to +13125551234 \
--whatsapp-message '{}'curl --request POST \
--url https://api.telnyx.com/v2/messages/whatsapp \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"from": "+13125551234",
"to": "+13125551234",
"whatsapp_message": {
"audio": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"document": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"image": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"sticker": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"video": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"interactive": {
"action": {
"name": "<string>",
"button": "<string>",
"buttons": [
{
"type": "reply",
"reply": {
"title": "<string>",
"id": "<string>"
}
}
],
"catalog_id": "<string>",
"product_retailer_id": "<string>",
"sections": [
{
"product_items": [
{
"product_retailer_id": "<string>"
}
],
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
],
"title": "<string>"
}
],
"mode": "<string>",
"parameters": {
"display_text": "<string>",
"url": "<string>",
"flow_message_version": "<string>",
"flow_token": "<string>",
"flow_id": "<string>",
"flow_name": "<string>",
"flow_cta": "<string>",
"flow_action_payload": {
"screen": "<string>",
"data": {}
}
},
"cards": [
{
"card_index": 123,
"type": "cta_url",
"header": {
"image": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"video": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
}
},
"body": {
"text": "<string>"
},
"action": {
"product_retailer_id": "<string>",
"catalog_id": "<string>"
}
}
]
},
"body": {
"text": "<string>"
},
"footer": {
"text": "<string>"
}
},
"location": {
"latitude": "<string>",
"longitude": "<string>",
"name": "<string>",
"address": "<string>"
},
"contacts": [
{
"addresses": [
{
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"country_code": "<string>",
"type": "<string>"
}
],
"birthday": "<string>",
"emails": [
{
"email": "<string>",
"type": "<string>"
}
],
"org": {
"company": "<string>",
"department": "<string>",
"title": "<string>"
},
"phones": [
{
"phone": "<string>",
"type": "<string>",
"wa_id": "<string>"
}
],
"urls": [
{
"url": "<string>",
"type": "<string>"
}
]
}
],
"reaction": {
"message_id": "<string>",
"emoji": "<string>"
},
"biz_opaque_callback_data": "<string>",
"template": {
"template_id": "019cd44b-3a1c-781b-956e-bd33e9fd2ac6",
"name": "order_confirmation",
"components": [
{
"index": 123,
"parameters": [
{
"text": "<string>",
"action": {
"flow_token": "<string>",
"flow_action_data": {}
}
}
]
}
]
}
},
"type": "WHATSAPP",
"webhook_url": "<string>",
"messaging_profile_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
'{
"data": {
"record_type": "message",
"direction": "outbound",
"id": "4031938e-60e4-4235-a8dd-0b1c55a23e7a",
"type": "WHATSAPP",
"organization_id": "9f61d8e1-7687-4d6d-9cae-9ff682985983",
"messaging_profile_id": "4001781e-626f-4a41-a914-b1b682150f94",
"from": {
"phone_number": "<string>",
"status": "received",
"carrier": "<string>",
"line_type": "Wireline"
},
"to": [
{
"phone_number": "+13125551234",
"status": "queued",
"carrier": "Verizon Wireless",
"line_type": "Wireless"
}
],
"body": {
"audio": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"document": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"image": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"sticker": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"video": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"interactive": {
"type": "cta_url",
"action": {
"name": "<string>",
"button": "<string>",
"buttons": [
{
"type": "reply",
"reply": {
"title": "<string>",
"id": "<string>"
}
}
],
"catalog_id": "<string>",
"product_retailer_id": "<string>",
"sections": [
{
"product_items": [
{
"product_retailer_id": "<string>"
}
],
"rows": [
{
"id": "<string>",
"title": "<string>",
"description": "<string>"
}
],
"title": "<string>"
}
],
"mode": "<string>",
"parameters": {
"display_text": "<string>",
"url": "<string>",
"flow_message_version": "<string>",
"flow_token": "<string>",
"flow_id": "<string>",
"flow_name": "<string>",
"flow_cta": "<string>",
"flow_action": "navigate",
"flow_action_payload": {
"screen": "<string>",
"data": {}
},
"mode": "draft"
},
"cards": [
{
"card_index": 123,
"type": "cta_url",
"header": {
"type": "image",
"image": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"video": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
}
},
"body": {
"text": "<string>"
},
"action": {
"product_retailer_id": "<string>",
"catalog_id": "<string>"
}
}
]
},
"body": {
"text": "<string>"
},
"footer": {
"text": "<string>"
},
"header": {
"type": "document",
"document": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"image": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"video": {
"link": "http://example.com/media.jpg",
"caption": "<string>",
"filename": "<string>",
"voice": true
},
"text": "<string>",
"sub_text": "<string>"
}
},
"location": {
"latitude": "<string>",
"longitude": "<string>",
"name": "<string>",
"address": "<string>"
},
"contacts": [
{
"addresses": [
{
"street": "<string>",
"city": "<string>",
"state": "<string>",
"zip": "<string>",
"country": "<string>",
"country_code": "<string>",
"type": "<string>"
}
],
"birthday": "<string>",
"emails": [
{
"email": "<string>",
"type": "<string>"
}
],
"name": {
"formatted_name": "<string>",
"first_name": "<string>",
"last_name": "<string>",
"middle_name": "<string>",
"suffix": "<string>",
"prefix": "<string>"
},
"org": {
"company": "<string>",
"department": "<string>",
"title": "<string>"
},
"phones": [
{
"phone": "<string>",
"type": "<string>",
"wa_id": "<string>"
}
],
"urls": [
{
"url": "<string>",
"type": "<string>"
}
]
}
],
"reaction": {
"message_id": "<string>",
"emoji": "<string>"
},
"biz_opaque_callback_data": "<string>",
"type": "audio",
"text": {
"body": "Hello from Telnyx!",
"preview_url": false
},
"template": {
"template_id": "019cd44b-3a1c-781b-956e-bd33e9fd2ac6",
"name": "order_confirmation",
"language": {
"code": "en_US",
"policy": "deterministic"
},
"components": [
{
"type": "header",
"sub_type": "quick_reply",
"index": 123,
"parameters": [
{
"type": "text",
"text": "<string>",
"action": {
"flow_token": "<string>",
"flow_action_data": {}
}
}
]
}
]
}
},
"encoding": "utf-8",
"received_at": "2023-11-07T05:31:56Z",
"wait_seconds": 0.5
}
}{
"errors": [
{
"code": "10036",
"title": "Resource is being processed",
"detail": "A request with this Idempotency-Key is already being processed.",
"source": {
"pointer": "/header/Idempotency-Key"
}
}
]
}{
"errors": [
{
"code": "10007",
"title": "Payload Too Large",
"detail": "The request body exceeds the Edge replay-protection limit for idempotent requests."
}
]
}{
"errors": [
{
"code": "10016",
"title": "Service Unavailable",
"detail": "Edge idempotency protection is temporarily unavailable. Please try again later."
}
]
}{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "/data/attributes/phone_number",
"parameter": "string"
}
}
]
}