CLI commands

Creative Templates commands

The 2 koast CLI commands for the Creative Templates 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-creative-templates

List creative templates. GET /v1/brands/{brandId}/creative-templates, API reference.

koast list-creative-templates --brand <brand>
FlagTypeRequiredDescription
--brandintegerYesThe brand the request acts on. Every brand-scoped resource lives under its brand.

Required scope: read.

Example:

koast list-creative-templates --brand 123

save-creative-template

Save creative template. POST /v1/brands/{brandId}/creative-templates, API reference.

koast save-creative-template --brand <brand> --name <name> --html <html> --slots <slots> --aspect-ratio <aspect-ratio> [--json <file|->] [flags]
FlagTypeRequiredDescription
--brandintegerYesThe brand the request acts on. Every brand-scoped resource lives under its brand.
--namestringYesA short name the user will recognise. At most 120 characters.
--htmlstringYesThe layout as a complete html page, with {{slot}} wherever text changes between versions. At most 200000 characters.
--slotsJSON object, repeatableYesEvery {{slot}} in the html, each once, with what goes in it. At most 30 items.
--aspect-ratiostringYesThe aspect ratio the layout is designed for. One of 1:1, 4:5, 9:16.
--reference-urlstringNoThe ad or image the layout was modelled on, if any. At most 2000 characters.
--preview-creative-idintegerNoA library creative rendered from this template, shown as its preview.

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 save-creative-template --brand 123 --json body.json

With body.json:

{
  "name": "string",
  "html": "string",
  "slots": [
    {
      "name": "string",
      "description": "string"
    }
  ],
  "aspectRatio": "1:1",
  "referenceUrl": "https://hooks.example.com/koast",
  "previewCreativeId": 1
}

On this page