Recipients
Fetch recipient preview
Download a rendered PNG preview for a Scribeless recipient.
Download a rendered PNG preview when your integration needs to show or store the generated recipient artwork.
GET https://platform.scribeless.co/api/recipients/{recipientId}/preview
Headers
X-API-Key: YOUR_API_KEY
Path parameters
| Parameter | Type | Description |
|---|---|---|
recipientId | string | Scribeless recipient ID. |
Query parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
type | string | Yes | Document type to preview. One of note, postcard, or envelope. |
page | number | No | Zero-indexed page number. Defaults to 0. |
The preview endpoint downloads PNG previews. Do not send a format parameter.
Example request
curl --location 'https://platform.scribeless.co/api/recipients/RECIPIENT_ID/preview?type=postcard&page=0' \
--header 'X-API-Key: YOUR_API_KEY' \
--output preview.png
Finding the right preview
Create-recipient responses do not include preview URLs. To fetch a preview:
- Create the recipient.
- Fetch the recipient with
GET /api/recipients/{recipientId}. - Check that
is_renderedistrueand find adocumentsentry withformat: "preview". - Use the document type and page number with this preview endpoint.
For a preview document like this:
{
"format": "preview",
"src": "teams/TEAM_ID/campaigns/CAMPAIGN_ID/recipients/RECIPIENT_ID/postcard-1.png",
"document": {
"type": "postcard"
}
}
Call:
GET /api/recipients/RECIPIENT_ID/preview?type=postcard&page=0
The page query parameter is zero-indexed, so postcard-1.png is fetched with page=0.
Status codes
| Status | Meaning |
|---|---|
200 | Preview PNG downloaded. |
400 | Missing or invalid type query parameter. |
401 | Missing, malformed, invalid, or unauthorized API key. |
404 | Recipient, document type, or preview page not found. The recipient may not have rendered yet. |
500 | Preview could not be fetched. Retry or contact support if it persists. |