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]| Flag | Type | Required | Description |
|---|---|---|---|
--brand | integer | Yes | The brand the request acts on. Every brand-scoped resource lives under its brand. |
--search | string | No | Filter by creative or file name. Omit to list everything, newest first. At most 200 characters. |
--kind | string | No | Narrow to images or to videos. Defaults to ALL. One of ALL, IMAGES, VIDEOS. |
--creative-ids | integer, repeatable | No | Look 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. |
--page | integer | No | 1-based page. Defaults to 1. Minimum 1. |
--limit | integer | No | Page size. Default 50. Minimum 1, maximum 100. |
--cursor | string | No | Opaque 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 123upload-creative
Upload creative. POST /v1/brands/{brandId}/creatives, API reference.
koast upload-creative --brand <brand> [--json <file|->] [flags]| Flag | Type | Required | Description |
|---|---|---|---|
--brand | integer | Yes | The brand the request acts on. Every brand-scoped resource lives under its brand. |
--image-url | string | No | Public 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-data | string | No | Standard 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-type | string | No | Media type of fileData. Required with fileData, ignored with imageUrl. One of image/jpeg, image/png, image/webp, image/gif. |
--file-name | string | No | File name to store it under. Required with fileData; defaults to the url's own name otherwise. At most 200 characters. |
--name | string | No | Display 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