---
title: "Retrieve email client previews for an asset"
method: GET
path: "/assets/{asset_id}/email-client-previews"
tags: ["Assets"]
---

# Retrieve email client previews for an asset

`GET /assets/{asset_id}/email-client-previews`

## Request

- Base URL: `https://enterprise.knak.io/api/published/v1`
- URL: `https://enterprise.knak.io/api/published/v1/assets/{asset_id}/email-client-previews`
- Auth: none declared
- TypeScript: <https://skmtc.dev/knak/apis/knak-enterprise-api/docs/assets/:asset_id/email-client-previews/get.ts> (a function with typed inputs; its response is checked against the schema)

Render an email's latest saved version in each of the email clients your company has selected for email testing, and retrieve a screenshot per client.

Rendering is asynchronous. Call this endpoint without `test_id` to start a test: the response carries a `test_id` and is a 202 while any client is still rendering. Then poll with `?test_id=` until a 200 is returned, which means every client has finished. Calling again without `test_id` within 30 minutes of a test, with the email unchanged, may return that test rather than starting a new one.

**Each new test is billed.** Starting a test consumes one render per selected email client from your contracted email testing allowance, the same allowance used by email testing in the Knak app. Polling an existing test with `test_id` is not billed. To avoid paying for duplicate tests, always poll with the `test_id` you were given instead of calling again without it.

Starting a test is limited to 5 requests per minute per user; polling is limited to 60 requests per minute per user. There is no server-side timeout on a test, so set your own limit on how long to keep polling: most tests finish within two minutes, and three minutes is a reasonable cut-off.

Requires the "Can generate email client previews" permission, email client previews enabled for your company, and at least one email client selected by an administrator in Knak.

## Path parameters

- `asset_id` string, required

## Query parameters

- `test_id` string

## Response `200`

Every email client has finished rendering.

- EmailClientPreviews
  - `test_id` string: Identifier of the rendering test. Pass it back as the `test_id` query parameter to poll this test without starting (and paying for) a new one.
  - `data` object[]: One entry per email client the test renders in.
    - `display_name` string, nullable: Human-readable client name. Use this to tell entries apart: different builds of the same client share `client` and `os`.
    - `client` string, nullable
    - `os` string, nullable
    - `category` string, nullable
    - `screenshot` string, nullable: URL of the full-size screenshot. May be set before the client has finished rendering, so rely on `completed`, not on this field.
    - `thumbnail` string, nullable
    - `completed` boolean: Whether this client has finished rendering.

## Other responses

- `202`: One or more email clients are still rendering. Poll again with the returned `test_id` until a 200 is returned.
- `400`: Bad Request - the `test_id` is invalid, or no email clients are selected for your company.
- `401`: Unauthenticated
- `403`: Forbidden
- `404`: Not Found - the asset does not exist, or the `test_id` does not belong to this asset.
- `422`: Unprocessable Entity - the asset is not an email, or it has no saved version to render.
- `429`: Too Many Requests - either this endpoint's rate limit (5 new tests or 60 polls per minute per user) or the rendering provider's own limit was exceeded. Retry no sooner than the `Retry-After` header indicates, when present.
- `502`: Bad Gateway - the rendering provider could not be reached.
- `default`: Unexpected server error.

---

[API](https://skmtc.dev/knak/apis/knak-enterprise-api.md) - [All operations](https://skmtc.dev/knak/apis/knak-enterprise-api/llms.txt) - [OpenAPI document](https://skmtc.dev/knak/apis/knak-enterprise-api/revisions/31d2c94edfcc?raw)
