Skip to main content

Upload Home Page Image

POST 

/api/admin/portal/home/images

Upload artwork for a Home page block (multipart/form-data): a banner slide, its phone version or a link tile image. The image is stored straight away and returned with the path to put on the block; it is attached by the next Update Portal Home Page or Update Home Page Blocks. An upload that is never saved onto a block is deleted by a later save once it is more than 24 hours old.

Required scope: customers:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Form fields:

  • kind (required): slide (desktop banner artwork, scaled down to 2400 px wide), slide_mobile (phone banner artwork, scaled down to 1200 px wide) or tile (a link tile image, scaled down to 600 px wide).
  • file (required): a JPG, PNG, WebP or SVG image of at most 5 MB (5120 KB).

Raster images are re-encoded (metadata removed) and scaled down to the kind's width when wider; narrower images keep their size. SVGs are sanitised and keep no pixel size.

Returns 201 with:

  • path: where the image is stored, always under portal/home/. Send it as image.path / mobile_image.path on a slide or image.path on a tile.
  • url: where the image can be loaded from.
  • width / height: the stored image's size in pixels, or null for an SVG. Send them with the path.

A file over 5 MB, or a file that is not an image that can be read, returns 422 with the reason under errors.file; a missing or unknown kind returns 422 under errors.kind.

Requires a staff bearer token with portal management permission.

Request​

Responses​

Created

Response Headers
    Content-Type