Skip to content

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 ruleWhat happens
TypesPNG, 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.
SVGConverted 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.
SizeAt most 5 MB per file; 500 MB per team across all brands.
ProcessingMetadata (camera, GPS location, editing history) is removed, and images wider than 1200 px are scaled down. Rotation from the camera is applied first.
URLhttps://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.
An image that a brand kit, a template (draft or any published version) or an unsent broadcast still uses cannot be deleted without force=true: mail that is already in inboxes would show a broken image.

Brand kit#

Get a brand kit#

The kit to design with. A brand without its own kit returns the team's (source: team).

GEThttps://api.poststack.dev/brand-kit
Request
const kit = await poststack.brandKit.get('brd_k3x9m2p7q4w8');
{
  "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_idstring
brd_…; omit (or none) 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

StatusMeaning
200The kit.
401Missing, invalid or revoked API key.
403insufficient_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.

PUThttps://api.poststack.dev/brand-kit
Request
await poststack.brandKit.update({
  brand_id: 'brd_k3x9m2p7q4w8',
  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

StatusMeaning
200The kit now in effect.
400A colour is not #rrggbb, or the font is not on the list.
401Missing, invalid or revoked API key.
403insufficient_scope (needs templates:manage), a brand key (these endpoints are not open to brand keys), or the team is suspended.
404No 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.

DELETEhttps://api.poststack.dev/brand-kit
Request
await poststack.brandKit.reset('brd_k3x9m2p7q4w8');

Query parameters

brand_idstring
The brand; omit for the team’s own kit.

Status codes

StatusMeaning
200The kit now in effect.
401Missing, invalid or revoked API key.
403insufficient_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.

POSThttps://api.poststack.dev/assets
Request
import { 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">
{ "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

StatusMeaning
201Stored.
401Missing, invalid or revoked API key.
403insufficient_scope (needs templates:manage), a brand key (these endpoints are not open to brand keys), or the team is suspended.
413Over 5 MB, or the team’s library is full (asset_quota_exceeded).
415Not one of the accepted image types.
422The image could not be read, or the SVG is unsafe.

List images#

Newest first, with the team's storage use.

GEThttps://api.poststack.dev/assets
Request
const { assets } = await poststack.assets.list({ brand_id: 'none' });

Query parameters

brand_idstring
brd_… for one brand's images, none for 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

StatusMeaning
200The images.
401Missing, invalid or revoked API key.
403insufficient_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.

DELETEhttps://api.poststack.dev/assets/{id}
Request
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

StatusMeaning
200Deleted.
401Missing, invalid or revoked API key.
403insufficient_scope (needs templates:manage), a brand key (these endpoints are not open to brand keys), or the team is suspended.
404No such image.
409Still used by a brand kit, template or unsent broadcast.
Was this page helpful?