Create a brand
const url = 'http://localhost:3000/api/v1/brands';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"example","slug":"example","from":"example","template":"firefox","domain":"example","brandJson":{"additionalProperty":"example"},"brand":"example","publish":{"note":"example","image":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"},"visibility":"private","dryRun":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/v1/brands \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "example", "slug": "example", "from": "example", "template": "firefox", "domain": "example", "brandJson": { "additionalProperty": "example" }, "brand": "example", "publish": { "note": "example", "image": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }, "visibility": "private", "dryRun": true }'Empty, or from another brand’s current rules, a public BrandHub brand’s release, a template, or an AdCP brand.json: a domain’s (https://{domain}/.well-known/brand.json, following its authoritative_location and a house portfolio’s brand_refs, https only) or a brandJson document. From a brand.json, its colors, type, logos, voice and more become rules, its logos and font files are ingested from their URLs, and the brand keeps its domain (a template’s too); skipped and dropped say what was left out. publish releases it and visibility: public lists it on BrandHub in the same call (both take share on the project); if either fails, no brand is made. Its history starts at version 1.
Scope: write.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
Required, but from a brand.json: then the brand’s name there when left out
Defaults to the name, as a slug; from a brand.json, to its id
Start from a showcase brand’s rules, theme, pages and logos, to edit into your own
Start from this domain’s AdCP brand.json (https://{domain}/.well-known/brand.json, following its authoritative_location and a house portfolio’s brand_refs): its colors, type, logos (ingested from their URLs), voice and more, as rules. With brandJson, only where that document came from. The brand keeps the document’s own domain (its url), else this one
Start from this AdCP brand.json document, rather than one read from domain
object
Which brand of a house portfolio, by its AdCP id; when left out, the one at domain, or its only one
public puts its release on BrandHub for anyone, once made; takes publish
Check that a brand can be made here (write on the project, not read-only, room in the plan’s brands), make nothing: before long work that ends in one
Responses
Section titled “Responses”Created
object
object
Only grants on it, and admins, reach it in the app
Who sees it on BrandHub
The BrandHub brand it started from, as {org}/{brand}@{n}
Its own domain (acme.com): whoever proves it may claim its BrandHub listing
Claimed on BrandHub by whoever proved its domain: the listing that took its place, as {org}/{brand}
From a brand.json: files and portfolio brands that wouldn’t read; from a BrandHub brand: files shown there but not handed out. Each with why
From a brand.json: what it says that has no place in the rules, by its path there
With publish: the version released
Example
{ "data": { "visibility": "private", "hub": { "visibility": "private" } }}default
Section titled “default”An error
object
object
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": "example" }}