API referenceCreative Templates

Save creative template

Saves an html ad layout as a creative template for the brand. Every {{slot}} in the html must be listed in slots, and every listed slot must appear in the html. Render it with render-creative and templateId.

POST
/v1/brands/{brandId}/creative-templates
bearerAuth
headerAuthorizationBearer <token>

An organization API key (koast_sk_…) with the API surface enabled, or an OAuth access token issued by Koast (koast_at_…) whose audience covers this API. REST access requires an active Agency plan.

brandId*integer

The brand the request acts on. Every brand-scoped resource lives under its brand.

Idempotency-Key?string

Retrying with the same key within 24 hours returns the first response without acting again.

Lengthlength <= 255
application/json
  1. body
name*string

A short name the user will recognise.

Length1 <= length <= 120
html*string

The layout as a complete html page, with {{slot}} wherever text changes between versions.

Length1 <= length <= 200000
slots*array<>

Every {{slot}} in the html, each once, with what goes in it.

Itemsitems <= 30
aspectRatio*string

The aspect ratio the layout is designed for.

Value in"1:1""4:5""9:16"
referenceUrl?string

The ad or image the layout was modelled on, if any.

Formaturi
Lengthlength <= 2000
previewCreativeId?integer

A library creative rendered from this template, shown as its preview.

Range0 < value <= 9007199254740991

Response Body

Save creative template

application/json
  1. response
templateId*integer

Pass this as templateId to render-creative.

Range-9007199254740991 <= value <= 9007199254740991
name*string
aspectRatio*string
slots*array<>
referenceUrl*string|null
previewCreativeId*|null
previewUrl*string|null
html*string
createdAt*string
[key: string]?unknown
curl -X POST "https://example.com/v1/brands/0/creative-templates" \  -H "Authorization: Bearer koast_sk_..." \  -H "Content-Type: application/json" \  -d '{    "name": "string",    "html": "string",    "slots": [      {        "name": "string",        "description": "string"      }    ],    "aspectRatio": "1:1"  }'
{  "templateId": -9007199254740991,  "name": "string",  "aspectRatio": "string",  "slots": [    {      "name": "string",      "description": "string",      "property1": null,      "property2": null    }  ],  "referenceUrl": "string",  "previewCreativeId": -9007199254740991,  "previewUrl": "string",  "html": "string",  "createdAt": "string",  "property1": null,  "property2": null}

Required scope: write. CLI: koast save-creative-template, see Creative Templates commands. Authentication, headers, errors and pagination work the same on every operation. See Conventions.