Structure Templates commands
The 5 koast CLI commands for the Structure 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.
author-structure-template
Create structure template. POST /v1/brands/{brandId}/structure-templates, API reference.
koast author-structure-template --brand <brand> --name <name> --config <config> --audiences <audiences> [--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 | Template name. At most 191 characters. |
--config | JSON object | Yes | |
--audiences | JSON object, repeatable | Yes | Template-level audiences (targetingSet | customAudience | savedAudience). At least one is required to save or apply. |
--settings | JSON object | No | Step-2 settings (objective, CBO+budget, attribution, performance goal, isAdCategorized), required to apply. |
--scope | string | No | One of single, multiple. |
--accounts | JSON object, repeatable | No |
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 author-structure-template --brand 123 --json body.jsonWith body.json:
{
"name": "string",
"config": {
"countMode": "dynamic",
"n": 1,
"adsets": "fixed",
"k": 1,
"per": 1,
"placement": "broadcast",
"splitMode": "even",
"weights": [
12.5
],
"name": "string",
"ops": [
{}
],
"remainderPolicy": "frontload",
"minPerSet": 1,
"maxPerSet": 1
},
"audiences": [
{}
],
"settings": {},
"scope": "single",
"accounts": [
{
"adAccountId": "string",
"settings": {},
"status": "string"
}
]
}delete-structure-template
Delete structure template. DELETE /v1/brands/{brandId}/structure-templates/{templateId}, API reference.
koast delete-structure-template --brand <brand> --template-id <template-id>| Flag | Type | Required | Description |
|---|---|---|---|
--brand | integer | Yes | The brand the request acts on. Every brand-scoped resource lives under its brand. |
--template-id | string | Yes | The structure template id, from listStructureTemplates. |
Required scope: write.
Example:
koast delete-structure-template --brand 123 --template-id TEMPLATE_IDedit-structure-template-rules
Edit structure template rules. PATCH /v1/brands/{brandId}/structure-templates/{templateId}, API reference.
koast edit-structure-template-rules --brand <brand> --template-id <template-id> [--json <file|->] [flags]| Flag | Type | Required | Description |
|---|---|---|---|
--brand | integer | Yes | The brand the request acts on. Every brand-scoped resource lives under its brand. |
--template-id | string | Yes | Structure template ID. Omit to read the template currently open in the builder from the Current Context block. Pass an explicit id only when acting on a different template than the one in scope. |
--name | string | No | |
--config | JSON object | No | |
--audiences | JSON object, repeatable | No | Template-level audiences (targetingSet | customAudience | savedAudience). At least one is required to save or apply. |
--settings | JSON object | No | |
--scope | string | No | One of single, multiple. |
--status | string | No | One of DRAFT, READY, NEEDS_ATTENTION. |
--accounts | JSON object, repeatable | No |
Required scope: write. --json <file|-> supplies the whole body. Body flags are applied over it.
Example:
koast edit-structure-template-rules --brand 123 --template-id TEMPLATE_IDget-structure-template
Get structure template. GET /v1/brands/{brandId}/structure-templates/{templateId}, API reference.
koast get-structure-template --brand <brand> --template-id <template-id>| Flag | Type | Required | Description |
|---|---|---|---|
--brand | integer | Yes | The brand the request acts on. Every brand-scoped resource lives under its brand. |
--template-id | string | Yes | Structure template ID. Omit to read the template currently open in the builder from the Current Context block. Pass an explicit id only when acting on a different template than the one in scope. |
Required scope: read.
Example:
koast get-structure-template --brand 123 --template-id TEMPLATE_IDlist-structure-templates
List structure templates. GET /v1/brands/{brandId}/structure-templates, API reference.
koast list-structure-templates --brand <brand> [flags]| Flag | Type | Required | Description |
|---|---|---|---|
--brand | integer | Yes | The brand the request acts on. Every brand-scoped resource lives under its brand. |
--cursor | string | No | Opaque cursor from the previous page's nextCursor. Omit for the first page. |
--limit | integer | No | Page size. Default 50. Minimum 1, maximum 100. |
Required scope: read. Paged. --all follows nextCursor to the end and prints one JSON line per item.
Example:
koast list-structure-templates --brand 123