---
title: "Create Template Preview Send Job"
description: "How to call Create Template Preview Send Job (POST /api/template-preview-send-jobs) in the Klaviyo REST API: authentication, parameters, request and response bodies, and an example request."
url: "https://developers.klaviyo.com/en/reference/create_template_preview_send_job"
revision: "2026-10-15"
operationId: "create_template_preview_send_job"
method: "POST"
endpoint: "https://a.klaviyo.com/api/template-preview-send-jobs"
authentication: "privateKey"
scopes: ["templates:write"]
rateLimits: {"burst":"1/s","steady":"15/m","daily":"100/d"}
revisionHeader: {"name":"revision","required":true}
deprecated: false
openApi: "https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/create_template_preview_send_job.json"
jsonApi: {"fields":{"template-preview-send-job":["created_at","id","status"]}}
related: ["https://developers.klaviyo.com/en/reference/templates/llms.txt","https://developers.klaviyo.com/en/reference/get_templates.md","https://developers.klaviyo.com/en/reference/get_template.md","https://developers.klaviyo.com/en/reference/create_template.md","https://developers.klaviyo.com/en/reference/update_template.md","https://developers.klaviyo.com/en/reference/delete_template.md","https://developers.klaviyo.com/en/reference/get_template_conversion_jobs.md","https://developers.klaviyo.com/en/reference/get_template_conversion_job.md","https://developers.klaviyo.com/en/reference/create_template_conversion_job.md","https://developers.klaviyo.com/en/reference/render_template.md","https://developers.klaviyo.com/en/reference/clone_template.md"]
---

# Create Template Preview Send Job

> This is the Markdown version of https://developers.klaviyo.com/en/reference/create_template_preview_send_job

```http
POST https://a.klaviyo.com/api/template-preview-send-jobs
```

Send a test email of a template to one or more recipients.

- Revision header: `revision: 2026-10-15` (required)
- Scopes: `templates:write`
- Rate limits: Burst: `1/s`, Steady: `15/m`, Daily: `100/d`
- OpenAPI: [Download this endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/create_template_preview_send_job.json)

## Example request

### curl

```bash
curl --request POST \
     --url 'https://a.klaviyo.com/api/template-preview-send-jobs' \
     --header 'Authorization: Klaviyo-API-Key your-private-api-key' \
     --header 'accept: application/vnd.api+json' \
     --header 'revision: 2026-10-15' \
     --header 'content-type: application/vnd.api+json' \
     --data '{
  "data": {
    "type": "template-preview-send-job",
    "attributes": {
      "recipients": [
        "test@example.com"
      ],
      "context": {
        "first_name": "Jane"
      }
    },
    "relationships": {
      "template": {}
    }
  }
}'
```

### CLI

```bash
klaviyo templates create-template-preview-send-job \
  -d '{
  "data": {
    "type": "template-preview-send-job",
    "attributes": {
      "recipients": [
        "test@example.com"
      ],
      "context": {
        "first_name": "Jane"
      }
    },
    "relationships": {
      "template": {}
    }
  }
}'
```

Sign in first with `klaviyo auth login`. [Install the Klaviyo CLI](https://developers.klaviyo.com/en/docs/klaviyo_cli.md)

### Python

```python
from klaviyo_api import KlaviyoAPI

klaviyo = KlaviyoAPI("your-private-api-key")

response = klaviyo.Templates.create_template_preview_send_job(
    {
        "data": {
            "type": "template-preview-send-job",
            "attributes": {
                "recipients": [
                    "test@example.com",
                ],
                "context": {
                    "first_name": "Jane",
                },
            },
            "relationships": {
                "template": {},
            },
        },
    },
)
```

Install it with `pip install klaviyo-api`. [The Python SDK on GitHub](https://github.com/klaviyo/klaviyo-api-python)

### Node.js

```javascript
import { ApiKeySession, TemplatesApi } from 'klaviyo-api'

const session = new ApiKeySession('your-private-api-key')
const templatesApi = new TemplatesApi(session)

const response = await templatesApi.createTemplatePreviewSendJob(
  {
    data: {
      type: 'template-preview-send-job',
      attributes: {
        recipients: [
          'test@example.com',
        ],
        context: {
          first_name: 'Jane',
        },
      },
      relationships: {
        template: {},
      },
    },
  },
)
```

Install it with `npm install klaviyo-api`. [The Node.js SDK on GitHub](https://github.com/klaviyo/klaviyo-api-node)

### Ruby

```ruby
require 'klaviyo-api-sdk'

KlaviyoAPI.configure do |config|
  config.api_key['Klaviyo-API-Key'] = 'Klaviyo-API-Key your-private-api-key'
end

response = KlaviyoAPI::Templates.create_template_preview_send_job(
  {
    data: {
      type: 'template-preview-send-job',
      attributes: {
        recipients: [
          'test@example.com',
        ],
        context: {
          first_name: 'Jane',
        },
      },
      relationships: {
        template: {},
      },
    },
  },
)
```

Install it with `gem install klaviyo-api-sdk`. [The Ruby SDK on GitHub](https://github.com/klaviyo/klaviyo-api-ruby)

### PHP

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

use KlaviyoAPI\KlaviyoAPI;

$klaviyo = new KlaviyoAPI('your-private-api-key');

$response = $klaviyo->Templates->createTemplatePreviewSendJob(
    [
        'data' => [
            'type' => 'template-preview-send-job',
            'attributes' => [
                'recipients' => [
                    'test@example.com',
                ],
                'context' => [
                    'first_name' => 'Jane',
                ],
            ],
            'relationships' => [
                'template' => new \stdClass(),
            ],
        ],
    ],
);
```

Install it with `composer require klaviyo/api`. [The PHP SDK on GitHub](https://github.com/klaviyo/klaviyo-api-php)

## Query parameters

- `fields[template-preview-send-job]` (string[]): For more information please visit [API overview](https://developers.klaviyo.com/en/reference.md) Allowed values: `created_at`, `id`, `status`

## Headers

- `revision` (string, required): API endpoint revision (format: YYYY-MM-DD[.suffix]) Default: `2026-10-15`

## Request body

Content type: `application/vnd.api+json` (required)

- `data` (object, required)
  - `type` (string, required): Allowed values: `template-preview-send-job`
  - `attributes` (object, required)
    - `recipients` (string[], required): A list of email addresses to send the test email to. Limited to 5 recipients per request.
    - `context` (object, nullable): A JSON object of merge-variable values to render the template with. See [the template context docs](https://help.klaviyo.com/hc/en-us/articles/4408802648731) for details.
  - `relationships` (object, required)
    - `template` (object, required)
      - `data` (object): Fields nested this deep are in [the endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/create_template_preview_send_job.json).
    - `profile` (object)
      - `data` (object): Fields nested this deep are in [the endpoint's OpenAPI document](https://raw.githubusercontent.com/klaviyo/openapi/2026-10-15/openapi/stable/apis/create_template_preview_send_job.json).

### Example request body

```json
{
  "data": {
    "type": "template-preview-send-job",
    "attributes": {
      "recipients": [
        "test@example.com"
      ],
      "context": {
        "first_name": "Jane"
      }
    },
    "relationships": {
      "template": {}
    }
  }
}
```

## Responses

### 202: Success

Content type: `application/vnd.api+json`

- `data` (object, required)
  - `type` (string, required): Allowed values: `template-preview-send-job`
  - `id` (string, required): ID of the test-send job.
  - `attributes` (object, required)
    - `status` (string, required): The status of the job. Allowed values: `cancelled`, `complete`, `processing`, `queued`
    - `created_at` (string<date-time>, required): Datetime when the job was created Example: `2022-11-08T00:00:00+00:00`
  - `links` (object, required)
    - `self` (string<uri>, required)
- `links` (ObjectLinks): Same fields as the first ObjectLinks above.
- `meta` (object): Response-level metadata
  - `agent_hints` (object): Optional hints emitted by the API for agent callers
    - `next_steps` (string[]): Suggested follow-up actions for agents to take after this response

#### Example response body

```json
{
  "data": {
    "type": "template-preview-send-job",
    "id": "string",
    "attributes": {
      "status": "cancelled",
      "created_at": "2022-11-08T00:00:00+00:00"
    },
    "links": {
      "self": "https://www.example.com"
    }
  },
  "links": {
    "self": "https://www.example.com"
  },
  "meta": {
    "agent_hints": {
      "next_steps": [
        "string"
      ]
    }
  }
}
```

### 4XX: Client Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```

### 5XX: Server Error

Content type: `application/vnd.api+json`

- `errors` (object[], required)
  - `id` (string, required)
  - `code` (string, required)
  - `title` (string, required)
  - `detail` (string, required)
  - `source` (object)
    - `pointer` (string)
    - `parameter` (string)

#### Example response body

```json
{
  "errors": [
    {
      "id": "string",
      "code": "string",
      "title": "string",
      "detail": "string",
      "source": {
        "pointer": "string",
        "parameter": "string"
      }
    }
  ]
}
```
