Postcard API
Fetch the rendered HTML of your Postcard email projects, create new ones (from a template or an AI prompt), and send emails — with optional mustache variable substitution. Authenticate with a personal API key as a Bearer token.
Authentication
Create a key under API & keys and send it as a bearer token.
Authorization: Bearer pc_live_…Base URL
https://email.eliasruiz.com/api/v1Endpoints
/projectsList your email projects
/projectsCreate an email project
Create a new email project. Pass `prompt` to have Postcard AI design the whole email from your brief (counts against your plan's monthly AI allowance), `templateId` to start from a predefined template, or neither for a blank canvas.
/sendSend an email
Send an email to up to 50 recipients — either raw HTML supplied in the request body, or one of your stored projects rendered with `variables` substituted into its `{{ mustache }}` placeholders. Requires the server to have SMTP configured.
/projects/{id}Get one project (metadata + variables)
/templatesList templates from a project (or the root)
List every template (email document) you own. Pass `projectId` to scope to a single project; omit it (or pass `root`) to get every template across all your projects — the root that holds them all. `include=metadata` (default) returns lightweight metadata and ids; `include=full` also returns each template's structured `document` and rendered `html` (with each variable's default value substituted).
/projects/{id}/htmlRender one project to HTML
Returns the rendered email HTML. Supply variable values as query params (e.g. `?firstName=Ada`) to substitute the template's `{{ mustache }}` placeholders; undeclared values fall back to each variable's default. Pass `?format=html` to receive raw `text/html` instead of JSON.
Example: render with variables
# Render a project to raw HTML, substituting {{ firstName }}
curl -H "Authorization: Bearer pc_live_…" \
"https://email.eliasruiz.com/api/v1/projects/PROJECT_ID/html?firstName=Ada&format=html" Any query param that matches a {{ mustache }} variable is substituted; unspecified variables fall back to the sample value you set in the editor.