API ReferenceView as MarkdownOpenAPI

Design & components

View as Markdown

The site's look: the theme (colours, fonts, dark mode), header, footer, popups and reusable custom components built with HTML, CSS and JS.

Endpoints that need a token: the site owner creates it in their admin (Developers > API reference). AI assistants: how to ask the user for one.

81 endpoints in 7 parts: Custom Component, Custom Font, Editor, Index Component, Popup, Wildcard, AI builder.

List all custom components

The custom code components. Answers an array of every record.

Public

Public - no token needed.

Returns

Returns a list of CustomComponent objects.

Status codes

200 500

GET/custom-components
curl -X GET 'http://butholding.com/custom-components?ionic=true'
Response
[
  {
    "name": "Example",
    "html": "example",
    "compiled_html": "example",
    "css": "example",
    "compiled_css": "example",
    "js": "example",
    "variables": [
      {
        "value": "example",
        "_id": "6543210fedcba98765432100"
      }
    ],
    "iframe": false,
    "media": "6543210fedcba98765432100",
    "_id": "6543210fedcba98765432100",
    "updatedAt": "2026-11-04T12:00:00.000Z",
    "createdAt": "2026-11-04T12:00:00.000Z"
  }
]

Create a custom component

Creates a custom code component. Answers 201 with no body.

Admin token

Needs a site admin token.

Returns

Returns the CustomComponent object.

Status codes

201 400 401 500

POST/custom-components
curl -X POST 'http://butholding.com/custom-components?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "name": "Example",
  "html": "example",
  "compiled_html": "example",
  "css": "example",
  "compiled_css": "example",
  "js": "example",
  "variables": [
    {
      "value": "example",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "iframe": false,
  "media": "6543210fedcba98765432100",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Retrieve a custom component

One custom code component. 404 when there is no such record.

Public

Public - no token needed.

Path parameters
idstringRequired

The ID of the custom component.

Returns

Returns the CustomComponent object.

Status codes

200 404 500

GET/custom-components/:id
curl -X GET 'http://butholding.com/custom-components/{id}?ionic=true'
Response
{
  "name": "Example",
  "html": "example",
  "compiled_html": "example",
  "css": "example",
  "compiled_css": "example",
  "js": "example",
  "variables": [
    {
      "value": "example",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "iframe": false,
  "media": "6543210fedcba98765432100",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Update a custom component

Updates a custom code component. Fields outside the allowed list are silently ignored. Answers the updated record, or 404.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the custom component.

Returns

Returns the CustomComponent object.

Status codes

200 400 401 404 500

PATCH/custom-components/:id
curl -X PATCH 'http://butholding.com/custom-components/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "name": "Example",
  "html": "example",
  "compiled_html": "example",
  "css": "example",
  "compiled_css": "example",
  "js": "example",
  "variables": [
    {
      "value": "example",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "iframe": false,
  "media": "6543210fedcba98765432100",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Delete a custom component

Deletes a custom code component. Answers the deleted record, or 404. Records that point to it are not changed.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the custom component.

Returns

Returns an empty answer on success.

Status codes

200 401 404 500

DELETE/custom-components/:id
curl -X DELETE 'http://butholding.com/custom-components/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the custom font

The uploaded fonts. Answers an array of every record.

Admin token

Needs a site admin token.

Returns

Returns the CustomFont object.

Status codes

200 401 500

GET/custom-font
curl -X GET 'http://butholding.com/custom-font?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "family": "example",
  "link": "example-item",
  "name": "Example",
  "weights": "example",
  "italics": [
    "example"
  ],
  "subsets": [
    "example"
  ],
  "generic": "example",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Create a custom font

Import a Google font. Takes `{ query }` — a family name, a Google. Fonts URL, a <link> tag or a `font-family:` declaration — and resolves its real weights against Google's font metadata. The older `{ family, link }` body still works unchanged.

Admin token

Needs a site admin token.

Parameters
querystring

The custom font's query.

Returns

Returns the CustomFont object.

Status codes

201 400 401 500

POST/custom-font
curl -X POST 'http://butholding.com/custom-font?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "query": "..." }'
Response
{
  "family": "example",
  "link": "example-item",
  "name": "Example",
  "weights": "example",
  "italics": [
    "example"
  ],
  "subsets": [
    "example"
  ],
  "generic": "example",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Retrieve a custom font

One uploaded font. 404 when there is no such record.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the custom font.

Returns

Returns the CustomFont object.

Status codes

200 401 404 500

GET/custom-font/:id
curl -X GET 'http://butholding.com/custom-font/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "family": "example",
  "link": "example-item",
  "name": "Example",
  "weights": "example",
  "italics": [
    "example"
  ],
  "subsets": [
    "example"
  ],
  "generic": "example",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Update a custom font

Updates an uploaded font. Fields outside the allowed list are silently ignored. Answers the updated record, or 404.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the custom font.

Returns

Returns the CustomFont object.

Status codes

200 400 401 404 500

PATCH/custom-font/:id
curl -X PATCH 'http://butholding.com/custom-font/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "family": "example",
  "link": "example-item",
  "name": "Example",
  "weights": "example",
  "italics": [
    "example"
  ],
  "subsets": [
    "example"
  ],
  "generic": "example",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Delete a custom font

Deletes an uploaded font. Answers the deleted record, or 404. Records that point to it are not changed.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the custom font.

Returns

Returns an empty answer on success.

Status codes

200 401 404 500

DELETE/custom-font/:id
curl -X DELETE 'http://butholding.com/custom-font/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the font catalogue

Every font the theme picker may offer — the built-in library plus. this tenant's own imports, in one shape.

Admin token

Needs a site admin token.

Status codes

200 401 500

GET/font-catalogue
curl -X GET 'http://butholding.com/font-catalogue?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "family": "example",
  "link": "example-item",
  "name": "Example",
  "weights": "example",
  "italics": [
    "example"
  ],
  "subsets": [
    "example"
  ],
  "generic": "example",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Add an add locale

Adds a word key to the site's locales (locale), for every language. locale is the wording to add; it becomes both the key and the text until translated. Answers 201 when added, 200 when the key already exists. Reads no token.

Public

Public - no token needed.

Parameters
localestring

The add locale's locale.

Status codes

200

POST/add-locale
curl -X POST 'http://butholding.com/add-locale?ionic=true' \
  -H 'Content-Type: application/json' \
  -d '{ "locale": "..." }'

Retrieve the 404

The legacy site file templates/views/404.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-404
curl -X GET 'http://butholding.com/get-404?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the app scss

The legacy site file public/css/app-stylesheet.css, as text. Answers the file's text as it is on the server now.

Public

Public - no token needed.

Status codes

200

GET/get-app-scss
curl -X GET 'http://butholding.com/get-app-scss?ionic=true'

Retrieve the blog

The legacy site file templates/views/blogpost.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-blog
curl -X GET 'http://butholding.com/get-blog?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

List all blogs

The legacy site file templates/views/blogposts.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-blogs
curl -X GET 'http://butholding.com/get-blogs?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the bs css

The legacy site file public/css/bs-theme.css, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-bs-css
curl -X GET 'http://butholding.com/get-bs-css?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the cart

The legacy site file templates/views/my_cart.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-cart
curl -X GET 'http://butholding.com/get-cart?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

List all contacts

The legacy site file templates/views/contacts.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-contacts
curl -X GET 'http://butholding.com/get-contacts?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the css

The legacy site file public/css/stylesheet.css, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-css
curl -X GET 'http://butholding.com/get-css?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the header

The legacy site file templates/partials/header.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-header
curl -X GET 'http://butholding.com/get-header?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the header css

The legacy site file public/css/header.css, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-header-css
curl -X GET 'http://butholding.com/get-header-css?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the index

The legacy site file templates/views/index.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-index
curl -X GET 'http://butholding.com/get-index?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

List all locales

The site's words by language, as JSON. Answers the site's words as { <key>: <text shown> }, from the newest locales record.

Public

Public - no token needed.

Returns

Returns a list of Locales objects.

Status codes

200 404 500

GET/get-locales
curl -X GET 'http://butholding.com/get-locales?ionic=true'
Response
[
  {
    "locales_object": {},
    "_id": "6543210fedcba98765432100",
    "updatedAt": "2026-11-04T12:00:00.000Z",
    "createdAt": "2026-11-04T12:00:00.000Z"
  }
]

Retrieve the main css

The legacy site file public/css/main.css, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-main-css
curl -X GET 'http://butholding.com/get-main-css?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

List all partners

The legacy site file templates/views/partners.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-partners
curl -X GET 'http://butholding.com/get-partners?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the payment

The legacy site file templates/views/payment.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-payment
curl -X GET 'http://butholding.com/get-payment?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the product

The legacy site file templates/views/product.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-product
curl -X GET 'http://butholding.com/get-product?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

List all products

The legacy site file templates/views/products.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-products
curl -X GET 'http://butholding.com/get-products?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the service

The legacy site file templates/views/service.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-service
curl -X GET 'http://butholding.com/get-service?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

List all services

The legacy site file templates/views/services.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-services
curl -X GET 'http://butholding.com/get-services?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the store

The legacy site file templates/views/store.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-store
curl -X GET 'http://butholding.com/get-store?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve the theme

The site's theme file (colours, fonts) from cloud storage. Answers the theme JSON straight from cloud storage, or 404 when the site has none yet.

Public

Public - no token needed.

Status codes

200 400 404 500

GET/get-theme
curl -X GET 'http://butholding.com/get-theme?ionic=true'

Retrieve the vlog

The legacy site file templates/views/video.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-vlog
curl -X GET 'http://butholding.com/get-vlog?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

List all vlogs

The legacy site file templates/views/videos.hbs, as text. Answers the file's text as it is on the server now.

Admin token

Needs a site admin token.

Status codes

200 401

GET/get-vlogs
curl -X GET 'http://butholding.com/get-vlogs?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Set a 404

Overwrites the legacy site file templates/views/404.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The 404's content.

Status codes

200 401

POST/set-404
curl -X POST 'http://butholding.com/set-404?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a blog

Overwrites the legacy site file templates/views/blogpost.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The blog's content.

Status codes

200 401

POST/set-blog
curl -X POST 'http://butholding.com/set-blog?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set blogs

Overwrites the legacy site file templates/views/blogposts.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The blog's content.

Status codes

200 401

POST/set-blogs
curl -X POST 'http://butholding.com/set-blogs?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set bs css

Overwrites the legacy site file public/css/bs-theme.css with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The bs css's content.

Status codes

200 401

POST/set-bs-css
curl -X POST 'http://butholding.com/set-bs-css?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a cart

Overwrites the legacy site file templates/views/my_cart.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The cart's content.

Status codes

200 401

POST/set-cart
curl -X POST 'http://butholding.com/set-cart?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set contacts

Overwrites the legacy site file templates/views/contacts.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The contact's content.

Status codes

200 401

POST/set-contacts
curl -X POST 'http://butholding.com/set-contacts?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a css

Overwrites the legacy site file public/css/stylesheet.css with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The css's content.

Status codes

200 401

POST/set-css
curl -X POST 'http://butholding.com/set-css?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a footer

Overwrites the legacy site file templates/partials/footer.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The footer's content.

Status codes

200 401

POST/set-footer
curl -X POST 'http://butholding.com/set-footer?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a footer css

Overwrites the legacy site file public/css/footer.css with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The footer css's content.

Status codes

200 401

POST/set-footer-css
curl -X POST 'http://butholding.com/set-footer-css?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a header

Overwrites the legacy site file templates/partials/header.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The header's content.

Status codes

200 401

POST/set-header
curl -X POST 'http://butholding.com/set-header?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a header css

Overwrites the legacy site file public/css/header.css with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The header css's content.

Status codes

200 401

POST/set-header-css
curl -X POST 'http://butholding.com/set-header-css?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set an index

Overwrites the legacy site file templates/views/index.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The index's content.

Status codes

200 401

POST/set-index
curl -X POST 'http://butholding.com/set-index?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set locales

Replaces the site's words by language (content). Send the whole map as content (JSON text): keys left out are removed. Older locales records are deleted and the app re-reads its startup data.

Admin token

Needs a site admin token.

Parameters
contentstring

The locale's content.

Status codes

200 401

POST/set-locales
curl -X POST 'http://butholding.com/set-locales?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a main css

Overwrites the legacy site file public/css/main.css with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The main css's content.

Status codes

200 401

POST/set-main-css
curl -X POST 'http://butholding.com/set-main-css?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set partners

Overwrites the legacy site file templates/views/partners.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The partner's content.

Status codes

200 401

POST/set-partners
curl -X POST 'http://butholding.com/set-partners?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a payment

Overwrites the legacy site file templates/views/payment.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The payment's content.

Status codes

200 401

POST/set-payment
curl -X POST 'http://butholding.com/set-payment?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a product

Overwrites the legacy site file templates/views/product.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The product's content.

Status codes

200 401

POST/set-product
curl -X POST 'http://butholding.com/set-product?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set products

Overwrites the legacy site file templates/views/products.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The product's content.

Status codes

200 401

POST/set-products
curl -X POST 'http://butholding.com/set-products?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a service

Overwrites the legacy site file templates/views/service.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The service's content.

Status codes

200 401

POST/set-service
curl -X POST 'http://butholding.com/set-service?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set services

Overwrites the legacy site file templates/views/services.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The service's content.

Status codes

200 401

POST/set-services
curl -X POST 'http://butholding.com/set-services?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a store

Overwrites the legacy site file templates/views/store.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The store's content.

Status codes

200 401

POST/set-store
curl -X POST 'http://butholding.com/set-store?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set a theme

Saves the site's theme (whole, or one section), marks the theme step done and re-renders every page. Send either the whole theme as content (a JSON string), or one section as { section, value }: section 'header' or 'footer' replaces that part with value; section 'theme' writes value's colour and font keys (a null key goes back to absent). A section is merged onto the current theme, so nothing else in it changes: every other key the site's published theme has stays published, including keys the saved theme record lacks. Every page is rendered again with it on its next visit. Answers 200 only once the site shows the new theme: 400 when the section or value is wrong, 500 when it could not be saved or the site could not be updated. A section the site could not be updated with is not kept either (the saved theme goes back to what it was).

Admin token

Needs a site admin token.

Parameters
sectionstring

The theme's section.

valuestring

The theme's value.

contentstring

The theme's content.

Status codes

200 400 401 500

POST/set-theme
curl -X POST 'http://butholding.com/set-theme?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "section": "...", "value": "...", "content": "..." }'

Set a vlog

Overwrites the legacy site file templates/views/video.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The vlog's content.

Status codes

200 401

POST/set-vlog
curl -X POST 'http://butholding.com/set-vlog?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

Set vlogs

Overwrites the legacy site file templates/views/videos.hbs with content and restarts the site. Send the whole file as content; it replaces the old one and the site restarts to pick it up. A broken template or stylesheet breaks the site's pages until it is fixed.

Admin token

Needs a site admin token.

Parameters
contentstring

The vlog's content.

Status codes

200 401

POST/set-vlogs
curl -X POST 'http://butholding.com/set-vlogs?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "content": "..." }'

List all index components

The home page's blocks. Answers an array of every record.

Admin token

Needs a site admin token.

Returns

Returns a list of IndexComponent objects.

Status codes

200 401 500

GET/index-components
curl -X GET 'http://butholding.com/index-components?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
[
  {
    "type": "example",
    "position": 1,
    "about_page": "example",
    "isFluid": false,
    "isAppComponent": false,
    "_id": "6543210fedcba98765432100",
    "updatedAt": "2026-11-04T12:00:00.000Z",
    "createdAt": "2026-11-04T12:00:00.000Z"
  }
]

Create an index component

Replaces every home page block with the list sent, in order. The body is the WHOLE list (an array of blocks): every block not in it is removed. To add one block and keep the rest, use POST /index-components/append. The list is checked before anything is removed - an empty or invalid one answers 400 and changes nothing. A page block names its page by url in about_page, not by id. The home page is rendered again on its next visit. Answers 201.

Admin token

Needs a site admin token.

Parameters
mapstring

The index component's map.

Returns

Returns the IndexComponent object.

Status codes

201 400 401 500

POST/index-components
curl -X POST 'http://butholding.com/index-components?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "map": "..." }'
Response
{
  "type": "example",
  "position": 1,
  "about_page": "example",
  "isFluid": false,
  "isAppComponent": false,
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Retrieve an index component

One home page block. 404 when there is no such record.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the index component.

Returns

Returns the IndexComponent object.

Status codes

200 401 404 500

GET/index-components/:id
curl -X GET 'http://butholding.com/index-components/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "type": "example",
  "position": 1,
  "about_page": "example",
  "isFluid": false,
  "isAppComponent": false,
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Update an index component

Updates a home page block. The home page is rendered again on its next visit. Answers the block, or 404.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the index component.

Returns

Returns the IndexComponent object.

Status codes

200 400 401 404 500

PATCH/index-components/:id
curl -X PATCH 'http://butholding.com/index-components/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "type": "example",
  "position": 1,
  "about_page": "example",
  "isFluid": false,
  "isAppComponent": false,
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Delete an index component

Deletes a home page block. Answers the deleted record, or 404. Records that point to it are not changed.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the index component.

Returns

Returns an empty answer on success.

Status codes

200 401 404 500

DELETE/index-components/:id
curl -X DELETE 'http://butholding.com/index-components/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Create an index component

Adds one block to the home page, keeping the others - e.g. a page shown on the home page. For a page: { about_page: its id or its url } (type defaults to "about_page"). Other types show a list instead (products_latest, services, blogposts...). position puts it there and moves the blocks from there on down; without it, it goes last. isAppComponent: true adds it to the mobile app's home instead of the website's. 404 when the page does not exist. Answers 201 with the new block.

Admin token

Needs a site admin token.

Parameters
typestring

What the block shows: about_page (a page), or a list - products, products_latest, products_top, services, services_all, services_latest, services_top, blogposts, blogposts_latest, blogposts_top, videos, videos_latest, price_plans.

isFluidboolean

Spans the full width of the screen.

isAppComponentboolean

Shown in the mobile app's home instead of the website's.

about_pagestring

For an about_page block: the URL of the page it shows (AboutPage.url, e.g. "our-story"), not its id. POST /index-components/append takes either and stores the url.

positionnumber

Order on the home page; lower first.

Returns

Returns the IndexComponent object.

Status codes

201 400 401 404 500

POST/index-components/append
curl -X POST 'http://butholding.com/index-components/append?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "type": "...", "isFluid": "...", "isAppComponent": "...", "about_page": "...", "position": "..." }'
Response
{
  "type": "example",
  "position": 1,
  "about_page": "example",
  "isFluid": false,
  "isAppComponent": false,
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Retrieve the popup

The site's popups. Answers an array.

Admin token

Needs a site admin token.

Returns

Returns the Popup object.

Status codes

200 401 500

GET/popup
curl -X GET 'http://butholding.com/popup?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "title": "Example",
  "body": "6543210fedcba98765432100",
  "decline_button_text": "Text shown on the site.",
  "accept_button_text": "Text shown on the site.",
  "accept_button_link": "example-item",
  "wide_modal": false,
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Create a popup

Creates a popup. Answers 201 with no body.

Admin token

Needs a site admin token.

Returns

Returns the Popup object.

Status codes

201 400 401 500

POST/popup
curl -X POST 'http://butholding.com/popup?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "title": "Example",
  "body": "6543210fedcba98765432100",
  "decline_button_text": "Text shown on the site.",
  "accept_button_text": "Text shown on the site.",
  "accept_button_link": "example-item",
  "wide_modal": false,
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Retrieve a popup

One popup. 404 when there is no such record.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the popup.

Returns

Returns the Popup object.

Status codes

200 401 404 500

GET/popup/:id
curl -X GET 'http://butholding.com/popup/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "title": "Example",
  "body": "6543210fedcba98765432100",
  "decline_button_text": "Text shown on the site.",
  "accept_button_text": "Text shown on the site.",
  "accept_button_link": "example-item",
  "wide_modal": false,
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Update a popup

Updates a popup.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the popup.

Returns

Returns the Popup object.

Status codes

200 400 401 404 500

PATCH/popup/:id
curl -X PATCH 'http://butholding.com/popup/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "title": "Example",
  "body": "6543210fedcba98765432100",
  "decline_button_text": "Text shown on the site.",
  "accept_button_text": "Text shown on the site.",
  "accept_button_link": "example-item",
  "wide_modal": false,
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Delete a popup

Deletes a popup.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the popup.

Returns

Returns an empty answer on success.

Status codes

200 401 404 500

DELETE/popup/:id
curl -X DELETE 'http://butholding.com/popup/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve a g

Serves what a wildcard route points to (a product, service, post or program) at /g/<url>. 404 when no wildcard route has that url; 502 when the page it points to cannot be loaded. Cached for an hour.

Public

Public - no token needed.

Path parameters
urlstringRequired

The g's URL slug, as in its address on the site.

Status codes

200 404 500 502

GET/g/:url(*)
curl -X GET 'http://butholding.com/g/{url}(*)?ionic=true'
Response
{
  "url": "example-item",
  "points_to": "example",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

List all wildcards

The wildcard routes. Answers an array of every record.

Admin token

Needs a site admin token.

Query parameters
authenticatedstring

Only wildcards with this authenticated.

Returns

Returns a list of Wildcard objects.

Status codes

200 401 500

GET/wildcards
curl -X GET 'http://butholding.com/wildcards?ionic=true&authenticated=...' \
  -H 'Authorization: Bearer <TOKEN>'
Response
[
  {
    "url": "example-item",
    "points_to": "example",
    "_id": "6543210fedcba98765432100",
    "updatedAt": "2026-11-04T12:00:00.000Z",
    "createdAt": "2026-11-04T12:00:00.000Z"
  }
]

Create a wildcard

Creates a wildcard route. Answers 201 { id }.

Admin token

Needs a site admin token.

Returns

Returns the Wildcard object.

Status codes

201 400 401 500

POST/wildcards
curl -X POST 'http://butholding.com/wildcards?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "url": "example-item",
  "points_to": "example",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Retrieve a wildcard

One wildcard route. 404 when there is no such record.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the wildcard.

Returns

Returns the Wildcard object.

Status codes

200 401 404 500

GET/wildcards/:id
curl -X GET 'http://butholding.com/wildcards/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "url": "example-item",
  "points_to": "example",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Update a wildcard

Updates a wildcard route. Fields outside the allowed list are silently ignored. Answers the updated record, or 404.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the wildcard.

Returns

Returns the Wildcard object.

Status codes

200 400 401 404 500

PATCH/wildcards/:id
curl -X PATCH 'http://butholding.com/wildcards/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "url": "example-item",
  "points_to": "example",
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z"
}

Delete a wildcard

Deletes a wildcard route. Answers the deleted record, or 404. Records that point to it are not changed.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the wildcard.

Returns

Returns an empty answer on success.

Status codes

200 401 404 500

DELETE/wildcards/:id
curl -X DELETE 'http://butholding.com/wildcards/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Create a popup with AI

Create a popup from a prompt, written by the AI builder.

Admin token

Needs a site admin token.

Parameters
promptstring

What the AI should do with the popup, in plain words - any language.

chatIdstring

The AI chat this request belongs to; its history and language carry over. Leave it out to start a new chat.

aiVersionstring

Which version of the AI builder to use; leave it out for the current one.

item_idstring

The ID of the popup to change.

Status codes

200 401 500

POST/create-new-popup
curl -X POST 'http://butholding.com/create-new-popup?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "prompt": "...", "chatId": "...", "aiVersion": "...", "item_id": "..." }'
Response
{
  "chat_id": "6543210fedcba98765432100",
  "role": "user",
  "text": "Text shown on the site.",
  "target_url": "example-item",
  "action": "RESPONSE",
  "options": [
    "example"
  ],
  "medias": [
    {
      "media": "6543210fedcba98765432100",
      "gcs_url": "example-item",
      "gemini_uri": "example",
      "gemini_interaction_id": "example",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "products": [
    "6543210fedcba98765432101"
  ],
  "services": [
    "6543210fedcba98765432101"
  ],
  "blogposts": [
    "6543210fedcba98765432101"
  ],
  "programs": [
    "6543210fedcba98765432101"
  ],
  "files": [
    {
      "file": "6543210fedcba98765432100",
      "name": "Example",
      "kind": "example",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "files_read": [
    {
      "file": "6543210fedcba98765432100",
      "name": "Example",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "suggestions": [
    {
      "text": "Text shown on the site.",
      "route": "example",
      "item_id": "6543210fedcba98765432100",
      "medias": [],
      "picture": "6543210fedcba98765432100",
      "_id": "6543210fedcba98765432100"
    }
  ],
  "is_system": false,
  "_id": "6543210fedcba98765432100",
  "updatedAt": "2026-11-04T12:00:00.000Z",
  "createdAt": "2026-11-04T12:00:00.000Z",
  "data": {
    "object": "example",
    "object_type": "example",
    "edit_summary": "example",
    "edit_diff": "example",
    "undo_record": "example",
    "hero_animation_offer": "example",
    "preview_state": "example",
    "pending_credit_cost": 0,
    "applied_version": "example",
    "applied_section": "example",
    "target_restore": "example",
    "media_request": "example"
  }
}

Generate a popup with AI

Use it to create or set up a site popup or modal.

Admin token

Needs a site admin token.

Parameters
promptstring

What the AI should do with the popup, in plain words - any language.

chatIdstring

The AI chat this request belongs to; its history and language carry over. Leave it out to start a new chat.

Status codes

200 401 500

POST/generate-popup
curl -X POST 'http://butholding.com/generate-popup?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "prompt": "...", "chatId": "..." }'
↑↓ Navigate↵ GoEsc Close