CLI commands

Creatives commands

The 2 koast CLI commands for the Creatives operations.

Every command is one API operation, named by its operationId. Global flags such as --output and --api-url work on all of them, see CLI commands.

list-creatives

List creatives. GET /v1/brands/{brandId}/creatives, API reference.

koast list-creatives --brand <brand> [flags]
FlagTypeRequiredDescription
--brandintegerYesThe brand the request acts on. Every brand-scoped resource lives under its brand.
--searchstringNoFilter by creative or file name. Omit to list everything, newest first. At most 200 characters.
--kindstringNoNarrow to images or to videos. Defaults to ALL. One of ALL, IMAGES, VIDEOS.
--creative-idsinteger, repeatableNoLook up an explicit set of creative ids instead of browsing. This is also what the gallery sends when a user picks creatives in it, so the ids reach you. At most 60 items.
--pageintegerNo1-based page. Defaults to 1. Minimum 1.
--limitintegerNoPage size. Default 50. Minimum 1, maximum 100.
--cursorstringNoOpaque cursor from the previous page's nextCursor. Omit for the first page.

Required scope: read. Paged. --all follows nextCursor to the end and prints one JSON line per item.

Example:

koast list-creatives --brand 123

upload-creative

Upload creative. POST /v1/brands/{brandId}/creatives, API reference.

koast upload-creative --brand <brand> [--json <file|->] [flags]
FlagTypeRequiredDescription
--brandintegerYesThe brand the request acts on. Every brand-scoped resource lives under its brand.
--image-urlstringNoPublic https url of the image to store. Koast downloads it and re-hosts it, so a link that later expires does not rot the ad. Use this whenever the user gives you a link.
--file-datastringNoStandard base64 of the image bytes, with NO data-url prefix. Intended for the Koast creative gallery, which reads a dropped file and sends it here. Do not attempt to write this yourself, if the user attached an image to the chat, say you cannot read its bytes and ask for a link or for them to drop it in the gallery. At most 13333338 characters.
--content-typestringNoMedia type of fileData. Required with fileData, ignored with imageUrl. One of image/jpeg, image/png, image/webp, image/gif.
--file-namestringNoFile name to store it under. Required with fileData; defaults to the url's own name otherwise. At most 200 characters.
--namestringNoDisplay name for the creative. Defaults to the file name. At most 200 characters.

Required scope: write. Accepts --idempotency-key. The CLI sends a key only when you give one. --json <file|-> supplies the whole body. Body flags are applied over it.

Example:

koast upload-creative --brand 123

On this page