Render creative
Renders an html ad, or a saved creative template with its slot values, at 1080 pixels wide in the aspect ratio given, and stores the image for the brand; it stays out of the creative library list until it is saved with save-generated-creatives or used in an ad. Page scripts are off and only data: urls, Koast storage and Google Fonts load; other requests are listed in blocked. Synchronous; allow up to three minutes.
bearerAuthAuthorizationBearer <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*integerThe brand the request acts on. Every brand-scoped resource lives under its brand.
Idempotency-Key?stringRetrying with the same key within 24 hours returns the first response without acting again.
length <= 255application/json- body
roundSize?integerWrite this first, before every other field. How many ads you are making in this round across all your calls; send the same number on every call of the round. The user sees that many placeholders as soon as it is written. It does not change what this call makes.
1 <= value <= 60html?stringA complete html page for the ad, laid out at the size of the aspect ratio. Page scripts do not run. Only inline data: urls, Koast storage urls and Google Fonts load; every other request is blocked.
1 <= length <= 200000templateId?integerRender a saved template from list-creative-templates instead of html.
0 < value <= 9007199254740991values?With templateId: the text for each {{slot}} of the template, by slot name. Values go in as plain text.
aspectRatio*string1:1 renders at 1080x1080, 4:5 at 1080x1350, 9:16 at 1080x1920.
"1:1""4:5""9:16"name?stringName for the stored creative.
1 <= length <= 120source?stringWhere this ad's idea came from: references (images the user attached or references they picked), meta-winners (other advertisers' winning ads from the Meta Ad Library), own-winners (the brand's own best ads from its ad account), ideas (none of these: the brief and the website). The user sees the round grouped by it.
"references""meta-winners""own-winners""ideas"policyRisk?stringSet this only when the ad could be rejected: why, in a few plain words the user understands ("promises a guaranteed result", "won't run on your agency ad account: crypto"). The ad is still made exactly as asked, and the user sees this as a warning on the ad. Leave it out when there is no real risk.
1 <= length <= 140Render creative
application/json- response
creatives*array<>total*integer-9007199254740991 <= value <= 9007199254740991page*integer-9007199254740991 <= value <= 9007199254740991pages*integer-9007199254740991 <= value <= 9007199254740991selection*booleannextCursor*nullfailures*array<>The render, when it could not be made, with why.
blocked*array<string>Requests the page made that were blocked, so what they would have loaded is missing from the image.
modelImages?array<>Images shown to you after this call
items <= 12[key: string]?unknowncurl -X POST "https://example.com/v1/brands/0/creatives/render" \ -H "Authorization: Bearer koast_sk_..." \ -H "Content-Type: application/json" \ -d '{ "aspectRatio": "1:1" }'{ "creatives": [ { "creativeId": -9007199254740991, "name": "string", "kind": "image", "url": "string", "previewUrl": "string", "previewable": true, "width": 0, "height": 0, "aspectRatio": "string", "durationSeconds": null, "sizeBytes": 0, "isImported": true, "ready": true, "createdAt": "string", "variation": -9007199254740991, "ad": -9007199254740991, "policyRisk": "string", "property1": null, "property2": null } ], "total": -9007199254740991, "page": -9007199254740991, "pages": -9007199254740991, "selection": true, "nextCursor": null, "failures": [ { "aspectRatio": "1:1", "variation": -9007199254740991, "ad": -9007199254740991, "refused": true, "reason": "string", "property1": null, "property2": null } ], "blocked": [ "string" ], "modelImages": [ { "url": "string", "label": "string", "property1": null, "property2": null } ], "property1": null, "property2": null}Required scope: write. CLI: koast render-creative, see Creatives commands. Authentication, headers, errors and pagination work the same on every operation. See Conventions.
Generate creatives
Generates the ads in ads in parallel, each from its own prompt, optionally guided by reference images (library creativeIds or https urls, in order) or by editing an existing library image (editCreativeId), and stores each image for the brand; a generated image stays out of the creative library list until it is saved with save-generated-creatives or used in an ad. Returns the stored creatives, each with the ad it came from, plus failures for images that could not be made. Synchronous; allow up to five minutes.
Save generated creatives
Saves AI-generated creatives (from generate-creatives) into the brand's creative library, where the creatives list shows them. A generated creative stays out of that list until it is saved or used in an ad. Creatives an agent chat made go into one folder for that chat, named on its first save; others are saved at the top of the library. Returns the ids this call saved, the ids that were already saved, the ids that are not generated creatives of this brand, and the folders it saved into. Idempotent.