> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.teekrr.com/llms.txt.
> For full documentation content, see https://docs.teekrr.com/llms-full.txt.

# Send WhatsApp test message

POST https://api.teekrr.com/whatsapp/test
Content-Type: application/json

Sends a single template message directly via the META Cloud API,
**bypassing** the broadcast pipeline. No broadcast row is created,
**no SQS enqueue**, and **no credit is consumed**. Use this to verify
your template + variables before launching a real broadcast.

**Required scope:** `send_whatsapp`
**Rate limit:** 5 requests / 15 min / client

Your registered webhooks will still receive `delivered` / `failed` events
for the test message — only broadcast accounting and billing are skipped.


Reference: https://docs.teekrr.com/api-reference/whats-app/test-send-whatsapp

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Teekrr Public API
  version: 1.0.0
paths:
  /whatsapp/test:
    post:
      operationId: test-send-whatsapp
      summary: Send WhatsApp test message
      description: >
        Sends a single template message directly via the META Cloud API,

        **bypassing** the broadcast pipeline. No broadcast row is created,

        **no SQS enqueue**, and **no credit is consumed**. Use this to verify

        your template + variables before launching a real broadcast.


        **Required scope:** `send_whatsapp`

        **Rate limit:** 5 requests / 15 min / client


        Your registered webhooks will still receive `delivered` / `failed`
        events

        for the test message — only broadcast accounting and billing are
        skipped.
      tags:
        - subpackage_whatsApp
      parameters:
        - name: Authorization
          in: header
          description: >
            Bearer API keys are issued from the in-app `/api-management` page.
            Each key has

            a permission scope (`send_sms`, `send_whatsapp`, `send_email`) and
            an optional

            IP whitelist.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Test send delivered to META
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestWhatsappSuccess'
        '400':
          description: Body validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Missing, invalid, revoked, or expired API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Referenced template, keyword, or WhatsApp configuration not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: META rejected the test send
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Per-channel per-client rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TestWhatsappRequest'
servers:
  - url: https://api.teekrr.com
  - url: https://api.staging.teekrr.com
components:
  schemas:
    PhoneNumberE164:
      type: string
      description: E.164-format phone number (digits only or with leading `+`).
      title: PhoneNumberE164
    WhatsappVariables:
      type: object
      properties:
        header:
          type: array
          items:
            type: string
          description: Template header positional substitutions.
        body:
          type: array
          items:
            type: string
          description: Template body positional substitutions.
        button:
          type: array
          items:
            type: string
          description: Dynamic button text.
        headerImage:
          type: string
          format: uri
          description: >-
            URL of an uploaded header image (use `POST
            /whatsapp/upload-header-image`).
        headerVideo:
          type: string
          format: uri
        headerDocument:
          type: string
          format: uri
      title: WhatsappVariables
    TestWhatsappRequest:
      type: object
      properties:
        templateName:
          type: string
        to:
          $ref: '#/components/schemas/PhoneNumberE164'
        variables:
          $ref: '#/components/schemas/WhatsappVariables'
      required:
        - templateName
        - to
      title: TestWhatsappRequest
    TestWhatsappSuccessData:
      type: object
      properties:
        success:
          type: boolean
        metaMessageId:
          type:
            - string
            - 'null'
          description: META's `wamid....` identifier
        to:
          $ref: '#/components/schemas/PhoneNumberE164'
      required:
        - success
        - to
      title: TestWhatsappSuccessData
    TestWhatsappSuccess:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/TestWhatsappSuccessData'
      title: TestWhatsappSuccess
    ValidationErrorResponseErrorsItems:
      type: object
      properties:
        field:
          type: string
        message:
          type: string
      required:
        - field
        - message
      title: ValidationErrorResponseErrorsItems
    ValidationErrorResponse:
      type: object
      properties:
        message:
          type: string
        errors:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorResponseErrorsItems'
      required:
        - message
        - errors
      title: ValidationErrorResponse
    ErrorResponse:
      type: object
      properties:
        message:
          type: string
      required:
        - message
      title: ErrorResponse
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >
        Bearer API keys are issued from the in-app `/api-management` page. Each
        key has

        a permission scope (`send_sms`, `send_whatsapp`, `send_email`) and an
        optional

        IP whitelist.

```

## SDK Code Examples

```python WhatsApp_testSendWhatsapp_example
import requests

url = "https://api.teekrr.com/whatsapp/test"

payload = {
    "templateName": "welcome_promo_v1",
    "to": "60123456789",
    "variables": { "body": ["Test User", "RM50 OFF"] }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript WhatsApp_testSendWhatsapp_example
const url = 'https://api.teekrr.com/whatsapp/test';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"templateName":"welcome_promo_v1","to":"60123456789","variables":{"body":["Test User","RM50 OFF"]}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go WhatsApp_testSendWhatsapp_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.teekrr.com/whatsapp/test"

	payload := strings.NewReader("{\n  \"templateName\": \"welcome_promo_v1\",\n  \"to\": \"60123456789\",\n  \"variables\": {\n    \"body\": [\n      \"Test User\",\n      \"RM50 OFF\"\n    ]\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby WhatsApp_testSendWhatsapp_example
require 'uri'
require 'net/http'

url = URI("https://api.teekrr.com/whatsapp/test")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"templateName\": \"welcome_promo_v1\",\n  \"to\": \"60123456789\",\n  \"variables\": {\n    \"body\": [\n      \"Test User\",\n      \"RM50 OFF\"\n    ]\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java WhatsApp_testSendWhatsapp_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.teekrr.com/whatsapp/test")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"templateName\": \"welcome_promo_v1\",\n  \"to\": \"60123456789\",\n  \"variables\": {\n    \"body\": [\n      \"Test User\",\n      \"RM50 OFF\"\n    ]\n  }\n}")
  .asString();
```

```php WhatsApp_testSendWhatsapp_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.teekrr.com/whatsapp/test', [
  'body' => '{
  "templateName": "welcome_promo_v1",
  "to": "60123456789",
  "variables": {
    "body": [
      "Test User",
      "RM50 OFF"
    ]
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp WhatsApp_testSendWhatsapp_example
using RestSharp;

var client = new RestClient("https://api.teekrr.com/whatsapp/test");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"templateName\": \"welcome_promo_v1\",\n  \"to\": \"60123456789\",\n  \"variables\": {\n    \"body\": [\n      \"Test User\",\n      \"RM50 OFF\"\n    ]\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift WhatsApp_testSendWhatsapp_example
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "templateName": "welcome_promo_v1",
  "to": "60123456789",
  "variables": ["body": ["Test User", "RM50 OFF"]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.teekrr.com/whatsapp/test")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```