> 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 SMS broadcast

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

Creates a broadcast, inserts one row per recipient into `sms_messages`,
atomically reserves credit (prepaid clients), and enqueues the job to AWS SQS
for asynchronous delivery via Elfo. Final delivery status is reported via
the `delivered` / `failed` webhook events.

**Required scope:** `send_sms`
**Rate limit:** 10 requests / 15 min / client
**Status lifecycle:** `pending → enqueued → send → [delivered | failed]`

## Recipient modes

| Mode | Field | Use |
| --- | --- | --- |
| Standard | `recipients[]` | Same content for every recipient |
| Dynamic | `recipientVariables[]` | Per-recipient `{name}` substitution |

Provide **one** of `recipients` or `recipientVariables` (not both). Maximum
**10,000 recipients** per request.

## Template resolution

Provide **one** of:
- `templateName` — resolves an existing approved template owned by your client
- `templateContent` — creates a one-off ad-hoc template for this broadcast

## Idempotency

The API does not dedupe identical request bodies. If the request times out
client-side, query the dashboard's Message Logs by `broadcastUuid` (returned
in the response) before retrying.


Reference: https://docs.teekrr.com/api-reference/sms/send-sms

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Teekrr Public API
  version: 1.0.0
paths:
  /sms:
    post:
      operationId: send-sms
      summary: Send SMS broadcast
      description: >
        Creates a broadcast, inserts one row per recipient into `sms_messages`,

        atomically reserves credit (prepaid clients), and enqueues the job to
        AWS SQS

        for asynchronous delivery via Elfo. Final delivery status is reported
        via

        the `delivered` / `failed` webhook events.


        **Required scope:** `send_sms`

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

        **Status lifecycle:** `pending → enqueued → send → [delivered | failed]`


        ## Recipient modes


        | Mode | Field | Use |

        | --- | --- | --- |

        | Standard | `recipients[]` | Same content for every recipient |

        | Dynamic | `recipientVariables[]` | Per-recipient `{name}` substitution
        |


        Provide **one** of `recipients` or `recipientVariables` (not both).
        Maximum

        **10,000 recipients** per request.


        ## Template resolution


        Provide **one** of:

        - `templateName` — resolves an existing approved template owned by your
        client

        - `templateContent` — creates a one-off ad-hoc template for this
        broadcast


        ## Idempotency


        The API does not dedupe identical request bodies. If the request times
        out

        client-side, query the dashboard's Message Logs by `broadcastUuid`
        (returned

        in the response) before retrying.
      tags:
        - subpackage_sms
      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:
        '202':
          description: Broadcast accepted (queued or scheduled)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SmsSuccess'
        '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'
        '402':
          description: >-
            Prepaid balance below required cost, or postpaid spending cap
            exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Caller IP not whitelisted, missing scope, or channel inactive
          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'
        '500':
          description: Unexpected server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendSmsRequest'
servers:
  - url: https://api.teekrr.com
  - url: https://api.staging.teekrr.com
components:
  schemas:
    BroadcastType:
      type: string
      enum:
        - quick broadcast
        - schedule broadcast
      description: |
        - `quick broadcast` — send immediately
        - `schedule broadcast` — defer; requires `scheduledAt`
      title: BroadcastType
    PhoneNumberE164:
      type: string
      description: E.164-format phone number (digits only or with leading `+`).
      title: PhoneNumberE164
    SmsRecipientVariables:
      type: object
      properties:
        msisdn:
          $ref: '#/components/schemas/PhoneNumberE164'
        variables:
          type: object
          additionalProperties:
            type: string
          description: Per-recipient template substitutions.
      required:
        - msisdn
        - variables
      title: SmsRecipientVariables
    SendSmsRequest:
      type: object
      properties:
        templateName:
          type: string
          description: Name of an existing approved SMS template owned by your client.
        templateContent:
          type: string
          description: Ad-hoc template content for one-off broadcasts.
        campaignName:
          type: string
          description: Free-text identifier shown in the dashboard.
        type:
          $ref: '#/components/schemas/BroadcastType'
        scheduledAt:
          type: string
          format: date-time
          description: ISO 8601. Required when `type = schedule broadcast`.
        keyword:
          type: string
          description: Sender-ID prefix; must be a registered keyword on your client.
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/PhoneNumberE164'
        recipientVariables:
          type: array
          items:
            $ref: '#/components/schemas/SmsRecipientVariables'
      required:
        - campaignName
        - type
      description: >
        Provide one of `templateName` or `templateContent`, and one of
        `recipients`

        or `recipientVariables`. When `type = schedule broadcast`, `scheduledAt`
        is required.
      title: SendSmsRequest
    SmsSuccessData:
      type: object
      properties:
        broadcastUuid:
          type: string
          format: uuid
        queued:
          type: integer
          description: Number of recipients accepted
        totalSmsUnits:
          type: integer
          description: Billable SMS units across all recipients
        sqsMessageIds:
          type: array
          items:
            type: string
          description: SQS IDs returned for the enqueue (quick only).
        scheduledAt:
          type: string
          format: date-time
          description: Present only for scheduled broadcasts.
      required:
        - broadcastUuid
        - queued
        - totalSmsUnits
      title: SmsSuccessData
    SmsSuccess:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/SmsSuccessData'
      title: SmsSuccess
    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 Quick broadcast — queued to SQS
import requests

url = "https://api.teekrr.com/sms"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Quick broadcast — queued to SQS
const url = 'https://api.teekrr.com/sms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

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

```go Quick broadcast — queued to SQS
package main

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

func main() {

	url := "https://api.teekrr.com/sms"

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

	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 Quick broadcast — queued to SQS
require 'uri'
require 'net/http'

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

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'

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

```java Quick broadcast — queued to SQS
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.teekrr.com/sms")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Quick broadcast — queued to SQS
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.teekrr.com/sms', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Quick broadcast — queued to SQS
using RestSharp;

var client = new RestClient("https://api.teekrr.com/sms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Quick broadcast — queued to SQS
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

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

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()
```

```python Scheduled broadcast — will be enqueued at scheduledAt
import requests

url = "https://api.teekrr.com/sms"

headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Scheduled broadcast — will be enqueued at scheduledAt
const url = 'https://api.teekrr.com/sms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

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

```go Scheduled broadcast — will be enqueued at scheduledAt
package main

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

func main() {

	url := "https://api.teekrr.com/sms"

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

	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 Scheduled broadcast — will be enqueued at scheduledAt
require 'uri'
require 'net/http'

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

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'

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

```java Scheduled broadcast — will be enqueued at scheduledAt
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.teekrr.com/sms")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Scheduled broadcast — will be enqueued at scheduledAt
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.teekrr.com/sms', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Scheduled broadcast — will be enqueued at scheduledAt
using RestSharp;

var client = new RestClient("https://api.teekrr.com/sms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Scheduled broadcast — will be enqueued at scheduledAt
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

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

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()
```

```python Standard mode (same message for everyone)
import requests

url = "https://api.teekrr.com/sms"

payload = {
    "campaignName": "May 2026 Welcome Promo",
    "type": "quick broadcast",
    "templateName": "welcome_promo_v1",
    "keyword": "TEEKRR",
    "recipients": ["60123456789", "60198765432"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Standard mode (same message for everyone)
const url = 'https://api.teekrr.com/sms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"campaignName":"May 2026 Welcome Promo","type":"quick broadcast","templateName":"welcome_promo_v1","keyword":"TEEKRR","recipients":["60123456789","60198765432"]}'
};

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

```go Standard mode (same message for everyone)
package main

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

func main() {

	url := "https://api.teekrr.com/sms"

	payload := strings.NewReader("{\n  \"campaignName\": \"May 2026 Welcome Promo\",\n  \"type\": \"quick broadcast\",\n  \"templateName\": \"welcome_promo_v1\",\n  \"keyword\": \"TEEKRR\",\n  \"recipients\": [\n    \"60123456789\",\n    \"60198765432\"\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 Standard mode (same message for everyone)
require 'uri'
require 'net/http'

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

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  \"campaignName\": \"May 2026 Welcome Promo\",\n  \"type\": \"quick broadcast\",\n  \"templateName\": \"welcome_promo_v1\",\n  \"keyword\": \"TEEKRR\",\n  \"recipients\": [\n    \"60123456789\",\n    \"60198765432\"\n  ]\n}"

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

```java Standard mode (same message for everyone)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.teekrr.com/sms")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"campaignName\": \"May 2026 Welcome Promo\",\n  \"type\": \"quick broadcast\",\n  \"templateName\": \"welcome_promo_v1\",\n  \"keyword\": \"TEEKRR\",\n  \"recipients\": [\n    \"60123456789\",\n    \"60198765432\"\n  ]\n}")
  .asString();
```

```php Standard mode (same message for everyone)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.teekrr.com/sms', [
  'body' => '{
  "campaignName": "May 2026 Welcome Promo",
  "type": "quick broadcast",
  "templateName": "welcome_promo_v1",
  "keyword": "TEEKRR",
  "recipients": [
    "60123456789",
    "60198765432"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Standard mode (same message for everyone)
using RestSharp;

var client = new RestClient("https://api.teekrr.com/sms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"campaignName\": \"May 2026 Welcome Promo\",\n  \"type\": \"quick broadcast\",\n  \"templateName\": \"welcome_promo_v1\",\n  \"keyword\": \"TEEKRR\",\n  \"recipients\": [\n    \"60123456789\",\n    \"60198765432\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Standard mode (same message for everyone)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "campaignName": "May 2026 Welcome Promo",
  "type": "quick broadcast",
  "templateName": "welcome_promo_v1",
  "keyword": "TEEKRR",
  "recipients": ["60123456789", "60198765432"]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.teekrr.com/sms")! 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()
```

```python Dynamic mode (per-recipient variables)
import requests

url = "https://api.teekrr.com/sms"

payload = {
    "campaignName": "Login OTPs 2026-05-06",
    "type": "quick broadcast",
    "templateName": "otp_login",
    "recipientVariables": [
        {
            "msisdn": "60123456789",
            "variables": {
                "code": "318204",
                "name": "Ali"
            }
        },
        {
            "msisdn": "60198765432",
            "variables": {
                "code": "771943",
                "name": "Fatimah"
            }
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Dynamic mode (per-recipient variables)
const url = 'https://api.teekrr.com/sms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"campaignName":"Login OTPs 2026-05-06","type":"quick broadcast","templateName":"otp_login","recipientVariables":[{"msisdn":"60123456789","variables":{"code":"318204","name":"Ali"}},{"msisdn":"60198765432","variables":{"code":"771943","name":"Fatimah"}}]}'
};

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

```go Dynamic mode (per-recipient variables)
package main

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

func main() {

	url := "https://api.teekrr.com/sms"

	payload := strings.NewReader("{\n  \"campaignName\": \"Login OTPs 2026-05-06\",\n  \"type\": \"quick broadcast\",\n  \"templateName\": \"otp_login\",\n  \"recipientVariables\": [\n    {\n      \"msisdn\": \"60123456789\",\n      \"variables\": {\n        \"code\": \"318204\",\n        \"name\": \"Ali\"\n      }\n    },\n    {\n      \"msisdn\": \"60198765432\",\n      \"variables\": {\n        \"code\": \"771943\",\n        \"name\": \"Fatimah\"\n      }\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 Dynamic mode (per-recipient variables)
require 'uri'
require 'net/http'

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

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  \"campaignName\": \"Login OTPs 2026-05-06\",\n  \"type\": \"quick broadcast\",\n  \"templateName\": \"otp_login\",\n  \"recipientVariables\": [\n    {\n      \"msisdn\": \"60123456789\",\n      \"variables\": {\n        \"code\": \"318204\",\n        \"name\": \"Ali\"\n      }\n    },\n    {\n      \"msisdn\": \"60198765432\",\n      \"variables\": {\n        \"code\": \"771943\",\n        \"name\": \"Fatimah\"\n      }\n    }\n  ]\n}"

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

```java Dynamic mode (per-recipient variables)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.teekrr.com/sms")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"campaignName\": \"Login OTPs 2026-05-06\",\n  \"type\": \"quick broadcast\",\n  \"templateName\": \"otp_login\",\n  \"recipientVariables\": [\n    {\n      \"msisdn\": \"60123456789\",\n      \"variables\": {\n        \"code\": \"318204\",\n        \"name\": \"Ali\"\n      }\n    },\n    {\n      \"msisdn\": \"60198765432\",\n      \"variables\": {\n        \"code\": \"771943\",\n        \"name\": \"Fatimah\"\n      }\n    }\n  ]\n}")
  .asString();
```

```php Dynamic mode (per-recipient variables)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.teekrr.com/sms', [
  'body' => '{
  "campaignName": "Login OTPs 2026-05-06",
  "type": "quick broadcast",
  "templateName": "otp_login",
  "recipientVariables": [
    {
      "msisdn": "60123456789",
      "variables": {
        "code": "318204",
        "name": "Ali"
      }
    },
    {
      "msisdn": "60198765432",
      "variables": {
        "code": "771943",
        "name": "Fatimah"
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Dynamic mode (per-recipient variables)
using RestSharp;

var client = new RestClient("https://api.teekrr.com/sms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"campaignName\": \"Login OTPs 2026-05-06\",\n  \"type\": \"quick broadcast\",\n  \"templateName\": \"otp_login\",\n  \"recipientVariables\": [\n    {\n      \"msisdn\": \"60123456789\",\n      \"variables\": {\n        \"code\": \"318204\",\n        \"name\": \"Ali\"\n      }\n    },\n    {\n      \"msisdn\": \"60198765432\",\n      \"variables\": {\n        \"code\": \"771943\",\n        \"name\": \"Fatimah\"\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Dynamic mode (per-recipient variables)
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "campaignName": "Login OTPs 2026-05-06",
  "type": "quick broadcast",
  "templateName": "otp_login",
  "recipientVariables": [
    [
      "msisdn": "60123456789",
      "variables": [
        "code": "318204",
        "name": "Ali"
      ]
    ],
    [
      "msisdn": "60198765432",
      "variables": [
        "code": "771943",
        "name": "Fatimah"
      ]
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.teekrr.com/sms")! 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()
```

```python Schedule for later
import requests

url = "https://api.teekrr.com/sms"

payload = {
    "campaignName": "Friday reminders",
    "type": "schedule broadcast",
    "templateContent": "Hi {name}, your appointment is at {time}.",
    "scheduledAt": "2026-05-10T09:00:00Z",
    "recipientVariables": [
        {
            "msisdn": "60123456789",
            "variables": {
                "name": "Ali",
                "time": "10:00 AM"
            }
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Schedule for later
const url = 'https://api.teekrr.com/sms';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"campaignName":"Friday reminders","type":"schedule broadcast","templateContent":"Hi {name}, your appointment is at {time}.","scheduledAt":"2026-05-10T09:00:00Z","recipientVariables":[{"msisdn":"60123456789","variables":{"name":"Ali","time":"10:00 AM"}}]}'
};

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

```go Schedule for later
package main

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

func main() {

	url := "https://api.teekrr.com/sms"

	payload := strings.NewReader("{\n  \"campaignName\": \"Friday reminders\",\n  \"type\": \"schedule broadcast\",\n  \"templateContent\": \"Hi {name}, your appointment is at {time}.\",\n  \"scheduledAt\": \"2026-05-10T09:00:00Z\",\n  \"recipientVariables\": [\n    {\n      \"msisdn\": \"60123456789\",\n      \"variables\": {\n        \"name\": \"Ali\",\n        \"time\": \"10:00 AM\"\n      }\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 Schedule for later
require 'uri'
require 'net/http'

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

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  \"campaignName\": \"Friday reminders\",\n  \"type\": \"schedule broadcast\",\n  \"templateContent\": \"Hi {name}, your appointment is at {time}.\",\n  \"scheduledAt\": \"2026-05-10T09:00:00Z\",\n  \"recipientVariables\": [\n    {\n      \"msisdn\": \"60123456789\",\n      \"variables\": {\n        \"name\": \"Ali\",\n        \"time\": \"10:00 AM\"\n      }\n    }\n  ]\n}"

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

```java Schedule for later
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.teekrr.com/sms")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"campaignName\": \"Friday reminders\",\n  \"type\": \"schedule broadcast\",\n  \"templateContent\": \"Hi {name}, your appointment is at {time}.\",\n  \"scheduledAt\": \"2026-05-10T09:00:00Z\",\n  \"recipientVariables\": [\n    {\n      \"msisdn\": \"60123456789\",\n      \"variables\": {\n        \"name\": \"Ali\",\n        \"time\": \"10:00 AM\"\n      }\n    }\n  ]\n}")
  .asString();
```

```php Schedule for later
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.teekrr.com/sms', [
  'body' => '{
  "campaignName": "Friday reminders",
  "type": "schedule broadcast",
  "templateContent": "Hi {name}, your appointment is at {time}.",
  "scheduledAt": "2026-05-10T09:00:00Z",
  "recipientVariables": [
    {
      "msisdn": "60123456789",
      "variables": {
        "name": "Ali",
        "time": "10:00 AM"
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Schedule for later
using RestSharp;

var client = new RestClient("https://api.teekrr.com/sms");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"campaignName\": \"Friday reminders\",\n  \"type\": \"schedule broadcast\",\n  \"templateContent\": \"Hi {name}, your appointment is at {time}.\",\n  \"scheduledAt\": \"2026-05-10T09:00:00Z\",\n  \"recipientVariables\": [\n    {\n      \"msisdn\": \"60123456789\",\n      \"variables\": {\n        \"name\": \"Ali\",\n        \"time\": \"10:00 AM\"\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Schedule for later
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "campaignName": "Friday reminders",
  "type": "schedule broadcast",
  "templateContent": "Hi {name}, your appointment is at {time}.",
  "scheduledAt": "2026-05-10T09:00:00Z",
  "recipientVariables": [
    [
      "msisdn": "60123456789",
      "variables": [
        "name": "Ali",
        "time": "10:00 AM"
      ]
    ]
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.teekrr.com/sms")! 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()
```