API Documentation
POST /screenshots
Generate screenshots for an HTML email.
Screenshot API results are only accessible via the API and do not appear in your preflight.qa account.
Parameters are required unless marked as optional.
| Parameter | Description |
|---|---|
| html Required | The HTML text to render within email applications. |
| guid Optional | Recommended if you already have an identifier pattern. If not supplied, we generate one for you.
The guid is returned as part of the |
| webhook Optional | If supplied, we send POST updates to this endpoint as screenshots are processed. If not supplied, fetch results later using the guid from GET /screenshots/:guid. |
| apps Optional | Email apps and modes to screenshot. If not supplied, we test against all available clients. |
Example Request:
curl -X POST "https://api.preflight.qa/screenshots" \
-H "Authorization: Bearer <api_token>" \
-H "Content-Type: application/json" \
-d '{
"guid": "abc123",
"webhook": "https://partner.com/webhook",
"html": "<html>...</html>",
"apps": {
"apple_mail_mac": { "modes": ["light", "dark"] },
"outlook_mac": { "modes": ["light", "dark"] }
}
}' Example OK - HTTP 202 Response:
{
"meta":{
"guid": "abc123",
"status": "accepted",
"code": 202
}
} Example Error - HTTP 4xx Response:
{
"error":{
"status": "Bad Request",
"code": 400,
"message": "No HTML supplied."
}
}