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

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

Creates an email broadcast, inserts one row per recipient into `email_messages`,
atomically reserves credit (prepaid), and dispatches via AWS SES **synchronously**
for `quick broadcast`. The response returns once every recipient has been attempted,
with per-recipient send/failed counts.

**Required scope:** `send_email`
**Rate limit:** 10 requests / 15 min / client

## Billing semantics (prepaid clients)

1. The full `recipientCount × emailRate` is **reserved** at broadcast creation
2. Each **successful** send (HTTP 2xx from SES) is **settled**
3. Each **failed** send (non-2xx or thrown error) **releases** that recipient's portion back to balance

A 100-recipient broadcast that succeeds for 95 and fails for 5 ends with 95 charges
settled and 5 reserved-credit returned.

## Bounce handling

Hard bounces reach your registered webhook URL as a `bounced` event. Suppress these
addresses from future broadcasts; SES enforces sender-reputation hygiene.


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

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Teekrr Public API
  version: 1.0.0
paths:
  /email:
    post:
      operationId: send-email
      summary: Send Email broadcast
      description: >
        Creates an email broadcast, inserts one row per recipient into
        `email_messages`,

        atomically reserves credit (prepaid), and dispatches via AWS SES
        **synchronously**

        for `quick broadcast`. The response returns once every recipient has
        been attempted,

        with per-recipient send/failed counts.


        **Required scope:** `send_email`

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


        ## Billing semantics (prepaid clients)


        1. The full `recipientCount × emailRate` is **reserved** at broadcast
        creation

        2. Each **successful** send (HTTP 2xx from SES) is **settled**

        3. Each **failed** send (non-2xx or thrown error) **releases** that
        recipient's portion back to balance


        A 100-recipient broadcast that succeeds for 95 and fails for 5 ends with
        95 charges

        settled and 5 reserved-credit returned.


        ## Bounce handling


        Hard bounces reach your registered webhook URL as a `bounced` event.
        Suppress these

        addresses from future broadcasts; SES enforces sender-reputation
        hygiene.
      tags:
        - subpackage_email
      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: Quick broadcast — fully attempted, with send/failed counts
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailQuickSuccess'
        '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'
        '404':
          description: Referenced template, keyword, or WhatsApp configuration not found
          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/SendEmailRequest'
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
    EmailAddress:
      type: string
      format: email
      title: EmailAddress
    EmailRecipientVariables:
      type: object
      properties:
        email:
          $ref: '#/components/schemas/EmailAddress'
        variables:
          type: object
          additionalProperties:
            type: string
      required:
        - email
        - variables
      title: EmailRecipientVariables
    SendEmailRequest:
      type: object
      properties:
        templateName:
          type: string
        campaignName:
          type: string
        subject:
          type: string
        type:
          $ref: '#/components/schemas/BroadcastType'
        scheduledAt:
          type: string
          format: date-time
        recipients:
          type: array
          items:
            $ref: '#/components/schemas/EmailAddress'
        recipientVariables:
          type: array
          items:
            $ref: '#/components/schemas/EmailRecipientVariables'
      required:
        - templateName
        - subject
        - type
      title: SendEmailRequest
    EmailQuickSuccessData:
      type: object
      properties:
        broadcastUuid:
          type: string
          format: uuid
        sent:
          type: integer
        failed:
          type: integer
        total:
          type: integer
      required:
        - broadcastUuid
        - sent
        - failed
        - total
      title: EmailQuickSuccessData
    EmailQuickSuccess:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/EmailQuickSuccessData'
      title: EmailQuickSuccess
    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 All recipients succeeded
import requests

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

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

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

print(response.json())
```

```javascript All recipients succeeded
const url = 'https://api.teekrr.com/email';
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 All recipients succeeded
package main

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

func main() {

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

	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 All recipients succeeded
require 'uri'
require 'net/http'

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

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 All recipients succeeded
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php All recipients succeeded
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp All recipients succeeded
using RestSharp;

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

```swift All recipients succeeded
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.teekrr.com/email")! 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 Some failures (credit released for failed)
import requests

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

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

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

print(response.json())
```

```javascript Some failures (credit released for failed)
const url = 'https://api.teekrr.com/email';
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 Some failures (credit released for failed)
package main

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

func main() {

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

	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 Some failures (credit released for failed)
require 'uri'
require 'net/http'

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

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 Some failures (credit released for failed)
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php Some failures (credit released for failed)
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp Some failures (credit released for failed)
using RestSharp;

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

```swift Some failures (credit released for failed)
import Foundation

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

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

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

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

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

print(response.json())
```

```javascript Email_sendEmail_example
const url = 'https://api.teekrr.com/email';
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 Email_sendEmail_example
package main

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

func main() {

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

	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 Email_sendEmail_example
require 'uri'
require 'net/http'

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

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 Email_sendEmail_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

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

$client = new \GuzzleHttp\Client();

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

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

```csharp Email_sendEmail_example
using RestSharp;

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

```swift Email_sendEmail_example
import Foundation

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

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

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

payload = {
    "templateName": "welcome_promo_v1",
    "subject": "Welcome to Teekrr",
    "type": "quick broadcast",
    "campaignName": "May 2026 Welcome Promo",
    "recipients": ["ali@example.com", "fatimah@example.com"]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Standard mode
const url = 'https://api.teekrr.com/email';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"templateName":"welcome_promo_v1","subject":"Welcome to Teekrr","type":"quick broadcast","campaignName":"May 2026 Welcome Promo","recipients":["ali@example.com","fatimah@example.com"]}'
};

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

```go Standard mode
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"templateName\": \"welcome_promo_v1\",\n  \"subject\": \"Welcome to Teekrr\",\n  \"type\": \"quick broadcast\",\n  \"campaignName\": \"May 2026 Welcome Promo\",\n  \"recipients\": [\n    \"ali@example.com\",\n    \"fatimah@example.com\"\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
require 'uri'
require 'net/http'

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

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  \"subject\": \"Welcome to Teekrr\",\n  \"type\": \"quick broadcast\",\n  \"campaignName\": \"May 2026 Welcome Promo\",\n  \"recipients\": [\n    \"ali@example.com\",\n    \"fatimah@example.com\"\n  ]\n}"

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

```java Standard mode
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.teekrr.com/email")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"templateName\": \"welcome_promo_v1\",\n  \"subject\": \"Welcome to Teekrr\",\n  \"type\": \"quick broadcast\",\n  \"campaignName\": \"May 2026 Welcome Promo\",\n  \"recipients\": [\n    \"ali@example.com\",\n    \"fatimah@example.com\"\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.teekrr.com/email', [
  'body' => '{
  "templateName": "welcome_promo_v1",
  "subject": "Welcome to Teekrr",
  "type": "quick broadcast",
  "campaignName": "May 2026 Welcome Promo",
  "recipients": [
    "ali@example.com",
    "fatimah@example.com"
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Standard mode
using RestSharp;

var client = new RestClient("https://api.teekrr.com/email");
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  \"subject\": \"Welcome to Teekrr\",\n  \"type\": \"quick broadcast\",\n  \"campaignName\": \"May 2026 Welcome Promo\",\n  \"recipients\": [\n    \"ali@example.com\",\n    \"fatimah@example.com\"\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Standard mode
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "templateName": "welcome_promo_v1",
  "subject": "Welcome to Teekrr",
  "type": "quick broadcast",
  "campaignName": "May 2026 Welcome Promo",
  "recipients": ["ali@example.com", "fatimah@example.com"]
] as [String : Any]

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

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

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

payload = {
    "templateName": "order_shipped_v2",
    "subject": "Your order is on its way",
    "type": "quick broadcast",
    "campaignName": "Shipping notifications 2026-05-06",
    "recipientVariables": [
        {
            "email": "ali@example.com",
            "variables": {
                "name": "Ali",
                "trackingNo": "TKR123ABC"
            }
        },
        {
            "email": "fatimah@example.com",
            "variables": {
                "name": "Fatimah",
                "trackingNo": "TKR456DEF"
            }
        }
    ]
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Dynamic mode
const url = 'https://api.teekrr.com/email';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"templateName":"order_shipped_v2","subject":"Your order is on its way","type":"quick broadcast","campaignName":"Shipping notifications 2026-05-06","recipientVariables":[{"email":"ali@example.com","variables":{"name":"Ali","trackingNo":"TKR123ABC"}},{"email":"fatimah@example.com","variables":{"name":"Fatimah","trackingNo":"TKR456DEF"}}]}'
};

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

```go Dynamic mode
package main

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

func main() {

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

	payload := strings.NewReader("{\n  \"templateName\": \"order_shipped_v2\",\n  \"subject\": \"Your order is on its way\",\n  \"type\": \"quick broadcast\",\n  \"campaignName\": \"Shipping notifications 2026-05-06\",\n  \"recipientVariables\": [\n    {\n      \"email\": \"ali@example.com\",\n      \"variables\": {\n        \"name\": \"Ali\",\n        \"trackingNo\": \"TKR123ABC\"\n      }\n    },\n    {\n      \"email\": \"fatimah@example.com\",\n      \"variables\": {\n        \"name\": \"Fatimah\",\n        \"trackingNo\": \"TKR456DEF\"\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
require 'uri'
require 'net/http'

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

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\": \"order_shipped_v2\",\n  \"subject\": \"Your order is on its way\",\n  \"type\": \"quick broadcast\",\n  \"campaignName\": \"Shipping notifications 2026-05-06\",\n  \"recipientVariables\": [\n    {\n      \"email\": \"ali@example.com\",\n      \"variables\": {\n        \"name\": \"Ali\",\n        \"trackingNo\": \"TKR123ABC\"\n      }\n    },\n    {\n      \"email\": \"fatimah@example.com\",\n      \"variables\": {\n        \"name\": \"Fatimah\",\n        \"trackingNo\": \"TKR456DEF\"\n      }\n    }\n  ]\n}"

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

```java Dynamic mode
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.teekrr.com/email")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"templateName\": \"order_shipped_v2\",\n  \"subject\": \"Your order is on its way\",\n  \"type\": \"quick broadcast\",\n  \"campaignName\": \"Shipping notifications 2026-05-06\",\n  \"recipientVariables\": [\n    {\n      \"email\": \"ali@example.com\",\n      \"variables\": {\n        \"name\": \"Ali\",\n        \"trackingNo\": \"TKR123ABC\"\n      }\n    },\n    {\n      \"email\": \"fatimah@example.com\",\n      \"variables\": {\n        \"name\": \"Fatimah\",\n        \"trackingNo\": \"TKR456DEF\"\n      }\n    }\n  ]\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.teekrr.com/email', [
  'body' => '{
  "templateName": "order_shipped_v2",
  "subject": "Your order is on its way",
  "type": "quick broadcast",
  "campaignName": "Shipping notifications 2026-05-06",
  "recipientVariables": [
    {
      "email": "ali@example.com",
      "variables": {
        "name": "Ali",
        "trackingNo": "TKR123ABC"
      }
    },
    {
      "email": "fatimah@example.com",
      "variables": {
        "name": "Fatimah",
        "trackingNo": "TKR456DEF"
      }
    }
  ]
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Dynamic mode
using RestSharp;

var client = new RestClient("https://api.teekrr.com/email");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"templateName\": \"order_shipped_v2\",\n  \"subject\": \"Your order is on its way\",\n  \"type\": \"quick broadcast\",\n  \"campaignName\": \"Shipping notifications 2026-05-06\",\n  \"recipientVariables\": [\n    {\n      \"email\": \"ali@example.com\",\n      \"variables\": {\n        \"name\": \"Ali\",\n        \"trackingNo\": \"TKR123ABC\"\n      }\n    },\n    {\n      \"email\": \"fatimah@example.com\",\n      \"variables\": {\n        \"name\": \"Fatimah\",\n        \"trackingNo\": \"TKR456DEF\"\n      }\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Dynamic mode
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "templateName": "order_shipped_v2",
  "subject": "Your order is on its way",
  "type": "quick broadcast",
  "campaignName": "Shipping notifications 2026-05-06",
  "recipientVariables": [
    [
      "email": "ali@example.com",
      "variables": [
        "name": "Ali",
        "trackingNo": "TKR123ABC"
      ]
    ],
    [
      "email": "fatimah@example.com",
      "variables": [
        "name": "Fatimah",
        "trackingNo": "TKR456DEF"
      ]
    ]
  ]
] as [String : Any]

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

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