API referenceStyle Guide

Save brand style guide

Creates or replaces the brand's style guide. guide is validated, and its asset ids must be the brand's own LOGO and FONT assets. confirmed: true stamps confirmedAt; false leaves the guide as a draft.

PUT
/v1/brands/{brandId}/style-guide
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.

application/json
  1. body
sourceUrl*|

The website the guide was built from, or null.

guide*
confirmed*boolean

True only when the user has approved the guide.

replacesSite?boolean

True only when the user chose sourceUrl as this brand's own website. Without it, a guide from another site than the brand's saved guide is refused, so a site read to make ads for another brand never replaces this brand's style.

Response Body

Save brand style guide

application/json
  1. response
guide*|null
confirmedAt*|

When the user approved the guide; null while it is a draft.

sourceUrl*string|null
logo*|null
fontCss*string

CSS that loads the guide's fonts. Paste it into the of an HTML layout before using the font families.

images*array<>

The site's own images: product shots, app screens, the hero and its social image, stored as brand assets. Pass a url as an imageUrl reference to generate-creatives, or use it as an src in render-creative html.

Itemsitems <= 6
[key: string]?unknown
curl -X PUT "https://example.com/v1/brands/0/style-guide" \  -H "Authorization: Bearer koast_sk_..." \  -H "Content-Type: application/json" \  -d '{    "sourceUrl": "string",    "guide": {      "palette": [        {          "hex": "string",          "role": "primary",          "source": "measured"        }      ],      "typography": {        "heading": {          "family": "string",          "fallback": "serif",          "source": "measured"        },        "body": {          "family": "string",          "fallback": "serif",          "source": "measured"        }      },      "shapes": {        "corners": "string",        "buttons": "string"      },      "imagery": "string",      "voice": "string",      "dos": [        "string"      ],      "donts": [        "string"      ]    },    "confirmed": true  }'
{  "guide": {    "palette": [      {        "hex": "string",        "role": "primary",        "name": "string",        "source": "measured"      }    ],    "typography": {      "heading": {        "family": "string",        "weight": 100,        "fallback": "serif",        "source": "measured",        "assetIds": [          1        ]      },      "body": {        "family": "string",        "weight": 100,        "fallback": "serif",        "source": "measured",        "assetIds": [          1        ]      }    },    "shapes": {      "corners": "string",      "buttons": "string",      "cards": "string",      "lines": "string",      "other": "string"    },    "logo": {      "assetId": 1,      "use": "onDark"    },    "imagery": "string",    "voice": "string",    "dos": [      "string"    ],    "donts": [      "string"    ]  },  "confirmedAt": "string",  "sourceUrl": "string",  "logo": {    "assetId": -9007199254740991,    "url": "string",    "property1": null,    "property2": null  },  "fontCss": "string",  "images": [    {      "assetId": -9007199254740991,      "url": "string",      "label": "string",      "property1": null,      "property2": null    }  ],  "property1": null,  "property2": null}

Required scope: write. CLI: koast save-brand-style-guide, see Style Guide commands. Authentication, headers, errors and pagination work the same on every operation. See Conventions.