Introduction
The Posthero API lets you do from code everything you do in the dashboard for a PDF-based campaign: upload the design, manage audiences (segments, contacts and custom fields), create the campaign, get a quote, launch it (with the card on file or by invoice), add recipients to automated campaigns, pause and resume them, and track deliveries and print orders.
Everything is JSON (Content-Type: application/json) except design uploads, which use multipart/form-data. Dates are ISO 8601 UTC, money is in euros as decimal numbers, and ids are UUIDs except print orders (integers). DELETE endpoints answer 204 with no body.
Quickstart
- 1
Open the dashboard at Settings → API keys. Create a key (account admins only).
- 2
Store it in an environment variable:
bashexport POSTHERO_API_KEY="your_api_key" - 3
Make your first call. If you see your account name, you are all set:
curlcurl https://api.posthero.app/v1/account \ -H "x-api-key: $POSTHERO_API_KEY"
Authentication
Send your API key with every request, in the x-api-key header or as Authorization: Bearer <key>. A key acts on its whole account, within its permissions; expired keys answer 401. These are the same keys the MCP server (POST /v1/mcp) uses.
Treat it like a password: keep it server-side and never ship it in a browser or mobile app.
curl https://api.posthero.app/v1/account \
-H "x-api-key: $POSTHERO_API_KEY" curl https://api.posthero.app/v1/account \
-H "Authorization: Bearer $POSTHERO_API_KEY" Permissions
When you create a key in Settings → API keys you choose what it can do, and you can change it later without rotating it. Give each integration only what it needs: if a key leaks, the damage is limited to those permissions.
scopes: null
Full access
Everything the account can do, including launching campaigns. The default, and what every key created before permissions existed keeps.
*:read
Read only
Every :read permission. Great for dashboards, BI or syncing delivery status: it never creates, changes or spends anything.
[…]
Custom
Pick individual permissions. For example, audience:write for an integration that only syncs contacts.
account:read designs:read designs:write designs:read. audience:read audience:write audience:read. campaigns:read campaigns:write campaigns:read. campaigns:launch POST /campaigns/{id}/recipients and adding contacts to a segment that feeds a LIVE or PAUSED automated campaign. Includes campaigns:read. deliveries:read Write includes read of the same resource, and campaigns:launch includes campaigns:read. Nothing else: campaigns:write cannot launch and campaigns:launch cannot edit campaigns. GET /v1 (key check) works with any key. Every endpoint in the reference shows the permission it needs.
POST /segments/{id}/contacts needs audience:write and, in addition, campaigns:launch when the segment feeds a LIVE or PAUSED automated campaign, because every new contact is printed and billed.
The MCP server applies the same permissions: tools the key cannot use are not listed.
Without the permission the API answers 403 INSUFFICIENT_SCOPE before doing anything (no file is uploaded, nothing is charged), naming the missing permission in requiredScope:
{
"statusCode": 403,
"code": "INSUFFICIENT_SCOPE",
"message": "This API key does not have the \"campaigns:launch\" permission. Edit the key's permissions in Posthero (Settings → API keys) or use a key that has it.",
"requiredScope": "campaigns:launch"
} Errors
Errors use standard HTTP status codes and a body with statusCode, a stable code (branch on this) and a human-readable message.
{
"statusCode": 404,
"code": "NOT_FOUND",
"message": "Campaign … not found in this account."
} VALIDATION_ERROR Invalid input. Includes details. UNAUTHORIZED Missing, invalid or expired API key. PAYMENT_METHOD_REQUIRED Card account with no card on file. PAYMENT_FAILED Charge declined or needs 3-D Secure. Nothing is launched. INSUFFICIENT_SCOPE The key is valid but lacks the permission the endpoint needs. Includes requiredScope. See Permissions. NOT_FOUND The resource does not exist in this account. CONFLICT The current state does not allow the action, or duplicate name. DESIGN_RENDER_NOT_READY The design is not print-ready yet. PRICE_UNAVAILABLE The price cannot be computed. CAMPAIGN_NOT_READY Something is missing to launch. Includes blockers. RATE_LIMITED Too many requests. Honour Retry-After. INTERNAL_ERROR Our fault. Retry later. Pagination
List endpoints take page (from 1) and limit (1–100, default 20) and answer with this envelope:
{
"data": [ … ],
"page": 1,
"limit": 20,
"total": 134,
"pageCount": 7
} Rate limits
120 requests per minute per API key. Every response carries X-RateLimit-Limit and X-RateLimit-Remaining. Over the limit you get a 429 RATE_LIMITED with a Retry-After header (seconds to wait).
To load many contacts, send batches of up to 500 per request to POST /segments/{id}/contacts instead of one by one.
Idempotency
POST /campaigns/{id}/launch accepts an Idempotency-Key header (any string up to 255 characters). If you retry with the same key, for example after a timeout, you are never charged twice. A successful launch is replayed with the same response for 24 hours. A failed payment is not cached: once the card issue is fixed, retry with a new key. A campaign can only be launched once anyway: launching moves it out of DRAFT.
Launch and payment
Before launching, GET /campaigns/{id}/quote tells you how many pieces will be sent, the total without and with VAT, how it will be paid (paymentMethod) and whether anything blocks it (canLaunch, blockers). On launch, payment depends on the account payment method (paymentType and cardOnFile in GET /account):
INVOICE_30_DAYS
Invoice account
The campaign launches right away and is billed on your monthly invoice.
STRIPE
Card on file
The quoted total is charged to the card on file (Stripe invoice, tax computed by Stripe) and the campaign launches once the charge succeeds.
402
Payment not possible
PAYMENT_METHOD_REQUIRED: no card on file; pay one campaign from the dashboard or add a card in billing. PAYMENT_FAILED: declined or needs 3-D Secure; nothing is launched and the invoice is voided.
The launch response is { campaign, payment: { method, amount, currency, invoiceId? } }. ONE_OFF campaigns go to COMPLETED and their deliveries are created right away; AUTOMATED and RECURRENT go LIVE and every later delivery is billed the same way.
PDF print specs
-
Size and bleed
Final size of the format +
bleedMmof bleed on every side (both inGET /products). -
Safe area
Keep text and key elements more than
safeMmaway from the trim edge. -
Fonts
All fonts embedded in the PDF. CMYK recommended.
-
Weight
PDF only (
%PDF), max 50 MB per file. -
Letters (
DOC)One PDF in
frontwith the whole letter, up tomaxPagespages. -
Postcards and flyers (
FLYER)Two PDFs:
frontandbackfaces.
Typical flow
- 01.
GET /products→ pick a format. - 02.
POST /designswith the PDF. - 03.
POST /segmentswith the contacts (orPOST /custom-fieldsfirst if you use variables). - 04.
POST /campaignswithsegmentIdanddesignId. - 05.
GET /campaigns/{id}/quote→ check quantity, total andcanLaunch. - 06.
POST /campaigns/{id}/launch. - 07. Poll
GET /orders?campaignId=orGET /campaigns/{id}/deliveriesfor status.
Contact imports are asynchronous: if you launch right after creating the segment it may still be empty. Check canLaunch in the quote (or the stats of GET /segments/{id}) before launching, as the JavaScript example does.
// Node.js 18+ (fetch, FormData and Blob are built in)
import { readFile } from 'node:fs/promises';
import { randomUUID } from 'node:crypto';
const API = 'https://api.posthero.app/v1';
const KEY = process.env.POSTHERO_API_KEY;
async function posthero(path, { json, ...init } = {}) {
const res = await fetch(API + path, {
...init,
headers: {
'x-api-key': KEY,
...(json ? { 'Content-Type': 'application/json' } : {}),
...init.headers,
},
body: json ? JSON.stringify(json) : init.body,
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.message}`);
return body;
}
// 1. Format id, copied from GET /products
const PRODUCT_ID = 'PRODUCT_ID';
// 2. Upload the PDF design
const form = new FormData();
form.append('name', 'Carta VIP');
form.append('productId', PRODUCT_ID);
form.append('front', new Blob([await readFile('carta.pdf')], { type: 'application/pdf' }), 'carta.pdf');
const design = await posthero('/designs', { method: 'POST', body: form });
// 3. Create the segment (the import is asynchronous: 202)
const { segmentId } = await posthero('/segments', {
method: 'POST',
json: {
name: 'Clientes VIP noviembre',
contacts: [
{
firstName: 'Laura',
lastName: 'García',
address: { address1: 'Calle Mayor 12', zip: '28013', city: 'Madrid', countryCode: 'ES' },
},
],
},
});
// 4. Create the campaign as DRAFT
const campaign = await posthero('/campaigns', {
method: 'POST',
json: { name: 'VIP noviembre', type: 'ONE_OFF', segmentId, designId: design.id },
});
// 5. Wait for the import, then check the quote
let quote;
for (let i = 0; i < 10; i++) {
quote = await posthero(`/campaigns/${campaign.id}/quote`);
if (quote.canLaunch) break;
await new Promise((r) => setTimeout(r, 3000));
}
if (!quote.canLaunch) throw new Error('Not ready: ' + quote.blockers.join(', '));
console.log(`${quote.quantity} pieces, ${quote.totalWithVat} EUR (VAT incl.)`);
// 6. Launch (the idempotency key makes retries safe)
const { payment } = await posthero(`/campaigns/${campaign.id}/launch`, {
method: 'POST',
headers: { 'Idempotency-Key': randomUUID() },
});
console.log('Paid by', payment.method, payment.amount, payment.currency);
// 7. Later: poll the print orders
const orders = await posthero(`/orders?campaignId=${campaign.id}`); # 1. Pick a format
curl https://api.posthero.app/v1/products -H "x-api-key: $POSTHERO_API_KEY"
# 2. Upload the PDF
curl -X POST https://api.posthero.app/v1/designs -H "x-api-key: $POSTHERO_API_KEY" \
-F name="Carta VIP" -F productId=PRODUCT_ID -F front=@carta.pdf
# 3. Create the segment with contacts
curl -X POST https://api.posthero.app/v1/segments -H "x-api-key: $POSTHERO_API_KEY" \
-H "Content-Type: application/json" -d @segmento.json
# 4. Create the campaign
curl -X POST https://api.posthero.app/v1/campaigns -H "x-api-key: $POSTHERO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "VIP noviembre", "segmentId": "SEGMENT_ID", "designId": "DESIGN_ID" }'
# 5. Quote
curl https://api.posthero.app/v1/campaigns/CAMPAIGN_ID/quote -H "x-api-key: $POSTHERO_API_KEY"
# 6. Launch
curl -X POST https://api.posthero.app/v1/campaigns/CAMPAIGN_ID/launch \
-H "x-api-key: $POSTHERO_API_KEY" -H "Idempotency-Key: vip-noviembre-2026"
# 7. Track status
curl "https://api.posthero.app/v1/orders?campaignId=CAMPAIGN_ID" -H "x-api-key: $POSTHERO_API_KEY" Triggered mail
To send a letter or postcard when something happens in your system (abandoned cart, first purchase, renewal…): create an AUTOMATED campaign once, launch it, and then for each event pick one of these two options:
- A. Add the contact to the segment with
POST /segments/{id}/contacts. Every new contact in a segment with a LIVE automated campaign is mailed and billed. - B. Send to one recipient with
POST /campaigns/{id}/recipients, without touching segments. It returns thedeliveryIdfor you to store.
# Once: automated campaign on a segment, then launch it
curl -X POST https://api.posthero.app/v1/campaigns \
-H "x-api-key: $POSTHERO_API_KEY" -H "Content-Type: application/json" \
-d '{ "name": "Carrito abandonado", "type": "AUTOMATED",
"segmentId": "SEGMENT_ID", "designId": "DESIGN_ID" }'
curl -X POST https://api.posthero.app/v1/campaigns/CAMPAIGN_ID/launch \
-H "x-api-key: $POSTHERO_API_KEY" -H "Idempotency-Key: carrito-launch"
# Per event, option A: add the contact to the segment
curl -X POST https://api.posthero.app/v1/segments/SEGMENT_ID/contacts \
-H "x-api-key: $POSTHERO_API_KEY" -H "Content-Type: application/json" \
-d '{ "contacts": [ { "firstName": "Pablo", "emailAddress": "pablo@example.com",
"address": { "address1": "Av. Diagonal 400", "zip": "08037", "city": "Barcelona" },
"customFields": { "coupon": "VUELVE10" } } ] }'
# Per event, option B: one recipient, no segment changes
curl -X POST https://api.posthero.app/v1/campaigns/CAMPAIGN_ID/recipients \
-H "x-api-key: $POSTHERO_API_KEY" -H "Content-Type: application/json" \
-d '{ "firstName": "Pablo", "emailAddress": "pablo@example.com",
"address": { "address1": "Av. Diagonal 400", "zip": "08037", "city": "Barcelona" } }' // e.g. inside your abandoned-cart webhook handler
export async function onCartAbandoned(customer) {
const res = await fetch(`https://api.posthero.app/v1/campaigns/${process.env.POSTHERO_CART_CAMPAIGN_ID}/recipients`, {
method: 'POST',
headers: {
'x-api-key': process.env.POSTHERO_API_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({
firstName: customer.firstName,
lastName: customer.lastName,
emailAddress: customer.email,
address: {
address1: customer.address.line1,
zip: customer.address.postalCode,
city: customer.address.city,
countryCode: customer.address.country,
},
customFields: { coupon: 'VUELVE10' },
}),
});
if (res.status !== 201) throw new Error(`Posthero ${res.status}`);
const { deliveryId } = await res.json();
return deliveryId;
} Reference
Account
Details of the account the API key belongs to. Use it to check that your key works and how your campaigns will be paid.
Retrieve the account
Returns id, name, subscriptionPlan, subscriptionActive, paymentType (INVOICE_30_DAYS or STRIPE), cardOnFile (null for invoice accounts), orderFrequency, addressEnrichment and counts.
curl https://api.posthero.app/v1/account \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"id": "0b6f2c1e-7d4a-4c1b-9a51-3f2e8d7c6b5a",
"name": "Mueblería Sol",
"subscriptionPlan": "GROWTH",
"subscriptionActive": true,
"paymentType": "STRIPE",
"cardOnFile": true,
"orderFrequency": "DAILY",
"addressEnrichment": true,
"counts": {
"campaigns": {
"total": 7,
"byStatus": {
"DRAFT": 2,
"PAUSED": 0,
"LIVE": 1,
"COMPLETED": 4
}
},
"segments": 5,
"contacts": 4820,
"designs": 6,
"customFields": 2
}
} Check your API key
Minimal ping to https://api.posthero.app/v1: answers { "message": "Hello <account>" } if the key is valid.
curl https://api.posthero.app/v1 \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"message": "Hello Mueblería Sol",
"tenant": {
"id": "0b6f2c1e-7d4a-4c1b-9a51-3f2e8d7c6b5a",
"name": "Mueblería Sol"
},
"docs": "https://docs.posthero.app/"
} {
"statusCode": 401,
"code": "UNAUTHORIZED",
"message": "Invalid API key."
} Reference
Products (print formats)
The print formats available to your account: the standard ones plus any custom formats you have. Every design is created for a product.
List formats
Returns { data: [...] } (not paginated). Each product has id, kind (standard / custom), type (DOC letter / FLYER postcard or flyer), label, size, widthMm, heightMm, bleedMm, safeMm, faces (front / back / both) and maxPages.
curl https://api.posthero.app/v1/products \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"data": [
{
"id": "8e2d4f6a-1b3c-4d5e-8f70-9a1b2c3d4e5f",
"kind": "standard",
"type": "FLYER",
"label": "A4/3 Flyer",
"description": null,
"size": "A4/3",
"sizeDetail": "210 × 99 mm",
"envelopeSize": null,
"widthMm": 210,
"heightMm": 99,
"bleedMm": 3,
"safeMm": 5,
"faces": "both",
"maxPages": 1
}
]
} Price tiers
Price tiers of that format for your account: { productId, currency, vatIncluded, tiers: [{ minQuantity, unitPrice }] }, in euros, VAT excluded.
id Product id.
curl https://api.posthero.app/v1/products/{id}/pricing \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"productId": "8e2d4f6a-1b3c-4d5e-8f70-9a1b2c3d4e5f",
"currency": "EUR",
"vatIncluded": false,
"tiers": [
{
"minQuantity": 1,
"unitPrice": 1.2
},
{
"minQuantity": 500,
"unitPrice": 0.95
},
{
"minQuantity": 2000,
"unitPrice": 0.82
}
]
} Reference
Designs (PDF)
The API only accepts PDF designs (the editor and templates live in the dashboard). The PDF you upload is the print file, so the design is print-ready immediately.
List designs
type Filter by product type (DOC or FLYER).
page Page number, starting at 1.
limit Results per page (1–100, default 20).
curl https://api.posthero.app/v1/designs?type=DOC \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"data": [
{
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP",
"type": "FLYER",
"orientation": "HORIZONTAL",
"source": "pdf",
"product": {
"id": "8e2d4f6a-1b3c-4d5e-8f70-9a1b2c3d4e5f",
"kind": "standard",
"label": "A4/3 Flyer",
"size": "A4/3"
},
"printReady": true,
"files": [
{
"face": "front",
"fileId": "4d6f8a0c-2e4b-4d6f-8a1c-3e5b7d9f1a2c"
},
{
"face": "back",
"fileId": "6f8a0c2e-4b6d-4f8a-9c3e-5b7d9f1a3c4e"
}
],
"createdAt": "2026-11-24T09:28:00.000Z",
"updatedAt": "2026-11-24T09:28:00.000Z"
}
],
"page": 1,
"limit": 20,
"total": 1,
"pageCount": 1
} Retrieve a design
Includes files: [{ face, fileId, url }] (signed URL, valid for 1 hour) and printReady.
id Design id.
curl https://api.posthero.app/v1/designs/{id} \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP",
"type": "FLYER",
"orientation": "HORIZONTAL",
"source": "pdf",
"product": {
"id": "8e2d4f6a-1b3c-4d5e-8f70-9a1b2c3d4e5f",
"kind": "standard",
"label": "A4/3 Flyer",
"size": "A4/3"
},
"printReady": true,
"files": [
{
"face": "front",
"fileId": "4d6f8a0c-2e4b-4d6f-8a1c-3e5b7d9f1a2c",
"url": "https://files.posthero.app/…/api-…-front.pdf?X-Amz-Signature=…"
},
{
"face": "back",
"fileId": "6f8a0c2e-4b6d-4f8a-9c3e-5b7d9f1a3c4e",
"url": "https://files.posthero.app/…/api-…-back.pdf?X-Amz-Signature=…"
}
],
"createdAt": "2026-11-24T09:28:00.000Z",
"updatedAt": "2026-11-24T09:28:00.000Z"
} Create a design from a PDF
multipart/form-data request. For letters (DOC), front is the whole letter: one PDF of up to maxPages pages. For postcards and flyers, front and back are the two faces. PDF only (the %PDF signature is checked), max 50 MB per file.
name Design name.
productId Format id, from GET /products.
orientation VERTICAL (default) or HORIZONTAL.
front Whole letter or front face.
back Back face (postcards and flyers).
curl -X POST https://api.posthero.app/v1/designs \
-H "x-api-key: $POSTHERO_API_KEY" \
-F name="Carta bienvenida" \
-F productId=PRODUCT_ID \
-F front=@carta.pdf curl -X POST https://api.posthero.app/v1/designs \
-H "x-api-key: $POSTHERO_API_KEY" \
-F name="Postal Black Friday" \
-F productId=PRODUCT_ID \
-F orientation=HORIZONTAL \
-F front=@delante.pdf \
-F back=@detras.pdf Response
{
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP",
"type": "FLYER",
"orientation": "HORIZONTAL",
"source": "pdf",
"product": {
"id": "8e2d4f6a-1b3c-4d5e-8f70-9a1b2c3d4e5f",
"kind": "standard",
"label": "A4/3 Flyer",
"size": "A4/3"
},
"printReady": true,
"files": [
{
"face": "front",
"fileId": "4d6f8a0c-2e4b-4d6f-8a1c-3e5b7d9f1a2c",
"url": "https://files.posthero.app/…/api-…-front.pdf?X-Amz-Signature=…"
},
{
"face": "back",
"fileId": "6f8a0c2e-4b6d-4f8a-9c3e-5b7d9f1a3c4e",
"url": "https://files.posthero.app/…/api-…-back.pdf?X-Amz-Signature=…"
}
],
"createdAt": "2026-11-24T09:28:00.000Z",
"updatedAt": "2026-11-24T09:28:00.000Z"
} {
"statusCode": 400,
"code": "VALIDATION_ERROR",
"message": "front: only PDF files are accepted.",
"details": [
{
"path": "front",
"message": "Not a PDF file."
}
]
} Rename a design
id Design id.
name New name.
curl -X PATCH https://api.posthero.app/v1/designs/{id} \
-H "x-api-key: $POSTHERO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "Carta bienvenida v2" }' Response
{
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP (v2)",
"type": "FLYER",
"orientation": "HORIZONTAL",
"source": "pdf",
"product": {
"id": "8e2d4f6a-1b3c-4d5e-8f70-9a1b2c3d4e5f",
"kind": "standard",
"label": "A4/3 Flyer",
"size": "A4/3"
},
"printReady": true,
"files": [
{
"face": "front",
"fileId": "4d6f8a0c-2e4b-4d6f-8a1c-3e5b7d9f1a2c",
"url": "https://files.posthero.app/…/api-…-front.pdf?X-Amz-Signature=…"
},
{
"face": "back",
"fileId": "6f8a0c2e-4b6d-4f8a-9c3e-5b7d9f1a3c4e",
"url": "https://files.posthero.app/…/api-…-back.pdf?X-Amz-Signature=…"
}
],
"createdAt": "2026-11-24T09:28:00.000Z",
"updatedAt": "2026-11-24T09:28:00.000Z"
} Replace the PDFs
Multipart with front and/or back. Returns 409 if a LIVE, PAUSED or COMPLETED campaign or a pending print order uses the design: create a new design instead.
id Design id.
front New front PDF or letter.
back New back PDF.
curl -X PUT https://api.posthero.app/v1/designs/{id}/files \
-H "x-api-key: $POSTHERO_API_KEY" \
-F front=@carta-v2.pdf Response
{
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP",
"type": "FLYER",
"orientation": "HORIZONTAL",
"source": "pdf",
"product": {
"id": "8e2d4f6a-1b3c-4d5e-8f70-9a1b2c3d4e5f",
"kind": "standard",
"label": "A4/3 Flyer",
"size": "A4/3"
},
"printReady": true,
"files": [
{
"face": "front",
"fileId": "4d6f8a0c-2e4b-4d6f-8a1c-3e5b7d9f1a2c",
"url": "https://files.posthero.app/…/api-…-front.pdf?X-Amz-Signature=…"
},
{
"face": "back",
"fileId": "6f8a0c2e-4b6d-4f8a-9c3e-5b7d9f1a3c4e",
"url": "https://files.posthero.app/…/api-…-back.pdf?X-Amz-Signature=…"
}
],
"createdAt": "2026-11-24T09:28:00.000Z",
"updatedAt": "2026-11-24T11:02:00.000Z"
} {
"statusCode": 409,
"code": "CONFLICT",
"message": "Design a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d is used by the LIVE campaign \"VIP noviembre\" (3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e), so its content, type, orientation and product cannot be changed through this API (only its name). Create a new design with create_design instead."
} Delete a design
Answers 204 with no body. Returns 409 if any campaign uses the design.
id Design id.
curl -X DELETE https://api.posthero.app/v1/designs/{id} \
-H "x-api-key: $POSTHERO_API_KEY" Response
HTTP/1.1 204 No Content Reference
Custom fields
Your own contact variables (a coupon, the last product bought…). Create them before sending them in customFields.
List custom fields
curl https://api.posthero.app/v1/custom-fields \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"data": [
{
"id": "c0f3a5b7-9d1e-4f2a-8b3c-5d7e9f1a3b5c",
"name": "coupon",
"label": "Cupón",
"type": "text",
"description": null,
"createdAt": "2026-11-20T12:00:00.000Z"
}
],
"page": 1,
"limit": 20,
"total": 1,
"pageCount": 1
} Create a custom field
name Key you will use in customFields.
label Display name.
type text, boolean or image.
description Optional description.
curl -X POST https://api.posthero.app/v1/custom-fields \
-H "x-api-key: $POSTHERO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "coupon", "label": "Cupón", "type": "text" }' Response
{
"id": "c0f3a5b7-9d1e-4f2a-8b3c-5d7e9f1a3b5c",
"name": "coupon",
"label": "Cupón",
"type": "text",
"description": null,
"createdAt": "2026-11-20T12:00:00.000Z"
} Reference
Segments (audiences)
A segment is the recipient list of a campaign. Contact imports are asynchronous: the API answers 202 and contacts show up within seconds.
List segments
page Page number, starting at 1.
limit Results per page (1–100, default 20).
curl https://api.posthero.app/v1/segments \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"data": [
{
"id": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"name": "Clientes VIP noviembre",
"description": null,
"createdAt": "2026-11-24T09:29:00.000Z",
"updatedAt": "2026-11-24T09:29:00.000Z"
}
],
"page": 1,
"limit": 20,
"total": 5,
"pageCount": 1
} Create a segment
Creates the segment and optionally queues up to 500 contacts. Answers 202 with { segmentId, contactsQueued, importJobsEnqueued }.
name Segment name.
description Description.
contacts Up to 500 contacts. See Contact object.
curl -X POST https://api.posthero.app/v1/segments \
-H "x-api-key: $POSTHERO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Clientes VIP noviembre",
"contacts": [
{
"firstName": "Laura",
"lastName": "García",
"address": {
"address1": "Calle Mayor 12, 3º B",
"zip": "28013",
"city": "Madrid",
"countryCode": "ES"
}
}
]
}' { "segmentId": "5f0c…", "contactsQueued": 1, "importJobsEnqueued": 1 } Response
{
"segmentId": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"contactsQueued": 2,
"importJobsEnqueued": 1
} Retrieve a segment
Returns the segment with stats: contacts, withAddress and withZip.
id Segment id.
curl https://api.posthero.app/v1/segments/{id} \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"id": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"name": "Clientes VIP noviembre",
"description": null,
"createdAt": "2026-11-24T09:29:00.000Z",
"updatedAt": "2026-11-24T09:29:00.000Z",
"stats": {
"contacts": 1250,
"withAddress": 1250,
"withZip": 1248,
"aiFormattedAddress": 1190
}
} Update a segment
id Segment id.
name New name.
description New description.
curl -X PATCH https://api.posthero.app/v1/segments/{id} \
-H "x-api-key: $POSTHERO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "description": "Compras > 300 € en 2026" }' Response
{
"id": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"name": "Clientes VIP",
"description": null,
"createdAt": "2026-11-24T09:29:00.000Z",
"updatedAt": "2026-11-24T12:00:00.000Z"
} Add contacts
Queues 1 to 500 contacts and answers 202 with { segmentId, contactsQueued, importJobsEnqueued }. Contacts with an existing email are updated.
If a LIVE AUTOMATED campaign targets this segment, every new contact is printed, mailed and billed automatically. This is how triggered mail works.
id Segment id.
contacts 1 to 500 contacts.
curl -X POST https://api.posthero.app/v1/segments/{id}/contacts \
-H "x-api-key: $POSTHERO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "contacts": [ { "firstName": "Pablo", "emailAddress": "pablo@example.com",
"address": { "address1": "Av. Diagonal 400", "zip": "08037", "city": "Barcelona" } } ] }' Response
{
"segmentId": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"contactsQueued": 1,
"importJobsEnqueued": 1
} {
"statusCode": 403,
"code": "INSUFFICIENT_SCOPE",
"message": "This API key does not have the \"campaigns:launch\" permission (segment 5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a feeds the LIVE automated campaign 3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e, so new contacts would be mailed and billed). Edit the key's permissions in Posthero (Settings → API keys) or use a key that has it.",
"requiredScope": "campaigns:launch"
} Segment contacts
id Segment id.
page Page number, starting at 1.
limit Results per page (1–100, default 20).
curl https://api.posthero.app/v1/segments/{id}/contacts?page=1&limit=100 \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"data": [
{
"id": "e2b4d6f8-0a1c-4e3b-9d5f-7a9c1e3b5d7f",
"firstName": "Laura",
"lastName": "García",
"companyName": null,
"emailAddress": "laura@example.com",
"phoneNumber": null,
"address": {
"address1": "Calle Mayor 12, 3º B",
"address2": "",
"city": "Madrid",
"zip": "28013",
"province": "Madrid",
"country": "España",
"countryCode": "ES"
},
"normalizedAddress": null,
"customFields": {
"coupon": "VUELVE10"
},
"createdAt": "2026-11-24T09:29:05.000Z"
}
],
"page": 1,
"limit": 20,
"total": 1250,
"pageCount": 63
} Reference
Contacts
Look up and delete contacts in the account. To create them, add them to a segment.
List contacts
segmentId Only contacts in that segment.
email Look up by email.
page Page number, starting at 1.
limit Results per page (1–100, default 20).
curl https://api.posthero.app/v1/contacts?email=laura@example.com \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"data": [
{
"id": "e2b4d6f8-0a1c-4e3b-9d5f-7a9c1e3b5d7f",
"firstName": "Laura",
"lastName": "García",
"companyName": null,
"emailAddress": "laura@example.com",
"phoneNumber": null,
"address": {
"address1": "Calle Mayor 12, 3º B",
"address2": "",
"city": "Madrid",
"zip": "28013",
"province": "Madrid",
"country": "España",
"countryCode": "ES"
},
"normalizedAddress": null,
"customFields": {
"coupon": "VUELVE10"
},
"createdAt": "2026-11-24T09:29:05.000Z"
}
],
"page": 1,
"limit": 20,
"total": 1,
"pageCount": 1
} Retrieve a contact
id Contact id.
curl https://api.posthero.app/v1/contacts/{id} \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"id": "e2b4d6f8-0a1c-4e3b-9d5f-7a9c1e3b5d7f",
"firstName": "Laura",
"lastName": "García",
"companyName": null,
"emailAddress": "laura@example.com",
"phoneNumber": null,
"address": {
"address1": "Calle Mayor 12, 3º B",
"address2": "",
"city": "Madrid",
"zip": "28013",
"province": "Madrid",
"country": "España",
"countryCode": "ES"
},
"normalizedAddress": null,
"customFields": {
"coupon": "VUELVE10"
},
"createdAt": "2026-11-24T09:29:05.000Z"
} Delete a contact
Permanent deletion (GDPR erasure); answers 204. Deliveries already created keep their snapshot of the data.
id Contact id.
curl -X DELETE https://api.posthero.app/v1/contacts/{id} \
-H "x-api-key: $POSTHERO_API_KEY" Response
HTTP/1.1 204 No Content Reference
Campaigns
A campaign joins a design and a segment. It is created as DRAFT, quoted and launched. Types: ONE_OFF (a single send), AUTOMATED (every new contact in the segment gets mailed) and RECURRENT (weekly, monthly or yearly).
List campaigns
status DRAFT, LIVE, PAUSED or COMPLETED.
type ONE_OFF, AUTOMATED or RECURRENT.
page Page number, starting at 1.
limit Results per page (1–100, default 20).
curl https://api.posthero.app/v1/campaigns?status=LIVE \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"data": [
{
"id": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"name": "VIP noviembre",
"status": "DRAFT",
"recurrentType": null,
"recurrenceDay": null,
"segmentType": "INTERNAL",
"segment": {
"id": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"name": "Clientes VIP noviembre"
},
"design": {
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP"
},
"designTemplate": null,
"estimateQuantity": 1250,
"createdAt": "2026-11-24T09:30:00.000Z",
"updatedAt": "2026-11-24T09:30:00.000Z",
"type": "ONE_OFF"
}
],
"page": 1,
"limit": 20,
"total": 1,
"pageCount": 1
} Create a campaign
Creates the campaign as DRAFT.
name Campaign name.
type ONE_OFF (default), AUTOMATED or RECURRENT.
segmentId Target segment.
designId Design to print.
recurrentType RECURRENT only: WEEKLY, MONTHLY or YEARLY.
recurrenceDay RECURRENT only: day of the recurrence.
curl -X POST https://api.posthero.app/v1/campaigns \
-H "x-api-key: $POSTHERO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "name": "VIP noviembre", "type": "ONE_OFF",
"segmentId": "SEGMENT_ID", "designId": "DESIGN_ID" }' Response
{
"id": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"name": "VIP noviembre",
"status": "DRAFT",
"recurrentType": null,
"recurrenceDay": null,
"segmentType": "INTERNAL",
"segment": {
"id": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"name": "Clientes VIP noviembre"
},
"design": {
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP"
},
"designTemplate": null,
"estimateQuantity": null,
"createdAt": "2026-11-24T09:30:00.000Z",
"updatedAt": "2026-11-24T09:30:00.000Z",
"type": "ONE_OFF"
} {
"statusCode": 403,
"code": "INSUFFICIENT_SCOPE",
"message": "This API key does not have the \"campaigns:write\" permission. Edit the key's permissions in Posthero (Settings → API keys) or use a key that has it.",
"requiredScope": "campaigns:write"
} Retrieve a campaign
id Campaign id.
curl https://api.posthero.app/v1/campaigns/{id} \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"id": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"name": "VIP noviembre",
"status": "DRAFT",
"recurrentType": null,
"recurrenceDay": null,
"segmentType": "INTERNAL",
"segment": {
"id": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"name": "Clientes VIP noviembre"
},
"design": {
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP"
},
"designTemplate": null,
"estimateQuantity": 1250,
"createdAt": "2026-11-24T09:30:00.000Z",
"updatedAt": "2026-11-24T09:30:00.000Z",
"type": "ONE_OFF"
} {
"statusCode": 404,
"code": "NOT_FOUND",
"message": "Campaign 3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e not found in this account."
} Update a campaign
DRAFT only. Takes the same fields as create; null unlinks the segment or the design.
id Campaign id.
curl -X PATCH https://api.posthero.app/v1/campaigns/{id} \
-H "x-api-key: $POSTHERO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "designId": "OTHER_DESIGN_ID" }' Response
{
"id": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"name": "VIP diciembre",
"status": "DRAFT",
"recurrentType": null,
"recurrenceDay": null,
"segmentType": "INTERNAL",
"segment": {
"id": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"name": "Clientes VIP noviembre"
},
"design": {
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP"
},
"designTemplate": null,
"estimateQuantity": 1250,
"createdAt": "2026-11-24T09:30:00.000Z",
"updatedAt": "2026-11-24T09:45:00.000Z",
"type": "ONE_OFF"
} Delete a campaign
DRAFT only. Answers 204.
id Campaign id.
curl -X DELETE https://api.posthero.app/v1/campaigns/{id} \
-H "x-api-key: $POSTHERO_API_KEY" Response
HTTP/1.1 204 No Content Quote
How many pieces would be sent, the total without and with VAT, how it would be paid (paymentMethod: invoice, card or null) and whether the campaign can be launched. blockers lists what is missing: NOT_DRAFT, DESIGN_REQUIRED, DESIGN_FILE_MISSING, SEGMENT_REQUIRED, SEGMENT_EMPTY, DESIGN_RENDER_NOT_READY, PRICE_UNAVAILABLE or PAYMENT_METHOD_REQUIRED.
id Campaign id.
curl https://api.posthero.app/v1/campaigns/{id}/quote \
-H "x-api-key: $POSTHERO_API_KEY" {
"campaignId": "3c9a…",
"quantity": 1250,
"totalWithoutVat": 1112.50,
"totalWithVat": 1346.13,
"currency": "EUR",
"paymentMethod": "card",
"canLaunch": true,
"blockers": []
} Response
{
"campaignId": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"quantity": 1250,
"totalWithoutVat": 1112.5,
"totalWithVat": 1346.13,
"currency": "EUR",
"paymentMethod": "card",
"canLaunch": true,
"blockers": []
} {
"campaignId": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"quantity": 0,
"totalWithoutVat": null,
"totalWithVat": null,
"currency": "EUR",
"paymentMethod": null,
"canLaunch": false,
"blockers": [
"SEGMENT_EMPTY",
"PAYMENT_METHOD_REQUIRED"
]
} Launch a campaign
Launches a DRAFT campaign. Checks that design and segment are set, the segment is not empty and the design is print-ready, then charges according to the account payment method. ONE_OFF campaigns go to COMPLETED (their deliveries are created right away); AUTOMATED and RECURRENT go LIVE.
id Campaign id.
Idempotency-Key Recommended. A retry with the same key never charges twice (a successful launch is replayed for 24 h).
curl -X POST https://api.posthero.app/v1/campaigns/{id}/launch \
-H "x-api-key: $POSTHERO_API_KEY" \
-H "Idempotency-Key: vip-noviembre-2026" {
"campaign": { "id": "3c9a…", "name": "VIP noviembre", "type": "ONE_OFF", "status": "COMPLETED", … },
"payment": { "method": "card", "amount": 1346.13, "currency": "EUR", "invoiceId": "…" }
} Response
{
"campaign": {
"id": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"name": "VIP noviembre",
"status": "COMPLETED",
"recurrentType": null,
"recurrenceDay": null,
"segmentType": "INTERNAL",
"segment": {
"id": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"name": "Clientes VIP noviembre"
},
"design": {
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP"
},
"designTemplate": null,
"estimateQuantity": 1250,
"createdAt": "2026-11-24T09:30:00.000Z",
"updatedAt": "2026-11-24T10:00:00.000Z",
"type": "ONE_OFF"
},
"payment": {
"method": "card",
"amount": 1346.13,
"currency": "EUR",
"invoiceId": "in_1QxYz…"
}
} {
"statusCode": 402,
"code": "PAYMENT_FAILED",
"message": "The card on file was declined (insufficient_funds). Nothing was launched.",
"declineCode": "insufficient_funds"
} {
"statusCode": 422,
"code": "CAMPAIGN_NOT_READY",
"message": "Campaign 3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e cannot be launched yet: DESIGN_REQUIRED, SEGMENT_EMPTY.",
"blockers": [
"DESIGN_REQUIRED",
"SEGMENT_EMPTY"
]
} {
"statusCode": 403,
"code": "INSUFFICIENT_SCOPE",
"message": "This API key does not have the \"campaigns:launch\" permission. Edit the key's permissions in Posthero (Settings → API keys) or use a key that has it.",
"requiredScope": "campaigns:launch"
} Pause
LIVE AUTOMATED or RECURRENT campaign → PAUSED.
id Campaign id.
curl -X POST https://api.posthero.app/v1/campaigns/{id}/pause \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"id": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"name": "VIP noviembre",
"status": "PAUSED",
"recurrentType": null,
"recurrenceDay": null,
"segmentType": "INTERNAL",
"segment": {
"id": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"name": "Clientes VIP noviembre"
},
"design": {
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP"
},
"designTemplate": null,
"estimateQuantity": null,
"createdAt": "2026-11-24T09:30:00.000Z",
"updatedAt": "2026-11-24T09:30:00.000Z",
"type": "AUTOMATED"
} Resume
PAUSED → LIVE.
id Campaign id.
curl -X POST https://api.posthero.app/v1/campaigns/{id}/resume \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"id": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"name": "VIP noviembre",
"status": "LIVE",
"recurrentType": null,
"recurrenceDay": null,
"segmentType": "INTERNAL",
"segment": {
"id": "5f0c8b7a-6e5d-4c3b-8a29-1f0e9d8c7b6a",
"name": "Clientes VIP noviembre"
},
"design": {
"id": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"name": "Postal VIP"
},
"designTemplate": null,
"estimateQuantity": null,
"createdAt": "2026-11-24T09:30:00.000Z",
"updatedAt": "2026-11-24T09:30:00.000Z",
"type": "AUTOMATED"
} Send to one recipient
Mails one recipient through a LIVE AUTOMATED campaign without touching segments. The body is a Contact. Answers 201 with { deliveryId, campaignId, status: "ON_QUEUE" } and is billed like every automated delivery.
id Campaign id.
curl -X POST https://api.posthero.app/v1/campaigns/{id}/recipients \
-H "x-api-key: $POSTHERO_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "firstName": "Laura", "emailAddress": "laura@example.com",
"address": { "address1": "Calle Mayor 12", "zip": "28013", "city": "Madrid" },
"customFields": { "coupon": "VUELVE10" } }' { "deliveryId": "9b1e…", "campaignId": "3c9a…", "status": "ON_QUEUE" } Response
{
"deliveryId": "9b1e3d5f-7a9c-4b2d-8e4f-6a8c0e2b4d6f",
"campaignId": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"status": "ON_QUEUE"
} {
"statusCode": 403,
"code": "INSUFFICIENT_SCOPE",
"message": "This API key does not have the \"campaigns:launch\" permission. Edit the key's permissions in Posthero (Settings → API keys) or use a key that has it.",
"requiredScope": "campaigns:launch"
} Campaign deliveries
id Campaign id.
status Filter by status.
page Page number, starting at 1.
limit Results per page (1–100, default 20).
curl https://api.posthero.app/v1/campaigns/{id}/deliveries?status=SENT \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"data": [
{
"id": "9b1e3d5f-7a9c-4b2d-8e4f-6a8c0e2b4d6f",
"campaignId": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"contactId": "e2b4d6f8-0a1c-4e3b-9d5f-7a9c1e3b5d7f",
"status": "ON_QUEUE",
"recipient": {
"firstName": "Laura",
"lastName": "García",
"companyName": null,
"emailAddress": "laura@example.com",
"address": {
"address1": "Calle Mayor 12, 3º B",
"address2": "",
"city": "Madrid",
"zip": "28013",
"province": "Madrid",
"country": "España",
"countryCode": "ES"
},
"normalizedAddress": null
},
"customFields": {
"coupon": "VUELVE10"
},
"isBounced": false,
"createdAt": "2026-11-24T09:31:00.000Z",
"updatedAt": "2026-11-24T09:31:00.000Z"
}
],
"page": 1,
"limit": 20,
"total": 1250,
"pageCount": 63
} Reference
Deliveries and print orders
A delivery is one letter or postcard to one recipient. Deliveries are grouped into print orders, whose ids are integers.
Retrieve a delivery
Recipient snapshot, status, normalised address and timestamps.
id Delivery id.
curl https://api.posthero.app/v1/deliveries/{id} \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"id": "9b1e3d5f-7a9c-4b2d-8e4f-6a8c0e2b4d6f",
"campaignId": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"contactId": "e2b4d6f8-0a1c-4e3b-9d5f-7a9c1e3b5d7f",
"status": "ON_QUEUE",
"recipient": {
"firstName": "Laura",
"lastName": "García",
"companyName": null,
"emailAddress": "laura@example.com",
"address": {
"address1": "Calle Mayor 12, 3º B",
"address2": "",
"city": "Madrid",
"zip": "28013",
"province": "Madrid",
"country": "España",
"countryCode": "ES"
},
"normalizedAddress": null
},
"customFields": {
"coupon": "VUELVE10"
},
"isBounced": false,
"createdAt": "2026-11-24T09:31:00.000Z",
"updatedAt": "2026-11-24T09:31:00.000Z"
} List print orders
Each order: id, status, campaign ({ id, name }), designId, deliveriesCount, bouncedCount, totalCost (EUR, VAT excluded), currency, createdAt and updatedAt.
campaignId Only orders of that campaign.
status Filter by status.
page Page number, starting at 1.
limit Results per page (1–100, default 20).
curl https://api.posthero.app/v1/orders?campaignId=CAMPAIGN_ID \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"data": [
{
"id": 371,
"status": "PREPARING",
"campaign": {
"id": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"name": "VIP noviembre"
},
"designId": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"deliveriesCount": 1250,
"bouncedCount": 2,
"totalCost": 1112.5,
"currency": "EUR",
"createdAt": "2026-11-24T10:00:00.000Z",
"updatedAt": "2026-11-25T08:00:00.000Z"
}
],
"page": 1,
"limit": 20,
"total": 1,
"pageCount": 1
} Retrieve a print order
id Order id (integer).
curl https://api.posthero.app/v1/orders/371 \
-H "x-api-key: $POSTHERO_API_KEY" Response
{
"id": 371,
"status": "PREPARING",
"campaign": {
"id": "3c9a1e2d-4b5f-4a6c-8d7e-0f1a2b3c4d5e",
"name": "VIP noviembre"
},
"designId": "a71d9c3e-5b2f-4e8a-9d10-6c4b3a2f1e0d",
"deliveriesCount": 1250,
"bouncedCount": 2,
"totalCost": 1112.5,
"currency": "EUR",
"createdAt": "2026-11-24T10:00:00.000Z",
"updatedAt": "2026-11-25T08:00:00.000Z"
} Reference
Contact object
Used by POST /segments, POST /segments/{id}/contacts and POST /campaigns/{id}/recipients. A contact needs address.address1 (and in practice zip and city) to be mailable.
firstName First name.
lastName Last name.
companyName Company.
emailAddress Email. If a contact with that email already exists, it is updated.
phoneNumber Phone number.
address address1 (required to be mailable), address2, city, zip, province, provinceCode, country, countryCode (ISO-2). In practice you also need zip and city.
customFields Map { name: string | number | boolean }. Names must exist in /custom-fields; unknown names are rejected.
{
"firstName": "Laura",
"lastName": "García",
"companyName": "Mueblería Sol",
"emailAddress": "laura@example.com",
"phoneNumber": "+34600000000",
"address": {
"address1": "Calle Mayor 12, 3º B",
"address2": "",
"city": "Madrid",
"zip": "28013",
"province": "Madrid",
"country": "España",
"countryCode": "ES"
},
"customFields": { "coupon": "VUELVE10" }
} Reference
Response objects
Exact shape of every object the API returns (values are examples). Lists wrap them in data, inside the pagination envelope. GET /segments/{id} adds stats; in GET /designs/{id} every file carries its signed url.
{
"id": "3c9a…",
"name": "VIP noviembre",
"type": "ONE_OFF",
"status": "DRAFT",
"recurrentType": null,
"recurrenceDay": null,
"segmentType": "…",
"segment": { "id": "5f0c…", "name": "Clientes VIP noviembre" },
"design": { "id": "a71d…", "name": "Carta VIP" },
"designTemplate": null,
"estimateQuantity": 1250,
"createdAt": "2026-11-24T09:30:00.000Z",
"updatedAt": "2026-11-24T09:30:00.000Z"
} {
"id": "a71d…",
"name": "Carta VIP",
"type": "DOC",
"orientation": "VERTICAL",
"source": "pdf",
"product": { "id": "…", "kind": "standard", "label": "…", "size": "…" },
"printReady": true,
"files": [{ "face": "front", "fileId": "…", "url": "https://…" }],
"createdAt": "2026-11-24T09:28:00.000Z",
"updatedAt": "2026-11-24T09:28:00.000Z"
} {
"id": "5f0c…",
"name": "Clientes VIP noviembre",
"description": null,
"createdAt": "2026-11-24T09:29:00.000Z",
"updatedAt": "2026-11-24T09:29:00.000Z",
"stats": { "contacts": 1250, "withAddress": 1250, "withZip": 1248 }
} {
"id": "e2b4…",
"firstName": "Laura",
"lastName": "García",
"companyName": null,
"emailAddress": "laura@example.com",
"phoneNumber": null,
"address": { "address1": "Calle Mayor 12, 3º B", "zip": "28013", "city": "Madrid", "countryCode": "ES" },
"normalizedAddress": { … },
"customFields": { "coupon": "VUELVE10" },
"createdAt": "2026-11-24T09:29:05.000Z"
} {
"id": "9b1e…",
"campaignId": "3c9a…",
"contactId": "e2b4…",
"status": "ON_QUEUE",
"recipient": {
"firstName": "Laura",
"lastName": "García",
"companyName": null,
"emailAddress": "laura@example.com",
"address": { … },
"normalizedAddress": { … }
},
"customFields": { "coupon": "VUELVE10" },
"isBounced": false,
"createdAt": "2026-11-24T09:31:00.000Z",
"updatedAt": "2026-11-24T09:31:00.000Z"
} {
"id": 371,
"status": "PREPARING",
"campaign": { "id": "3c9a…", "name": "VIP noviembre" },
"designId": "a71d…",
"deliveriesCount": 1250,
"bouncedCount": 2,
"totalCost": 1112.5,
"currency": "EUR",
"createdAt": "2026-11-24T10:00:00.000Z",
"updatedAt": "2026-11-25T08:00:00.000Z"
} {
"id": "c0f3…",
"name": "coupon",
"label": "Cupón",
"type": "text",
"description": null,
"createdAt": "2026-11-20T12:00:00.000Z"
} Reference
Delivery and order statuses
SCHEDULED Scheduled.
ON_QUEUE Waiting for the next print batch.
PREPARING At the printer.
SENT Handed to the postal service.
ERRORED Error (for example, an invalid address).
CANCELLED Cancelled.
PENDING_PAYMENT exists in the model but is not used by business accounts.
Limitations and roadmap
No sandbox (yet)
Launched campaigns are really printed and mailed. To test your integration, use a small segment (for example, with your own address).
Webhooks: coming soon
For now, poll orders and deliveries for status (GET /orders, GET /campaigns/{id}/deliveries).
Dashboard only: the design editor and templates (the API only accepts PDFs), integrations (Shopify, Klaviyo, Active Campaign, Zapier), subscription and invoices, team and users, brand kit, reports and ROAS, and address enrichment settings.
Questions about your integration?
Write to us and we will help you set up your first API send.