> ## Documentation Index
> Fetch the complete documentation index at: https://docs.knowlify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Website brand lookup

> Retrieve brand context for the Training composer from a website URL

<Note>
  These pages describe the Training API on `dev`, where authenticated creation, editing, downloads, revert, and website brand lookup have been tested live.
  Production availability is not confirmed. Your API service and worker must both run the updated code.
  See [Testing and availability](/api-reference/testing).
</Note>

`POST {API_BASE}/v1/brand-kits`

This is the website URL lookup used by Training. It retrieves context.dev brand information; it does not create or list saved brands from the Marketing Brand tab.

```bash theme={null}
curl --fail-with-body "$API_BASE/v1/brand-kits" \
  -H "X-API-Key: $KNOWLIFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"domain":"https://www.stripe.com/about"}'
```

## Request

`domain` is required, with 1–2048 characters. Supply a public domain or HTTP(S) website URL. The server normalizes the host, removes a leading `www.`, and ignores the URL path. IP addresses, local hostnames, credentials in URLs, and explicit ports are rejected with 422.

Allow up to 90 seconds in your client for a lookup. Brand retrieval is required; styleguide and font extraction are optional enrichments. Missing enrichments do not discard a valid brand result.

## Response

HTTP 200 can mean either `{ "success": true, "data": { ... } }` or `{ "success": false, "error": "..." }`. Always check `success`.

| Data field                      | Meaning                                                                         |
| ------------------------------- | ------------------------------------------------------------------------------- |
| `name`, `domain`, `description` | Brand identity; name and description can be null                                |
| `colors`                        | Palette slots: primary, secondary, tertiary, accent; missing values can be null |
| `allColors`                     | Extracted hex colors                                                            |
| `logos`                         | Logo objects with URL, type, theme, and format                                  |
| `images`                        | Image objects with URL, format, and kind                                        |
| `fonts`                         | Title and body font families; either can be null                                |
| `googleFonts`                   | Detected Google font families                                                   |
| `fontFiles`                     | Available font files with family, URL, weight, and source                       |
| `styleHint`                     | Suggested brand direction, or null                                              |

Missing configuration, provider failure, no brand found, and a brand flagged as unsafe return `success: false` with a sanitized error. Authentication and request validation failures use HTTP error responses. The server needs `CONTEXT_DEV_API_KEY`; callers send only their Knowlify key.

## Apply selected context to a video

Brand lookup does not automatically attach context. Map the selected fields into a [video creation item](/api-reference/create-video):

| Video field              | Brand context                                                   |
| ------------------------ | --------------------------------------------------------------- |
| `color_palette`          | `data.colors`, omitting null entries                            |
| `global_style_prompt`    | Your visual direction plus `data.styleHint`                     |
| `brand_fonts`            | Title/body from `data.fonts`, plus up to eight `data.fontFiles` |
| `reference_image_urls`   | URLs of selected logos or images, up to 20 total                |
| `colors_locked_by_user`  | True when the user explicitly selected the palette              |
| `disable_scraped_images` | True when the user has curated the images                       |

Only forward font-file sources supported by creation (`google` or `custom`); omit an unknown source. Review the selected images and fonts before submitting them.

```javascript theme={null}
// After checking the lookup response has success: true:
const kit = lookupResponse.data;
const video = {
  task: "Train employees to lock their screen before leaving their desk.",
  video_duration_seconds: 30,
  video_type: "training",
  video_quality: "standard",
  color_palette: Object.fromEntries(
    Object.entries(kit.colors).filter(([, value]) => value != null),
  ),
  global_style_prompt: ["Use clear, readable training visuals.", kit.styleHint]
    .filter(Boolean).join(" "),
  brand_fonts: {
    title: kit.fonts.title,
    body: kit.fonts.body,
    files: kit.fontFiles.slice(0, 8).map(({ source, ...file }) => ({
      ...file,
      ...(["google", "custom"].includes(source) ? { source } : {}),
    })),
  },
};
// Add only the logo/image URLs the user selected, then POST { videos: [video] }.
```
