Brand kit & images
Keep each brand's logo, colours, font, postal address and footer in one place, and upload the images your email content uses. Every image gets a public, permanent URL.
How it works#
The brand kit is one record per brand, plus one for the team's own mail. A brand without a kit of its own uses the team's; a team without one gets neutral defaults. The source field of every response says which you are looking at.
The image library holds the pictures you put in templates and broadcasts. Uploads are checked and rebuilt before they are stored, so what you link to is always a clean image that any mail client can show.
| Upload rule | What happens |
|---|---|
| Types | PNG, JPEG, GIF (animation kept), WebP and SVG. The type is read from the file itself, not from its name. Anything else is refused with 415. |
| SVG | Converted to PNG, because many mail clients do not show SVG. An SVG with a DOCTYPE, entities or links to outside files is refused with 422. |
| Size | At most 5 MB per file; 500 MB per team across all brands. |
| Processing | Metadata (camera, GPS location, editing history) is removed, and images wider than 1200 px are scaled down. Rotation from the camera is applied first. |
| URL | https://poststack.dev/api/asset-files/… — public, no sign-in, cached for a year. The file behind a URL never changes; uploading again gives a new URL. |
Brand kit#
Get a brand kit#
The kit to design with. A brand without its own kit returns the team's (source: team).
https://api.poststack.dev/brand-kitconst kit = await poststack.brandKit.get('brd_k3x9m2p7q4w8');curl "https://api.poststack.dev/brand-kit?brand_id=brd_k3x9m2p7q4w8" \
-H "Authorization: Bearer sk_live_..."{
"brandKit": {
"brandId": "brd_k3x9m2p7q4w8",
"source": "brand",
"logo": {
"id": "ast_v7k2m9x4q1w8e3r5",
"url": "https://poststack.dev/api/asset-files/Qm9yZGVyLWxvZ28tYWJj.png",
"width": 480,
"height": 120
},
"primaryColor": "#0f766e",
"accentColor": "#f59e0b",
"textColor": "#1f2937",
"backgroundColor": "#ffffff",
"fontFamily": "Georgia, 'Times New Roman', serif",
"postalAddress": "Bakery Jensen, 1 Harbour Street, 8000 Aarhus, Denmark",
"footerHtml": "<p>You get this because you joined our list.</p>",
"updatedAt": "2026-12-02T10:00:00.000Z"
}
}Query parameters
brand_idstringbrd_…; omit (ornone) for the team's own kit.
Response fields
source'brand' | 'team' | 'default'- Where the values come from.
logoobject | null- id, url, width and height of the logo image.
primaryColor … backgroundColorstring- #rrggbb colours.
fontFamilystring- A web-safe font stack.
postalAddressstring | null- Shown in footers.
footerHtmlstring | null- Default footer.
Status codes
| Status | Meaning |
|---|---|
| 200 | The kit. |
| 401 | Missing, invalid or revoked API key. |
| 403 | insufficient_scope (needs templates:read), a brand key (these endpoints are not open to brand keys), or the team is suspended. |
Update a brand kit#
Creates or edits a kit. Omitted fields keep their value; null clears one back to the default.
https://api.poststack.dev/brand-kitawait poststack.brandKit.update({
brand_id: 'brd_k3x9m2p7q4w8',
primary_color: '#0f766e',
postal_address: 'Bakery Jensen, 1 Harbour Street, 8000 Aarhus, Denmark',
});curl -X PUT https://api.poststack.dev/brand-kit \
-H "Authorization: Bearer sk_live_..." \
-H "Content-Type: application/json" \
-d '{ "primary_color": "#0f766e" }'{
"brand_id": "brd_k3x9m2p7q4w8",
"logo_asset_id": "ast_v7k2m9x4q1w8e3r5",
"primary_color": "#0f766e",
"postal_address": "Bakery Jensen, 1 Harbour Street, 8000 Aarhus, Denmark"
}{
"brandKit": {
"brandId": "brd_k3x9m2p7q4w8",
"source": "brand",
"logo": {
"id": "ast_v7k2m9x4q1w8e3r5",
"url": "https://poststack.dev/api/asset-files/Qm9yZGVyLWxvZ28tYWJj.png",
"width": 480,
"height": 120
},
"primaryColor": "#0f766e",
"accentColor": "#f59e0b",
"textColor": "#1f2937",
"backgroundColor": "#ffffff",
"fontFamily": "Georgia, 'Times New Roman', serif",
"postalAddress": "Bakery Jensen, 1 Harbour Street, 8000 Aarhus, Denmark",
"footerHtml": "<p>You get this because you joined our list.</p>",
"updatedAt": "2026-12-02T10:00:00.000Z"
}
}Body parameters
brand_idstring- The brand; omit for the team’s own kit.
logo_asset_idstring | null- An ast_… image from the same brand’s library or the team’s own.
primary_color, accent_color, text_color, background_colorstring | null- #rrggbb.
font_familystring | null- One of: Arial, Helvetica, Verdana, Tahoma, Trebuchet MS, Georgia, Times New Roman or Courier New stacks (exact strings in the OpenAPI spec).
postal_addressstring | null- Up to 500 characters.
footer_htmlstring | null- Up to 10,000 characters.
Status codes
| Status | Meaning |
|---|---|
| 200 | The kit now in effect. |
| 400 | A colour is not #rrggbb, or the font is not on the list. |
| 401 | Missing, invalid or revoked API key. |
| 403 | insufficient_scope (needs templates:manage), a brand key (these endpoints are not open to brand keys), or the team is suspended. |
| 404 | No such brand, or the logo is not in its library. |
Reset a brand kit#
Removes a brand's own kit so it uses the team's again. For the team's own kit, back to the defaults.
https://api.poststack.dev/brand-kitawait poststack.brandKit.reset('brd_k3x9m2p7q4w8');Query parameters
brand_idstring- The brand; omit for the team’s own kit.
Status codes
| Status | Meaning |
|---|---|
| 200 | The kit now in effect. |
| 401 | Missing, invalid or revoked API key. |
| 403 | insufficient_scope (needs templates:manage), a brand key (these endpoints are not open to brand keys), or the team is suspended. |
Images#
Upload an image#
multipart/form-data with the image in the file field.
https://api.poststack.dev/assetsimport { readFileSync } from 'node:fs';
const asset = await poststack.assets.upload({
file: new Blob([readFileSync('logo.png')]),
file_name: 'logo.png',
});
// <img src="${asset.url}" width="240" alt="Bakery Jensen">curl -X POST https://api.poststack.dev/assets \
-H "Authorization: Bearer sk_live_..." \
-F file=@logo.png{ "asset": {
"id": "ast_v7k2m9x4q1w8e3r5",
"brandId": null,
"url": "https://poststack.dev/api/asset-files/Qm9yZGVyLWxvZ28tYWJj.png",
"filename": "logo.png",
"contentType": "image/png",
"size": 18342,
"width": 480,
"height": 120,
"createdAt": "2026-12-02T10:00:00.000Z"
} }Body parameters
filefile- PNG, JPEG, GIF, WebP or SVG, up to 5 MB.
brand_idstring- The brand whose library it goes into; omit for the team’s own.
Status codes
| Status | Meaning |
|---|---|
| 201 | Stored. |
| 401 | Missing, invalid or revoked API key. |
| 403 | insufficient_scope (needs templates:manage), a brand key (these endpoints are not open to brand keys), or the team is suspended. |
| 413 | Over 5 MB, or the team’s library is full (asset_quota_exceeded). |
| 415 | Not one of the accepted image types. |
| 422 | The image could not be read, or the SVG is unsafe. |
List images#
Newest first, with the team's storage use.
https://api.poststack.dev/assetsconst { assets } = await poststack.assets.list({ brand_id: 'none' });Query parameters
brand_idstringbrd_…for one brand's images,nonefor the team's own; omit for all.limitinteger- 1–100, default 50.
offsetinteger- Default 0.
Response fields
assetsAsset[]- The page.
totalnumber- Matching images.
usedBytesnumber- Stored by the whole team.
quotaBytesnumber- 500 MB.
Status codes
| Status | Meaning |
|---|---|
| 200 | The images. |
| 401 | Missing, invalid or revoked API key. |
| 403 | insufficient_scope (needs templates:read), a brand key (these endpoints are not open to brand keys), or the team is suspended. |
Get and delete an image#
GET /assets/{id} returns one image. DELETE removes it; while content still uses the image it answers 409 (asset_in_use) naming where, unless force=true.
https://api.poststack.dev/assets/{id}await poststack.assets.delete('ast_v7k2m9x4q1w8e3r5');Path parameters
idstring- ast_… id.
Query parameters
forceboolean- true deletes an image that is still in use.
Status codes
| Status | Meaning |
|---|---|
| 200 | Deleted. |
| 401 | Missing, invalid or revoked API key. |
| 403 | insufficient_scope (needs templates:manage), a brand key (these endpoints are not open to brand keys), or the team is suspended. |
| 404 | No such image. |
| 409 | Still used by a brand kit, template or unsent broadcast. |