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>| Flag | Type | Required | Description |
|---|---|---|---|
--brand | integer | Yes | The brand the request acts on. Every brand-scoped resource lives under its brand. |
Required scope: read.
Example:
koast list-creative-templates --brand 123save-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]| Flag | Type | Required | Description |
|---|---|---|---|
--brand | integer | Yes | The brand the request acts on. Every brand-scoped resource lives under its brand. |
--name | string | Yes | A short name the user will recognise. At most 120 characters. |
--html | string | Yes | The layout as a complete html page, with {{slot}} wherever text changes between versions. At most 200000 characters. |
--slots | JSON object, repeatable | Yes | Every {{slot}} in the html, each once, with what goes in it. At most 30 items. |
--aspect-ratio | string | Yes | The aspect ratio the layout is designed for. One of 1:1, 4:5, 9:16. |
--reference-url | string | No | The ad or image the layout was modelled on, if any. At most 2000 characters. |
--preview-creative-id | integer | No | A 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.jsonWith body.json:
{
"name": "string",
"html": "string",
"slots": [
{
"name": "string",
"description": "string"
}
],
"aspectRatio": "1:1",
"referenceUrl": "https://hooks.example.com/koast",
"previewCreativeId": 1
}