{"openapi":"3.1.0","info":{"title":"Lokand Agent API","version":"1.0.0","description":"Operations API for AI agents managing Lokand restaurants: onboarding, menu management, publishing, and billing. Every operation is also exposed as an MCP tool at https://api.lokand.com/mcp. Authentication: OAuth 2.0 (see https://lokand.com/auth.md)."},"servers":[{"url":"https://api.lokand.com"}],"components":{"securitySchemes":{"oauth2":{"type":"oauth2","flows":{"authorizationCode":{"authorizationUrl":"https://api.lokand.com/api/auth/oauth2/authorize","tokenUrl":"https://api.lokand.com/api/auth/oauth2/token","scopes":{"menu:read":"Read managed businesses and menus","menu:write":"Create and edit menus and items","business:write":"Update business profile, theme, publish","billing:manage":"Create checkout links, read billing","onboarding:create":"Create new restaurants","theme:read":"List and download custom theme code","theme:write":"Upload, publish and delete custom themes (Pro)"}}}}}},"paths":{"/agent/v1/ops/get_started":{"post":{"operationId":"get_started","summary":"How to use Lokand as an agent: the recipes for creating a restaurant for a customer, editing menus, and handing over ownership. Call this first if you're unsure what to do.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/list_businesses":{"post":{"operationId":"list_businesses","summary":"List the businesses the signed-in user is a member of (id, name, slug, role). Use it to pick the business_id other ops need.","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/get_business":{"post":{"operationId":"get_business","summary":"Look up a public Lokand restaurant/business by its slug. Returns profile, hours, contact info, locale and theme metadata.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"description":"The business's public slug"}},"required":["slug"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/list_menus":{"post":{"operationId":"list_menus","summary":"List the active menus of a public Lokand restaurant by its slug.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"description":"The business's public slug"}},"required":["slug"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/get_menu":{"post":{"operationId":"get_menu","summary":"Fetch a single menu (categories + items with prices) of a public Lokand restaurant.","security":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"description":"The business's public slug"},"menu_id":{"type":"string","minLength":1,"description":"The menu id from list_menus"}},"required":["slug","menu_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/get_status":{"post":{"operationId":"get_status","summary":"Private status of a business the caller manages: profile (including unpublished state), all menus (active and inactive), and plan. Requires the menu:read scope and membership.","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1,"description":"The business id"}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/create_full_menu":{"post":{"operationId":"create_full_menu","summary":"Create a COMPLETE menu (sections + items) in one call — prefer this over separate create_menu/add_category/add_item calls. With replace=true, existing menus are deactivated so this becomes the business's live menu (their data is kept, just hidden).","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"menu":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"default":"Menu","description":"Menu name, e.g. \"Menu\" or \"Dinner\""},"description":{"type":"string","maxLength":2000},"categories":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Section name, e.g. \"Burgers\""},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"price":{"type":"number","minimum":0,"maximum":1000000,"description":"Price in the business's currency. Required unless `variations` is given."},"variations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"price":{"type":"number","minimum":0,"maximum":1000000}},"required":["name","price"],"additionalProperties":false},"minItems":1,"maxItems":12,"description":"Variations of this dish (sizes, volumes, portions), each with its own ABSOLUTE price — see add_item. Use instead of one item per variation."},"is_available":{"type":"boolean","default":true},"dietary_info":{"type":"object","properties":{"allergens":{"type":"array","items":{"type":"string","enum":["gluten","crustaceans","eggs","fish","peanuts","soybeans","milk","nuts","celery","mustard","sesame","sulphites","lupin","molluscs"]},"maxItems":14},"contains":{"type":"array","items":{"type":"string","enum":["alcohol","pork","tobacco"]},"maxItems":3},"suitableFor":{"type":"array","items":{"type":"string","enum":["vegetarian","vegan","halal","kosher","gluten_free","dairy_free","nut_free","spicy","organic"]},"maxItems":9},"caloriesKcal":{"type":"integer","minimum":0,"maximum":20000},"portionGrams":{"type":"integer","minimum":0,"maximum":100000},"declaredAt":{"type":"integer","exclusiveMinimum":0}},"additionalProperties":false,"description":"Allergen/dietary declaration for this dish — see add_item"}},"required":["name"],"additionalProperties":false},"maxItems":100}},"required":["name","items"],"additionalProperties":false},"minItems":1,"maxItems":50,"description":"Sections in display order; items in display order"}},"required":["categories"],"additionalProperties":false},"replace":{"type":"boolean","default":false,"description":"Deactivate the business's other menus in the same step"}},"required":["business_id","menu"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/create_menu":{"post":{"operationId":"create_menu","summary":"Create an EMPTY menu on a business the caller manages (add sections with add_category, dishes with add_item). For a whole menu at once, use create_full_menu instead. Returns the new menu_id.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$","description":"Optional caller-chosen id (8-64 chars). Reuse the same id when retrying so a retry can never create a duplicate."},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Menu name, e.g. \"Dinner\""},"description":{"type":"string","maxLength":2000},"is_active":{"type":"boolean","default":true,"description":"Whether the menu is live on the public site"}},"required":["business_id","name"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/add_category":{"post":{"operationId":"add_category","summary":"Add a category (section) to a menu. Returns the new category_id.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"menu_id":{"type":"string","minLength":1},"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$","description":"Optional caller-chosen id (8-64 chars). Reuse the same id when retrying so a retry can never create a duplicate."},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Category name, e.g. \"Starters\""},"sort_order":{"type":"integer","minimum":0}},"required":["menu_id","name"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/add_item":{"post":{"operationId":"add_item","summary":"Add a dish/item to a menu (optionally inside a category). Returns the new item_id.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"menu_id":{"type":"string","minLength":1},"id":{"type":"string","pattern":"^[A-Za-z0-9_-]{8,64}$","description":"Optional caller-chosen id (8-64 chars). Reuse the same id when retrying so a retry can never create a duplicate."},"category_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Item name, e.g. \"Cacio e pepe\""},"description":{"type":"string","maxLength":2000},"price":{"type":"number","minimum":0,"maximum":1000000,"description":"Price in the business's currency. Required unless `variations` is given, in which case it is derived from the cheapest variation."},"variations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"price":{"type":"number","minimum":0,"maximum":1000000},"is_available":{"type":"boolean"}},"required":["name","price"],"additionalProperties":false},"minItems":1,"maxItems":12,"description":"Variations of this dish — sizes, volumes, portions, cuts — each with its own ABSOLUTE price (not a surcharge): e.g. [{name:'Small',price:3},{name:'Large',price:4.5}]. Use this instead of creating one item per variation. The item's own `price` becomes the 'from' price (the cheapest variation) automatically, so you may omit `price` when you pass variations. Names must be unique."},"is_available":{"type":"boolean","default":true},"sort_order":{"type":"integer","minimum":0},"dietary_info":{"type":"object","properties":{"allergens":{"type":"array","items":{"type":"string","enum":["gluten","crustaceans","eggs","fish","peanuts","soybeans","milk","nuts","celery","mustard","sesame","sulphites","lupin","molluscs"]},"maxItems":14},"contains":{"type":"array","items":{"type":"string","enum":["alcohol","pork","tobacco"]},"maxItems":3},"suitableFor":{"type":"array","items":{"type":"string","enum":["vegetarian","vegan","halal","kosher","gluten_free","dairy_free","nut_free","spicy","organic"]},"maxItems":9},"caloriesKcal":{"type":"integer","minimum":0,"maximum":20000},"portionGrams":{"type":"integer","minimum":0,"maximum":100000},"declaredAt":{"type":"integer","exclusiveMinimum":0}},"additionalProperties":false,"description":"Allergen and dietary labels shown to diners. `allergens` uses the 14 standard codes (gluten, crustaceans, eggs, fish, peanuts, soybeans, milk, nuts, celery, mustard, sesame, sulphites, lupin, molluscs); `contains` flags alcohol, pork or tobacco; `suitableFor` carries positive claims (vegetarian, vegan, halal, ...); `caloriesKcal` and `portionGrams` are per portion. Optional `declaredAt` (epoch-ms) records that a dish was reviewed, which sharpens check_compliance — a dish with no allergens and no declaredAt is indistinguishable from one nobody has looked at yet."}},"required":["menu_id","name"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_item":{"post":{"operationId":"update_item","summary":"Update a menu item's fields (name, description, price, availability, category, sort order). Only provided fields change. Setting is_available=false takes a dish off the public site (86 it).","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"item_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"dietary_info":{"anyOf":[{"type":"object","properties":{"allergens":{"type":"array","items":{"type":"string","enum":["gluten","crustaceans","eggs","fish","peanuts","soybeans","milk","nuts","celery","mustard","sesame","sulphites","lupin","molluscs"]},"maxItems":14},"contains":{"type":"array","items":{"type":"string","enum":["alcohol","pork","tobacco"]},"maxItems":3},"suitableFor":{"type":"array","items":{"type":"string","enum":["vegetarian","vegan","halal","kosher","gluten_free","dairy_free","nut_free","spicy","organic"]},"maxItems":9},"caloriesKcal":{"type":"integer","minimum":0,"maximum":20000},"portionGrams":{"type":"integer","minimum":0,"maximum":100000},"declaredAt":{"type":"integer","exclusiveMinimum":0}},"additionalProperties":false,"description":"Allergen and dietary labels shown to diners. `allergens` uses the 14 standard codes (gluten, crustaceans, eggs, fish, peanuts, soybeans, milk, nuts, celery, mustard, sesame, sulphites, lupin, molluscs); `contains` flags alcohol, pork or tobacco; `suitableFor` carries positive claims (vegetarian, vegan, halal, ...); `caloriesKcal` and `portionGrams` are per portion. Optional `declaredAt` (epoch-ms) records that a dish was reviewed, which sharpens check_compliance — a dish with no allergens and no declaredAt is indistinguishable from one nobody has looked at yet."},{"type":"null"}],"description":"Allergen and dietary labels shown to diners. `allergens` uses the 14 standard codes (gluten, crustaceans, eggs, fish, peanuts, soybeans, milk, nuts, celery, mustard, sesame, sulphites, lupin, molluscs); `contains` flags alcohol, pork or tobacco; `suitableFor` carries positive claims (vegetarian, vegan, halal, ...); `caloriesKcal` and `portionGrams` are per portion. Optional `declaredAt` (epoch-ms) records that a dish was reviewed, which sharpens check_compliance — a dish with no allergens and no declaredAt is indistinguishable from one nobody has looked at yet."},"price":{"type":"number","minimum":0,"maximum":1000000},"variations":{"anyOf":[{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"price":{"type":"number","minimum":0,"maximum":1000000},"is_available":{"type":"boolean"}},"required":["name","price"],"additionalProperties":false},"minItems":1,"maxItems":12,"description":"Variations of this dish — sizes, volumes, portions, cuts — each with its own ABSOLUTE price (not a surcharge): e.g. [{name:'Small',price:3},{name:'Large',price:4.5}]. Use this instead of creating one item per variation. The item's own `price` becomes the 'from' price (the cheapest variation) automatically, so you may omit `price` when you pass variations. Names must be unique."},{"type":"null"}],"description":"Replaces the item's whole variation list. Variations keep their identity by name, so re-sending the list to change one price is safe. Pass null to drop variations entirely — send `price` alongside it, otherwise the item keeps its old 'from' price."},"is_available":{"type":"boolean"},"category_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}]},"sort_order":{"type":"integer","minimum":0}},"required":["item_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/delete_item":{"post":{"operationId":"delete_item","summary":"Delete a menu item.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"item_id":{"type":"string","minLength":1}},"required":["item_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_menu":{"post":{"operationId":"update_menu","summary":"Rename a menu, change its description, or switch it on/off on the public site (is_active). Only provided fields change. Menu ids come from get_status.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"menu_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"is_active":{"type":"boolean","description":"Whether the menu is live on the public site"}},"required":["menu_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/delete_menu":{"post":{"operationId":"delete_menu","summary":"Permanently delete a menu together with ALL of its sections and items. To take a menu off the site but keep it, use update_menu is_active=false instead.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"menu_id":{"type":"string","minLength":1}},"required":["menu_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/rename_category":{"post":{"operationId":"rename_category","summary":"Rename a menu category (section).","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200,"description":"The new name"}},"required":["category_id","name"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/reorder_categories":{"post":{"operationId":"reorder_categories","summary":"Set the order of a menu's categories (sections). List category ids top to bottom; any you leave out keep their current relative order after the listed ones.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"menu_id":{"type":"string","minLength":1},"category_ids":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":200}},"required":["menu_id","category_ids"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/delete_category":{"post":{"operationId":"delete_category","summary":"Delete a menu category (section). Its items are NOT deleted — they stay on the menu without a section; move them with update_item category_id or delete them with delete_item.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"category_id":{"type":"string","minLength":1}},"required":["category_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/reorder_items":{"post":{"operationId":"reorder_items","summary":"Set the order of the items in one section of a menu. List item ids top to bottom; listed items from another section are moved into this one, and the section's other items keep their relative order after the listed ones.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"menu_id":{"type":"string","minLength":1},"category_id":{"anyOf":[{"type":"string","minLength":1},{"type":"null"}],"description":"The section being ordered; null = items without a section"},"item_ids":{"type":"array","items":{"type":"string","minLength":1},"minItems":1,"maxItems":500}},"required":["menu_id","category_id","item_ids"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_business":{"post":{"operationId":"update_business","summary":"Update a business's profile: name, description, about text, opening hours, contact info, currency, default locale, the locales visitors can switch between, menu display options, country, business details, or place (location, address, timezone, category, cuisines). Only provided fields change.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"about":{"anyOf":[{"type":"string","maxLength":10000},{"type":"null"}]},"hours":{"type":"object","properties":{"mon":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"tue":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"wed":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"thu":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"fri":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"sat":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"sun":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false}},"additionalProperties":false,"description":"Opening hours keyed mon..sun, each {\"open\":\"10:30\",\"close\":\"22:00\"} or {\"closed\":true}"},"contact_info":{"type":"object","properties":{"phone":{"type":"string","maxLength":40},"email":{"type":"string","format":"email","maxLength":254},"address":{"type":"string","maxLength":300},"instagram":{"type":"string","pattern":"^@?[A-Za-z0-9._]{1,30}$"}},"additionalProperties":false,"description":"Contact info: phone, email, address, instagram"},"currency_code":{"type":"string","minLength":3,"maxLength":3},"default_locale":{"type":"string","enum":["en","tr","es","fr","de","it","pt","nl","pl","ja","zh","ar"]},"supported_locales":{"type":"array","items":{"type":"string","enum":["en","tr","es","fr","de","it","pt","nl","pl","ja","zh","ar"]},"minItems":1,"maxItems":12,"description":"Locales visitors can switch between, e.g. [\"pl\",\"en\"]; the default locale is always included"},"menu_options":{"type":"object","properties":{"menuNotice":{"type":"string","maxLength":600},"showPriceEffectiveDate":{"type":"boolean"},"orderingExcludedTags":{"type":"array","items":{"type":"string","enum":["alcohol","pork","tobacco"]},"maxItems":3}},"additionalProperties":false,"description":"How the published menu presents itself: `menuNotice` (free text shown above the menu, in the owner's own words), `showPriceEffectiveDate`, and `orderingExcludedTags` (tags that can be listed but not ordered online, e.g. alcohol). This is the ONLY thing that changes what the site renders."},"country_code":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO 3166-1 alpha-2 country the business operates in. ADVISORY: it seeds suggested menu options (apply_country_settings) and drives check_compliance. It never changes what the site renders."},"legal_info":{"type":"object","properties":{"tradeName":{"type":"string","maxLength":300},"taxNumber":{"type":"string","maxLength":60},"registrationNumber":{"type":"string","maxLength":60},"registeredAddress":{"type":"string","maxLength":400},"contactEmail":{"type":"string","format":"email","maxLength":254},"contactPhone":{"type":"string","maxLength":40},"extra":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":60},"value":{"type":"string","minLength":1,"maxLength":200}},"required":["label","value"],"additionalProperties":false},"maxItems":10}},"additionalProperties":false,"description":"Business details published on the site when filled in: tradeName, taxNumber, registrationNumber, registeredAddress, contactEmail, contactPhone, plus `extra` label/value pairs for anything a jurisdiction names differently (a Vergi Dairesi, a US EIN). All optional."},"place":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"address":{"type":"object","properties":{"streetAddress":{"type":"string","minLength":1,"maxLength":200},"addressLocality":{"type":"string","minLength":1,"maxLength":100},"addressRegion":{"type":"string","minLength":1,"maxLength":100},"postalCode":{"type":"string","minLength":1,"maxLength":20},"addressCountry":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"timezone":{"type":"string","maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_+-]*(?:\\/[A-Za-z0-9_+-]+){0,2}$"},"category":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"cuisines":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"maxItems":6}},"additionalProperties":false,"description":"Where the business is and what kind of place it is: lat/lng; address {streetAddress, addressLocality (district), addressRegion (city or province), postalCode, addressCountry (ISO 3166-1 alpha-2)}; timezone (IANA, e.g. \"Europe/Istanbul\"); category (e.g. restaurant, cafe, bakery, bar, meyhane, fast_food, dessert_shop); up to 6 cuisines (e.g. turkish, kebab, seafood, sushi, vegan). Merged into what is stored: keys you pass replace, keys you leave out stay."},"maps_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A Google Maps, Apple Maps, Yandex or OpenStreetMap link (short share links work), or a \"lat, lng\" pair. Sets the coordinates."}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/set_theme":{"post":{"operationId":"set_theme","summary":"Switch the site to a system theme with `theme_id` (lokand-base; get_site lists them; pages, sections and settings are kept). Legacy shape: a v1 `theme_config` patch (colors, fonts, hero title/subtitle) — prefer update_theme_settings, or get_style for a whole look. Revertible with revert_last_site_change.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A system theme id from get_site (e.g. lokand-base)"},"theme_config":{"type":"object","properties":{"colors":{"type":"object","properties":{"primary":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"accent":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"bg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false},"fonts":{"type":"object","properties":{"heading":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[A-Za-z0-9 ,_\\-]+$"},"body":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[A-Za-z0-9 ,_\\-]+$"}},"additionalProperties":false},"hero":{"type":"object","properties":{"title":{"type":"string","maxLength":140},"subtitle":{"type":"string","maxLength":280}},"additionalProperties":false},"sections":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string","enum":["hero","menu","loyalty","hours","gallery","contact"]},"hidden":{"type":"boolean"}},"required":["kind"],"additionalProperties":false},"maxItems":6},"menuStyle":{"type":"string","enum":["list","cards","photos"]},"navLinks":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":30},"path":{"type":"string","minLength":1,"maxLength":60,"pattern":"^\\/[a-z0-9\\-/]*$"}},"required":["label","path"],"additionalProperties":false},"maxItems":8},"mobileNav":{"type":"string","enum":["tabs","menu"]},"v":{"type":"number","const":2},"theme":{"type":"object","properties":{"tokens":{"type":"object","properties":{"colors":{"type":"object","properties":{"primary":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"accent":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"bg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"primaryFg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"card":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"muted":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"line":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"line2":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false},"loyalty":{"type":"object","properties":{"bg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"ink":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false},"fonts":{"type":"object","properties":{"heading":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[A-Za-z0-9 ,_\\-]+$"},"body":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[A-Za-z0-9 ,_\\-]+$"},"mono":{"type":"string","minLength":1,"maxLength":80,"pattern":"^[A-Za-z0-9 ,_\\-]+$"}},"additionalProperties":false},"radius":{"type":"integer","minimum":0,"maximum":40},"radiusButton":{"type":"integer","minimum":0,"maximum":999},"heroLayout":{"type":"string","enum":["band","split","center","full"]},"serif":{"type":"boolean"},"density":{"type":"string","enum":["compact","comfortable","airy"]},"headingCase":{"type":"string","enum":["normal","upper"]},"buttonStyle":{"type":"string","enum":["solid","outline"]},"reserveKind":{"type":"string","enum":["reserve","book","order"]}},"additionalProperties":false},"customCss":{"type":"string","maxLength":8000}},"additionalProperties":false},"home":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"nav":{"type":"object","properties":{"style":{"type":"string","enum":["tabs","menu","none"]},"links":{"type":"array","items":{"type":"object","properties":{"label":{"allOf":[{"type":"string","maxLength":30},{"type":"string","minLength":1}]},"path":{"type":"string","minLength":1,"maxLength":60,"pattern":"^\\/[a-z0-9\\-/]*$"}},"required":["label","path"],"additionalProperties":false},"maxItems":8},"cta":{"type":"string","enum":["menu","order","reserve","loyalty","about","none"]}},"additionalProperties":false},"pages":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"path":{"type":"string","pattern":"^\\/[a-z0-9][a-z0-9-]{2,39}$"},"title":{"type":"string","maxLength":60},"enabled":{"type":"boolean"},"nav":{"type":"boolean"},"sections":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"hero"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"subtitle":{"type":"string","maxLength":280},"image":{"type":"string","maxLength":2048,"format":"uri"},"layout":{"type":"string","enum":["auto","band","split","center","full"]},"primaryCta":{"type":"string","enum":["menu","order","reserve","loyalty","about","none"]},"secondaryCta":{"type":"string","enum":["menu","order","reserve","loyalty","about","none"]},"showMeta":{"type":"boolean"}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"menu"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"menuIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":10},"style":{"type":"string","enum":["list","cards","photos"]},"showPrices":{"type":"boolean"},"showImages":{"type":"boolean"},"showDescriptions":{"type":"boolean"},"jumpNav":{"type":"boolean"},"search":{"type":"boolean"},"dietaryFilter":{"type":"boolean"}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"featured"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"itemIds":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":12},"count":{"type":"integer","minimum":1,"maximum":12},"showPrices":{"type":"boolean"}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"story"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":4000},"image":{"type":"string","maxLength":2048,"format":"uri"},"imagePosition":{"type":"string","enum":["left","right","top"]}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"text"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":4000},"align":{"type":"string","enum":["left","center"]}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"gallery"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"images":{"type":"array","items":{"type":"object","properties":{"url":{"type":"string","maxLength":2048,"format":"uri"},"alt":{"type":"string","maxLength":140}},"required":["url"],"additionalProperties":false},"maxItems":24},"layout":{"type":"string","enum":["grid","strip","mosaic"]}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"visit"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"showMap":{"type":"boolean"}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"hours"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"location"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"showMap":{"type":"boolean"}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"contact"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"showPhone":{"type":"boolean"},"showEmail":{"type":"boolean"},"showSocial":{"type":"boolean"}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"loyalty"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":4000}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"loyalty-card"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":4000}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"order-cta"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":4000},"links":{"type":"array","items":{"type":"object","properties":{"label":{"allOf":[{"type":"string","maxLength":40},{"type":"string","minLength":1}]},"url":{"type":"string","maxLength":2048,"format":"uri"}},"required":["label","url"],"additionalProperties":false},"maxItems":6},"showOrderOnline":{"type":"boolean"}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"team"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"members":{"type":"array","items":{"type":"object","properties":{"name":{"allOf":[{"type":"string","maxLength":80},{"type":"string","minLength":1}]},"role":{"type":"string","maxLength":80},"bio":{"type":"string","maxLength":600},"image":{"type":"string","maxLength":2048,"format":"uri"}},"required":["name"],"additionalProperties":false},"maxItems":12}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"awards"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"items":{"type":"array","items":{"type":"object","properties":{"title":{"allOf":[{"type":"string","maxLength":120},{"type":"string","minLength":1}]},"issuer":{"type":"string","maxLength":120},"year":{"type":"integer","minimum":1900,"maximum":2100}},"required":["title"],"additionalProperties":false},"maxItems":20}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"faq"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"items":{"type":"array","items":{"type":"object","properties":{"q":{"allOf":[{"type":"string","maxLength":200},{"type":"string","minLength":1}]},"a":{"allOf":[{"type":"string","maxLength":1200},{"type":"string","minLength":1}]}},"required":["q","a"],"additionalProperties":false},"maxItems":20}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"reviews"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"items":{"type":"array","items":{"type":"object","properties":{"quote":{"allOf":[{"type":"string","maxLength":600},{"type":"string","minLength":1}]},"author":{"type":"string","maxLength":80},"source":{"type":"string","maxLength":80}},"required":["quote"],"additionalProperties":false},"maxItems":12}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"reservations"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"body":{"type":"string","maxLength":4000},"url":{"type":"string","maxLength":2048,"format":"uri"},"label":{"type":"string","maxLength":40},"usePhone":{"type":"boolean"}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"social"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120},"links":{"type":"array","items":{"type":"object","properties":{"label":{"allOf":[{"type":"string","maxLength":40},{"type":"string","minLength":1}]},"url":{"type":"string","maxLength":2048,"format":"uri"}},"required":["label","url"],"additionalProperties":false},"maxItems":8}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"legal"},"settings":{"type":"object","properties":{"title":{"type":"string","maxLength":120}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false},{"type":"object","properties":{"id":{"type":"string","minLength":1,"maxLength":40,"pattern":"^[a-z0-9][a-z0-9-]*$"},"hidden":{"type":"boolean"},"kind":{"type":"string","const":"custom-html"},"settings":{"type":"object","properties":{"html":{"type":"string","maxLength":20000},"height":{"type":"integer","minimum":40,"maximum":2000}},"additionalProperties":false}},"required":["id","kind"],"additionalProperties":false}]},"maxItems":25}},"required":["id","path","enabled","sections"],"additionalProperties":false},"maxItems":12},"inheritBrand":{"type":"boolean"}},"additionalProperties":false,"description":"Legacy: merge patch such as {\"colors\":{\"primary\":\"#aa3300\"},\"fonts\":{\"heading\":\"...\"}}"}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/publish_site":{"post":{"operationId":"publish_site","summary":"Publish (or unpublish) the business's public menu site at https://<slug>.lokand.co.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"publish":{"type":"boolean","default":true,"description":"true to go live, false to take the site offline"}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/create_restaurant":{"post":{"operationId":"create_restaurant","summary":"Create a new Lokand restaurant on a customer's behalf — ONE call can produce a complete LIVE website when you pass `menu` (and optionally hours/theme). Returns working OAuth tokens (Bearer, for follow-up edit ops), the live site_url, and a claim_url. NEXT STEPS after this call: refine with add_item/update_item/set_theme if needed, then give the customer the claim_url so they take ownership (free signup); poll claim_status to keep access after they claim. Requires a client registered once via POST /api/auth/oauth2/register (see https://lokand.com/auth.md).","security":[],"description":"Authenticates with client_id + client_secret in the request body (RFC 7591 registered client).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","minLength":1,"description":"Registered OAuth client id"},"client_secret":{"type":"string","minLength":1,"description":"The client's secret"},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Restaurant name"},"slug":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{1,38}[a-z0-9])?$","description":"Optional site slug (<slug>.lokand.co); generated from the name when omitted. If taken, a suffixed variant is used automatically."},"description":{"type":"string","maxLength":2000},"menu":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"default":"Menu","description":"Menu name, e.g. \"Menu\" or \"Dinner\""},"description":{"type":"string","maxLength":2000},"categories":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Section name, e.g. \"Burgers\""},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"price":{"type":"number","minimum":0,"maximum":1000000,"description":"Price in the business's currency. Required unless `variations` is given."},"variations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"price":{"type":"number","minimum":0,"maximum":1000000}},"required":["name","price"],"additionalProperties":false},"minItems":1,"maxItems":12,"description":"Variations of this dish (sizes, volumes, portions), each with its own ABSOLUTE price — see add_item. Use instead of one item per variation."},"is_available":{"type":"boolean","default":true},"dietary_info":{"type":"object","properties":{"allergens":{"type":"array","items":{"type":"string","enum":["gluten","crustaceans","eggs","fish","peanuts","soybeans","milk","nuts","celery","mustard","sesame","sulphites","lupin","molluscs"]},"maxItems":14},"contains":{"type":"array","items":{"type":"string","enum":["alcohol","pork","tobacco"]},"maxItems":3},"suitableFor":{"type":"array","items":{"type":"string","enum":["vegetarian","vegan","halal","kosher","gluten_free","dairy_free","nut_free","spicy","organic"]},"maxItems":9},"caloriesKcal":{"type":"integer","minimum":0,"maximum":20000},"portionGrams":{"type":"integer","minimum":0,"maximum":100000},"declaredAt":{"type":"integer","exclusiveMinimum":0}},"additionalProperties":false,"description":"Allergen/dietary declaration for this dish — see add_item"}},"required":["name"],"additionalProperties":false},"maxItems":100}},"required":["name","items"],"additionalProperties":false},"minItems":1,"maxItems":50,"description":"Sections in display order; items in display order"}},"required":["categories"],"additionalProperties":false,"description":"The full menu, inline — pass this to go live in one call instead of separate create_menu/add_category/add_item calls"},"hours":{"type":"object","properties":{"mon":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"tue":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"wed":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"thu":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"fri":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"sat":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"sun":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false}},"additionalProperties":false,"description":"Opening hours keyed mon..sun, each {\"open\":\"10:30\",\"close\":\"22:00\"} or {\"closed\":true}"},"contact_info":{"type":"object","properties":{"phone":{"type":"string","maxLength":40},"email":{"type":"string","format":"email","maxLength":254},"address":{"type":"string","maxLength":300},"instagram":{"type":"string","pattern":"^@?[A-Za-z0-9._]{1,30}$"}},"additionalProperties":false,"description":"Contact info: phone, email, address, instagram"},"place":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"address":{"type":"object","properties":{"streetAddress":{"type":"string","minLength":1,"maxLength":200},"addressLocality":{"type":"string","minLength":1,"maxLength":100},"addressRegion":{"type":"string","minLength":1,"maxLength":100},"postalCode":{"type":"string","minLength":1,"maxLength":20},"addressCountry":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"timezone":{"type":"string","maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_+-]*(?:\\/[A-Za-z0-9_+-]+){0,2}$"},"category":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"cuisines":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"maxItems":6}},"additionalProperties":false,"description":"Where the business is and what kind of place it is: lat/lng; address {streetAddress, addressLocality (district), addressRegion (city or province), postalCode, addressCountry (ISO 3166-1 alpha-2)}; timezone (IANA, e.g. \"Europe/Istanbul\"); category (e.g. restaurant, cafe, bakery, bar, meyhane, fast_food, dessert_shop); up to 6 cuisines (e.g. turkish, kebab, seafood, sushi, vegan). Merged into what is stored: keys you pass replace, keys you leave out stay."},"maps_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A Google Maps, Apple Maps, Yandex or OpenStreetMap link (short share links work), or a \"lat, lng\" pair. Sets the coordinates."},"currency_code":{"type":"string","minLength":3,"maxLength":3,"description":"ISO currency for menu prices, e.g. \"USD\""},"theme":{"type":"object","properties":{"key":{"type":"string","enum":["terra","porto","noir","marche","slate"],"description":"terra | porto | noir | marche | slate"},"config":{"type":"object","additionalProperties":{},"description":"Site document: a v3 document (as get_site.document) or a legacy v2/v1 config such as {\"colors\":{\"primary\":\"#aa3300\"}}. Stored as v3."}},"required":["key"],"additionalProperties":false},"publish":{"type":"boolean","default":true,"description":"Put the site live immediately (default true). Pass false to keep it a draft."},"customer_email":{"type":"string","format":"email","description":"Customer's email: binds the claim to it and sends them the claim link"}},"required":["client_id","client_secret","name"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/create_business":{"post":{"operationId":"create_business","summary":"Create a new restaurant owned by the signed-in user (no claim step) — ONE call can produce a complete LIVE website when you pass `menu` (and optionally hours/theme). Returns the business_id for follow-up ops and the live site_url. To create a restaurant for someone else, use create_restaurant and hand them the claim link instead.","security":[{"oauth2":["onboarding:create"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"description":"Restaurant name"},"slug":{"type":"string","pattern":"^[a-z0-9](?:[a-z0-9-]{1,38}[a-z0-9])?$","description":"Optional site slug (<slug>.lokand.co); generated from the name when omitted. If taken, a suffixed variant is used automatically."},"description":{"type":"string","maxLength":2000},"menu":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"default":"Menu","description":"Menu name, e.g. \"Menu\" or \"Dinner\""},"description":{"type":"string","maxLength":2000},"categories":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100,"description":"Section name, e.g. \"Burgers\""},"items":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":100},"description":{"type":"string","maxLength":500},"price":{"type":"number","minimum":0,"maximum":1000000,"description":"Price in the business's currency. Required unless `variations` is given."},"variations":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60},"price":{"type":"number","minimum":0,"maximum":1000000}},"required":["name","price"],"additionalProperties":false},"minItems":1,"maxItems":12,"description":"Variations of this dish (sizes, volumes, portions), each with its own ABSOLUTE price — see add_item. Use instead of one item per variation."},"is_available":{"type":"boolean","default":true},"dietary_info":{"type":"object","properties":{"allergens":{"type":"array","items":{"type":"string","enum":["gluten","crustaceans","eggs","fish","peanuts","soybeans","milk","nuts","celery","mustard","sesame","sulphites","lupin","molluscs"]},"maxItems":14},"contains":{"type":"array","items":{"type":"string","enum":["alcohol","pork","tobacco"]},"maxItems":3},"suitableFor":{"type":"array","items":{"type":"string","enum":["vegetarian","vegan","halal","kosher","gluten_free","dairy_free","nut_free","spicy","organic"]},"maxItems":9},"caloriesKcal":{"type":"integer","minimum":0,"maximum":20000},"portionGrams":{"type":"integer","minimum":0,"maximum":100000},"declaredAt":{"type":"integer","exclusiveMinimum":0}},"additionalProperties":false,"description":"Allergen/dietary declaration for this dish — see add_item"}},"required":["name"],"additionalProperties":false},"maxItems":100}},"required":["name","items"],"additionalProperties":false},"minItems":1,"maxItems":50,"description":"Sections in display order; items in display order"}},"required":["categories"],"additionalProperties":false,"description":"The full menu, inline — pass this to go live in one call instead of separate create_menu/add_category/add_item calls"},"hours":{"type":"object","properties":{"mon":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"tue":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"wed":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"thu":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"fri":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"sat":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false},"sun":{"type":"object","properties":{"open":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"close":{"type":"string","pattern":"^([01]\\d|2[0-3]):[0-5]\\d$"},"closed":{"type":"boolean"}},"additionalProperties":false}},"additionalProperties":false,"description":"Opening hours keyed mon..sun, each {\"open\":\"10:30\",\"close\":\"22:00\"} or {\"closed\":true}"},"contact_info":{"type":"object","properties":{"phone":{"type":"string","maxLength":40},"email":{"type":"string","format":"email","maxLength":254},"address":{"type":"string","maxLength":300},"instagram":{"type":"string","pattern":"^@?[A-Za-z0-9._]{1,30}$"}},"additionalProperties":false,"description":"Contact info: phone, email, address, instagram"},"place":{"type":"object","properties":{"lat":{"type":"number","minimum":-90,"maximum":90},"lng":{"type":"number","minimum":-180,"maximum":180},"address":{"type":"object","properties":{"streetAddress":{"type":"string","minLength":1,"maxLength":200},"addressLocality":{"type":"string","minLength":1,"maxLength":100},"addressRegion":{"type":"string","minLength":1,"maxLength":100},"postalCode":{"type":"string","minLength":1,"maxLength":20},"addressCountry":{"type":"string","pattern":"^[A-Z]{2}$"}},"additionalProperties":false},"timezone":{"type":"string","maxLength":64,"pattern":"^[A-Za-z][A-Za-z0-9_+-]*(?:\\/[A-Za-z0-9_+-]+){0,2}$"},"category":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"cuisines":{"type":"array","items":{"type":"string","pattern":"^[a-z][a-z0-9_]{1,39}$"},"maxItems":6}},"additionalProperties":false,"description":"Where the business is and what kind of place it is: lat/lng; address {streetAddress, addressLocality (district), addressRegion (city or province), postalCode, addressCountry (ISO 3166-1 alpha-2)}; timezone (IANA, e.g. \"Europe/Istanbul\"); category (e.g. restaurant, cafe, bakery, bar, meyhane, fast_food, dessert_shop); up to 6 cuisines (e.g. turkish, kebab, seafood, sushi, vegan). Merged into what is stored: keys you pass replace, keys you leave out stay."},"maps_url":{"type":"string","minLength":1,"maxLength":2000,"description":"A Google Maps, Apple Maps, Yandex or OpenStreetMap link (short share links work), or a \"lat, lng\" pair. Sets the coordinates."},"currency_code":{"type":"string","minLength":3,"maxLength":3,"description":"ISO currency for menu prices, e.g. \"USD\""},"theme":{"type":"object","properties":{"key":{"type":"string","enum":["terra","porto","noir","marche","slate"],"description":"terra | porto | noir | marche | slate"},"config":{"type":"object","additionalProperties":{},"description":"Site document: a v3 document (as get_site.document) or a legacy v2/v1 config such as {\"colors\":{\"primary\":\"#aa3300\"}}. Stored as v3."}},"required":["key"],"additionalProperties":false},"publish":{"type":"boolean","default":true,"description":"Put the site live immediately (default true). Pass false to keep it a draft."}},"required":["name"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/claim_status":{"post":{"operationId":"claim_status","summary":"Check whether the customer has claimed an agent-created restaurant. On the first poll after a claim with consent granted, returns fresh OAuth tokens for continued management (delivered exactly once).","security":[],"description":"Authenticates with client_id + client_secret in the request body (RFC 7591 registered client).","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"client_id":{"type":"string","minLength":1,"description":"Registered OAuth client id"},"client_secret":{"type":"string","minLength":1,"description":"The client's secret"},"claim_token":{"type":"string","minLength":1}},"required":["client_id","client_secret","claim_token"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/create_checkout_link":{"post":{"operationId":"create_checkout_link","summary":"Create a Stripe Checkout link to upgrade a business to a paid plan. Hand the returned URL to the customer — anyone who opens it can pay; the plan activates automatically after payment. Pass customer_country (ISO 3166-1 alpha-2) so first-time pricing is quoted in the customer's region, not the agent's.","security":[{"oauth2":["billing:manage"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"product_key":{"type":"string","enum":["pro.monthly"],"description":"The plan to purchase (Pro is monthly-only)"},"customer_country":{"type":"string","minLength":2,"maxLength":2,"description":"Customer's ISO country code, e.g. DE"}},"required":["business_id","product_key"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/get_billing_summary":{"post":{"operationId":"get_billing_summary","summary":"Current plan, billing region, and subscription state of a business the caller manages.","security":[{"oauth2":["billing:manage"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/import_menu":{"post":{"operationId":"import_menu","summary":"Start an AI import of a restaurant's menu from the URL of its existing website. Returns an import_id to poll with import_status; when complete, call commit_import to turn the draft into a real menu.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"url":{"type":"string","format":"uri","description":"Public https URL of the site to import the menu from"}},"required":["business_id","url"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/import_status":{"post":{"operationId":"import_status","summary":"Check an AI menu import: processing, complete (draft ready to commit), or failed. `progress.found` lists what is known so far; complete responses include the draft for review.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"import_id":{"type":"string","minLength":1}},"required":["import_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/commit_import":{"post":{"operationId":"commit_import","summary":"Commit a completed AI menu import as a real menu (creates the menu, categories, and items). Returns the new menu_id.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"import_id":{"type":"string","minLength":1}},"required":["import_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/check_compliance":{"post":{"operationId":"check_compliance","summary":"Check a business's published menu against what a country's menu rules ask for — allergen and calorie declarations, price-list notices, banned surcharges, operator identity. Returns each requirement with its official sources, plus which ones the menu currently falls short of and the item ids involved. ADVISORY ONLY: it reports, it never changes the site, and it is not legal advice.","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"ISO country to check against. Defaults to the business's own country_code; pass one explicitly to check against a market the business is considering."}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/apply_country_settings":{"post":{"operationId":"apply_country_settings","summary":"Fill the business's menu display options with the values a country's rules suggest — a notice about tax-inclusive pricing, the price-effective date, ordering restrictions. These are DEFAULTS: the owner can change any of them afterwards, and nothing here is enforced.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"country":{"type":"string","pattern":"^[A-Z]{2}$","description":"Defaults to the business's own country_code."},"overwrite":{"type":"boolean","default":false,"description":"false (default) fills only options the owner hasn't set; true replaces their existing values."},"locale":{"type":"string","minLength":2,"maxLength":10,"description":"Language for any suggested copy. Defaults to the business's."}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/get_site":{"post":{"operationId":"get_site","summary":"Read the business's website: `document` (the v3 site document — settings, home, pages, and templates[page_id] → sections → blocks, with the ids every other site op needs), `theme` (what the live theme offers: every section and block type with its settings, the theme settings), `resolved_settings` (the concrete theme settings the site renders with), `live_theme` (the custom theme code in use, with its file paths, or null for a system theme), `style_hooks` (stable [data-lk=\"…\"] attributes custom_css can target on a system theme), `system_themes` (for set_system_theme) and `templates` (segment layouts for apply_template). Settings are listed compactly as \"id:type(options)\"; pass detail: \"full\" for labels and defaults. ALWAYS call this before changing the site.","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"detail":{"type":"string","enum":["compact","full"]}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_site":{"post":{"operationId":"update_site","summary":"Low-level escape hatch: apply an RFC 7386 JSON merge patch to the whole v3 site document returned by get_site.document (objects merge, null deletes a key, arrays REPLACE). Prefer the specific site ops. The result is validated against the theme before anything is saved. An outside image url in an image setting is copied into the business's media library and the setting stores our copy; if it can't be downloaded the call fails with image_fetch_failed and nothing changes.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"patch":{"type":"object","additionalProperties":{},"description":"RFC 7386 JSON merge patch on the whole theme data document"}},"required":["business_id","patch"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_theme_settings":{"post":{"operationId":"update_theme_settings","summary":"Merge-patch the theme's global settings (keys from get_site.theme.theme_settings, e.g. color_primary, font_heading, radius, custom_css). null resets a key to the theme default. An outside image url in an image setting is copied into the business's media library and the setting stores our copy; if it can't be downloaded the call fails with image_fetch_failed and nothing changes.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"settings":{"type":"object","additionalProperties":{},"description":"Merge patch on the theme's global settings"}},"required":["business_id","settings"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_theme":{"post":{"operationId":"update_theme","summary":"Legacy look op: patch v2-style `tokens` (colors, fonts, radius, hero layout, …) or set custom CSS. Prefer update_theme_settings.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"tokens":{"type":"object","additionalProperties":{},"description":"Merge patch on theme tokens: colors{primary,accent,bg,fg,primaryFg,card,muted,line,line2}, loyalty{bg,ink}, fonts{heading,body,mono}, radius, radiusButton, heroLayout, serif, density, headingCase, buttonStyle, reserveKind. null removes an override."},"custom_css":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"description":"Extra CSS; null clears it. No @import, url() or <"}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/apply_template":{"post":{"operationId":"apply_template","summary":"Rebuild the site's pages and sections from a segment template (cafe, ghost-kitchen, fine-dining, chain, bar, bakery — see get_site.templates). Replaces the page structure; hero copy and custom CSS carry over. keep_theme=true keeps the current style. Revertible with revert_last_site_change.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"template":{"type":"string","enum":["cafe","ghost-kitchen","fine-dining","chain","bar","bakery"],"description":"cafe | ghost-kitchen | fine-dining | chain | bar | bakery"},"keep_theme":{"type":"boolean","description":"Keep the current style instead of the template's (default false)"}},"required":["business_id","template"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/apply_site_preset":{"post":{"operationId":"apply_site_preset","summary":"Alias of apply_template (`preset` = template id).","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"preset":{"type":"string","enum":["cafe","ghost-kitchen","fine-dining","chain","bar","bakery"],"description":"cafe | ghost-kitchen | fine-dining | chain | bar | bakery"},"keep_theme":{"type":"boolean"}},"required":["business_id","preset"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/set_page":{"post":{"operationId":"set_page","summary":"Change one page: enable/disable it, show/hide it in the navigation, rename its title, change its path, make it the home page, or move it in the navigation. Only provided fields change. Page ids come from get_site.document.pages (built-ins: home, menu, about, loyalty).","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"page_id":{"type":"string","minLength":1,"maxLength":40,"description":"Page id, e.g. home, menu, about, loyalty"},"enabled":{"type":"boolean"},"show_in_nav":{"type":"boolean"},"title":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}]},"path":{"type":"string","maxLength":40,"description":"One segment like /wine"},"make_home":{"type":"boolean","description":"Serve this page at /"},"position":{"type":"integer","minimum":0,"maximum":60,"description":"Move the page to this position in the navigation"}},"required":["business_id","page_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/add_page":{"post":{"operationId":"add_page","summary":"Add a new page with a text section (add more with add_section). Returns the updated document, where the new page's id appears.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":60},"path":{"type":"string","maxLength":40},"position":{"type":"integer","minimum":0,"maximum":60,"description":"0-based position"}},"required":["business_id","title"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/remove_page":{"post":{"operationId":"remove_page","summary":"Remove a custom page and its sections. The home page can't be removed — make another page home first (set_page make_home).","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"page_id":{"type":"string","minLength":1,"maxLength":40,"description":"Page id, e.g. home, menu, about, loyalty"}},"required":["business_id","page_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/set_nav_links":{"post":{"operationId":"set_nav_links","summary":"Replace the navigation with custom links ([] restores the automatic page list).","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"links":{"type":"array","items":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":30},"path":{"type":"string","maxLength":80}},"required":["label","path"],"additionalProperties":false},"maxItems":8,"description":"Custom navigation; [] restores the automatic page list"}},"required":["business_id","links"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/add_section":{"post":{"operationId":"add_section","summary":"Add a section of a given `type` (keys of get_site.theme.sections) to a page, optionally from one of its presets, with a settings patch and a 0-based position (default: the end). Sections hold blocks; add them with add_block. An outside image url in an image setting is copied into the business's media library and the setting stores our copy; if it can't be downloaded the call fails with image_fetch_failed and nothing changes.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"page_id":{"type":"string","minLength":1,"maxLength":40,"description":"Page id, e.g. home, menu, about, loyalty"},"type":{"type":"string","minLength":1,"maxLength":60,"description":"Section type from get_site"},"kind":{"type":"string","minLength":1,"maxLength":60,"description":"Alias of type"},"settings":{"type":"object","additionalProperties":{},"description":"Settings as a JSON merge patch (null removes a key). get_site lists each type's settings."},"position":{"type":"integer","minimum":0,"maximum":60,"description":"0-based position"},"preset":{"type":"string","maxLength":80,"description":"Start from one of the type's presets"}},"required":["business_id","page_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_section":{"post":{"operationId":"update_section","summary":"Change one section: merge-patch its settings (null removes a key; settings: null resets them all) and/or hide/show it. Ids come from get_site.document.templates[page_id]. An outside image url in an image setting is copied into the business's media library and the setting stores our copy; if it can't be downloaded the call fails with image_fetch_failed and nothing changes.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"page_id":{"type":"string","minLength":1,"maxLength":40,"description":"Page id, e.g. home, menu, about, loyalty"},"section_id":{"type":"string","minLength":1,"maxLength":40,"description":"Section id from get_site"},"settings":{"anyOf":[{"type":"object","additionalProperties":{},"description":"Settings as a JSON merge patch (null removes a key). get_site lists each type's settings."},{"type":"null"}],"description":"Settings as a JSON merge patch (null removes a key). get_site lists each type's settings."},"hidden":{"type":"boolean"}},"required":["business_id","page_id","section_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/remove_section":{"post":{"operationId":"remove_section","summary":"Remove a section from a page. To keep it for later, hide it with update_section hidden=true instead.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"page_id":{"type":"string","minLength":1,"maxLength":40,"description":"Page id, e.g. home, menu, about, loyalty"},"section_id":{"type":"string","minLength":1,"maxLength":40,"description":"Section id from get_site"}},"required":["business_id","page_id","section_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/move_section":{"post":{"operationId":"move_section","summary":"Move a section to a 0-based position within its page.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"page_id":{"type":"string","minLength":1,"maxLength":40,"description":"Page id, e.g. home, menu, about, loyalty"},"section_id":{"type":"string","minLength":1,"maxLength":40,"description":"Section id from get_site"},"position":{"type":"integer","minimum":0,"maximum":60,"description":"0-based position"}},"required":["business_id","page_id","section_id","position"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/add_block":{"post":{"operationId":"add_block","summary":"Add a block (a repeatable piece inside a section: a link, a photo, a testimonial, …) of a `type` the section accepts (get_site.theme.sections[type].blocks). Nest it in another block with parent_block_id. An outside image url in an image setting is copied into the business's media library and the setting stores our copy; if it can't be downloaded the call fails with image_fetch_failed and nothing changes.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"page_id":{"type":"string","minLength":1,"maxLength":40,"description":"Page id, e.g. home, menu, about, loyalty"},"section_id":{"type":"string","minLength":1,"maxLength":40,"description":"Section id from get_site"},"parent_block_id":{"type":"string","minLength":1,"maxLength":40,"description":"Nest inside this block instead of the section"},"type":{"type":"string","minLength":1,"maxLength":60,"description":"Block type the section accepts (see get_site)"},"settings":{"type":"object","additionalProperties":{},"description":"Settings as a JSON merge patch (null removes a key). get_site lists each type's settings."},"position":{"type":"integer","minimum":0,"maximum":60,"description":"0-based position"},"preset":{"type":"string","maxLength":80,"description":"Start from one of the block type's presets"}},"required":["business_id","page_id","section_id","type"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_block":{"post":{"operationId":"update_block","summary":"Merge-patch one block's settings (null removes a key) and/or hide/show it. An outside image url in an image setting is copied into the business's media library and the setting stores our copy; if it can't be downloaded the call fails with image_fetch_failed and nothing changes.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"page_id":{"type":"string","minLength":1,"maxLength":40,"description":"Page id, e.g. home, menu, about, loyalty"},"section_id":{"type":"string","minLength":1,"maxLength":40,"description":"Section id from get_site"},"block_id":{"type":"string","minLength":1,"maxLength":40,"description":"Block id from get_site"},"settings":{"anyOf":[{"type":"object","additionalProperties":{},"description":"Settings as a JSON merge patch (null removes a key). get_site lists each type's settings."},{"type":"null"}],"description":"Settings as a JSON merge patch (null removes a key). get_site lists each type's settings."},"hidden":{"type":"boolean"}},"required":["business_id","page_id","section_id","block_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/move_block":{"post":{"operationId":"move_block","summary":"Move a block to a 0-based position among its siblings.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"page_id":{"type":"string","minLength":1,"maxLength":40,"description":"Page id, e.g. home, menu, about, loyalty"},"section_id":{"type":"string","minLength":1,"maxLength":40,"description":"Section id from get_site"},"block_id":{"type":"string","minLength":1,"maxLength":40,"description":"Block id from get_site"},"position":{"type":"integer","minimum":0,"maximum":60,"description":"0-based position"}},"required":["business_id","page_id","section_id","block_id","position"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/remove_block":{"post":{"operationId":"remove_block","summary":"Remove a block (and any blocks nested in it).","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"page_id":{"type":"string","minLength":1,"maxLength":40,"description":"Page id, e.g. home, menu, about, loyalty"},"section_id":{"type":"string","minLength":1,"maxLength":40,"description":"Section id from get_site"},"block_id":{"type":"string","minLength":1,"maxLength":40,"description":"Block id from get_site"}},"required":["business_id","page_id","section_id","block_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/set_featured_items":{"post":{"operationId":"set_featured_items","summary":"Choose the dishes shown in the home page's \"featured\" section, in order (menu item ids, max 12; [] lets the site pick automatically). Adds the section after the hero if the page has none.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"item_ids":{"type":"array","items":{"type":"string","minLength":1,"maxLength":64},"maxItems":12,"description":"Menu item ids, in display order; [] = automatic"},"page_id":{"type":"string","minLength":1,"maxLength":40,"description":"Defaults to the home page"}},"required":["business_id","item_ids"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/set_system_theme":{"post":{"operationId":"set_system_theme","summary":"Switch to another system theme (get_site lists `system_themes`). Pages, sections and settings are kept.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A system theme id from get_site (e.g. lokand-base)"}},"required":["business_id","theme_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/make_menu_only":{"post":{"operationId":"make_menu_only","summary":"Turn the site into a single menu page (the menu becomes the home page, every other page is disabled). Use when the owner wants \"just the menu\". Revertible with revert_last_site_change.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/set_brand_link":{"post":{"operationId":"set_brand_link","summary":"Chains only: link this location to its brand's shared site (linked=true) so it shows the brand template's pages and theme, or unlink it (linked=false) to use its own site again. Hours, address, menus and ordering always stay this location's own. The brand template is set with publish_brand_template.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"linked":{"type":"boolean","description":"true = show the brand's shared site here; false = this location's own site"}},"required":["business_id","linked"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_ticket_design":{"post":{"operationId":"update_ticket_design","summary":"Pro: change how one ticket type's tickets look (each type can differ, e.g. VIP gold, General plain). `settings` uses the theme's ticket_* settings (get_site lists them, in the Ticket group); unset values follow the theme's ticket settings, and those follow the site's colors. null resets the type. Ticket type ids come from list_events. Change the look of every ticket with update_theme_settings instead.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"ticket_type_id":{"type":"string","minLength":1,"maxLength":64,"description":"Ticket type id from list_events"},"settings":{"anyOf":[{"type":"object","additionalProperties":{},"description":"Settings as a JSON merge patch (null removes a key). get_site lists each type's settings."},{"type":"null"}],"description":"Merge patch on how this ticket type looks, using the theme's ticket_* settings; null makes it follow the theme again"}},"required":["business_id","ticket_type_id","settings"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/publish_brand_template":{"post":{"operationId":"publish_brand_template","summary":"Chains only: make this location's published site the brand template that every linked location of its organization shows (see set_brand_link). Requires brand owner/admin and the franchise plan.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/revert_last_site_change":{"post":{"operationId":"revert_last_site_change","summary":"Undo the most recent site change made through the site ops or set_theme (up to the last 10, kept for 30 days). Call repeatedly to step further back. 404 when there is nothing to undo.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_loyalty_card":{"post":{"operationId":"update_loyalty_card","summary":"Set up or change the business's loyalty stamp card program: how many stamps earn the reward, the reward text and whether the card is live. Only provided fields change; the first call must include stamps_required and reward_text. The card's look is theme settings (the card_* settings in get_site's theme settings: stamp icon, layout, pattern, finish, radius, logo and colors) — change it with update_theme_settings; card_config here is the older shape of the same thing and is applied as theme settings. The page's copy is the loyalty page's loyalty-card section (update_section). Available on every plan (up to 50 members on Free; unlimited on Pro and Business).","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"stamps_required":{"type":"integer","minimum":2,"maximum":30,"description":"Stamps needed for one reward (2-30)"},"reward_text":{"type":"string","minLength":1,"maxLength":140,"description":"What the guest gets, e.g. \"A free coffee\""},"is_active":{"type":"boolean","description":"Whether diners can join and collect stamps"},"card_config":{"anyOf":[{"type":"object","properties":{"colors":{"type":"object","properties":{"cardBg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"cardFg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"stampFilled":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"stampEmpty":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"}},"additionalProperties":false},"stampIcon":{"type":"string","enum":["star","heart","coffee","gift","leaf","smile","beer","wine","cocktail","pizza","burger","icecream"]},"headline":{"type":"string","maxLength":60},"subline":{"type":"string","maxLength":90},"layout":{"type":"string","enum":["grid","row"]},"pattern":{"type":"string","enum":["none","dots","lines","waves","checks"]},"finish":{"type":"string","enum":["matte","gloss","foil"]},"radius":{"type":"integer","minimum":0,"maximum":32},"showLogo":{"type":"boolean"},"back":{"type":"object","properties":{"bg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"fg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$"},"note":{"type":"string","maxLength":120}},"additionalProperties":false}},"additionalProperties":false},{"type":"null"}],"description":"Older shape of the card's look — colors{cardBg,cardFg,stampFilled,stampEmpty}, stampIcon, layout, pattern, finish, radius, showLogo, back{bg,fg}. Written as the site's card_* theme settings, replacing them all; null resets the card to the site's colors. Prefer update_theme_settings."}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_list":{"post":{"operationId":"theme_list","summary":"List the business's custom themes (id, name, role live|unpublished|development, version, upload status) and the system themes. Custom theme code is a Pro feature (free on every plan until 2027-01-01).","security":[{"oauth2":["theme:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_get":{"post":{"operationId":"theme_get","summary":"One theme's details and upload status: ready (the version is stored and can be published), processing (poll again in a second or two) or failed (with the error).","security":[{"oauth2":["theme:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A theme id from theme_list (or the system theme id lokand-base)"}},"required":["business_id","theme_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_pull":{"post":{"operationId":"theme_pull","summary":"Download a theme's files ({path: text}). theme_id \"lokand-base\" returns the system theme to start from. Custom themes return their latest stored version. A whole theme is large: pass search to find the lines you need to change, or list_only for paths and sizes, then paths for whole files.","security":[{"oauth2":["theme:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A theme id from theme_list (or the system theme id lokand-base)"},"list_only":{"type":"boolean","description":"Return only {path, size} for every file"},"paths":{"type":"array","items":{"type":"string","maxLength":120},"maxItems":20,"description":"Return only these files"},"search":{"type":"string","minLength":2,"maxLength":200,"description":"Case-insensitive text to find, e.g. \".menu-item .name\"; returns matching lines as {path, line, text} instead of files (combine with paths to limit where it looks)"}},"required":["business_id","theme_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_upload":{"post":{"operationId":"theme_upload","summary":"Upload a complete custom theme (Pro plan; free on every plan until 2027-01-01) as a new commit in its Git repo. Files are validated and compiled at once — a 422 lists every problem as `path: message` lines — then compiled in the background: poll theme_get until status is ready, then theme_publish. Without theme_id, role development reuses your one development theme and role unpublished creates a new theme; with theme_id it stores the next version of that theme. Updating the live theme needs allow_live: true.","security":[{"oauth2":["theme:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"files":{"type":"object","additionalProperties":{"type":"string"},"description":"Theme files by path, e.g. {\"sections/hero.liquid\": \"...\", \"config/settings_schema.json\": \"...\"}"},"name":{"type":"string","minLength":1,"maxLength":80},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A theme id from theme_list (or the system theme id lokand-base)"},"role":{"type":"string","enum":["development","unpublished"],"default":"development","description":"development = your private work-in-progress theme (one per user, replaced on each upload); unpublished = a saved theme ready to publish"},"allow_live":{"type":"boolean","description":"With the live theme's id: update the live site in place"},"message":{"type":"string","maxLength":200,"description":"Commit message"}},"required":["business_id","files"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_write_files":{"post":{"operationId":"theme_write_files","summary":"Change some files of a custom theme (Pro plan; free on every plan until 2027-01-01) as one new commit: files maps path → whole new text (null deletes), edits are find/replace changes. Read the current files with theme_pull first. Same validation and background compile as theme_upload. On the LIVE theme the change goes live automatically once compiled; theme_rollback undoes it. On the system theme id lokand-base it creates a new unpublished theme from it; pass publish: true to make that live too.","security":[{"oauth2":["theme:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A theme id from theme_list (or the system theme id lokand-base)"},"files":{"type":"object","additionalProperties":{"type":["string","null"]},"description":"path → whole new file text, or null to delete the file"},"edits":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string","maxLength":120},"find":{"type":"string","minLength":1,"maxLength":20000,"description":"Exact text that occurs once in the file"},"replace":{"type":"string","maxLength":60000}},"required":["path","find","replace"],"additionalProperties":false},"maxItems":40,"description":"Find/replace changes inside existing files. Prefer this over whole files: send only the lines that change"},"name":{"type":"string","minLength":1,"maxLength":80},"message":{"type":"string","maxLength":200,"description":"Commit message describing the change"},"publish":{"type":"boolean","description":"Go live once compiled (always the case when editing the live theme)"}},"required":["business_id","theme_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_publish":{"post":{"operationId":"theme_publish","summary":"Make a custom theme the live site's code (Pro plan; free on every plan until 2027-01-01). The previous live theme becomes unpublished and cached pages refresh. `warnings` lists parts of the current site document the new theme doesn't define (fix them with the site ops).","security":[{"oauth2":["theme:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A theme id from theme_list (or the system theme id lokand-base)"}},"required":["business_id","theme_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_unpublish":{"post":{"operationId":"theme_unpublish","summary":"Stop using custom theme code: the site goes back to its system theme. The custom theme is kept as unpublished.","security":[{"oauth2":["theme:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_delete":{"post":{"operationId":"theme_delete","summary":"Delete a custom theme and all its stored versions. The live theme can't be deleted — unpublish it first.","security":[{"oauth2":["theme:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A theme id from theme_list (or the system theme id lokand-base)"}},"required":["business_id","theme_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/get_storefront_context":{"post":{"operationId":"get_storefront_context","summary":"The exact data a theme renders with (the StorefrontData Liquid objects are built from): the business (localized, brand site applied), every active menu with items, primary menu id, loyalty/ordering flags, the stamp-card program and its resolved style — plus theme_data (the site document) and live_theme. Use it to preview or test theme code locally.","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"locale":{"type":"string","minLength":2,"maxLength":10,"description":"Defaults to the business's default locale"}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_history":{"post":{"operationId":"theme_history","summary":"The commit history of a custom theme's code, newest first: hash, message, author, time. The `commit` on theme_get is the one the site renders.","security":[{"oauth2":["theme:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A theme id from theme_list (or the system theme id lokand-base)"},"limit":{"type":"integer","minimum":1,"maximum":100}},"required":["business_id","theme_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_rollback":{"post":{"operationId":"theme_rollback","summary":"Restore a custom theme's code to an earlier commit (Pro plan; free on every plan until 2027-01-01). It is saved as a new commit, so the rollback itself can be undone; on the live theme it goes live once compiled. Without commit, restores the version before the latest change.","security":[{"oauth2":["theme:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A theme id from theme_list (or the system theme id lokand-base)"},"commit":{"type":"string","minLength":7,"maxLength":40,"description":"Commit hash from theme_history"}},"required":["business_id","theme_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_git_access":{"post":{"operationId":"theme_git_access","summary":"Git access to a custom theme's code: the HTTPS remote and a repo-scoped token (read, or write on the Pro plan; free on every plan until 2027-01-01). Pushes to main compile automatically and, for the live theme, publish once compiled; theme_get shows a push that failed to compile as push_error. Tokens expire (default 1 hour).","security":[{"oauth2":["theme:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A theme id from theme_list (or the system theme id lokand-base)"},"scope":{"type":"string","enum":["read","write"],"default":"read"},"ttl_seconds":{"type":"integer","minimum":60,"maximum":604800}},"required":["business_id","theme_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/theme_sync":{"post":{"operationId":"theme_sync","summary":"Compile the latest commit on a custom theme's main branch now (Pro plan; free on every plan until 2027-01-01). Pushes compile on their own; call this to apply a push immediately or to retry. Validates like an upload and, for the live theme, publishes once compiled. Poll theme_get for status.","security":[{"oauth2":["theme:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"theme_id":{"type":"string","minLength":1,"maxLength":80,"description":"A theme id from theme_list (or the system theme id lokand-base)"}},"required":["business_id","theme_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/list_assets":{"post":{"operationId":"list_assets","summary":"List every image the business owns: its media library (uploads, photos copied from its old website at import, photos the owner attached in chat), its logo and every menu item photo. Each entry has its url, kind, source, where it is used, width/height in pixels and size in bytes (null when unknown), and tags a vision model read off the image: subject (dish, drink, interior, exterior, people, logo, menu), what it shows, whether it matches the dish it is labelled as, quality 1-5, dominant colors and alt text. Use these urls for any site or menu image; never use an outside image.","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"kind":{"type":"string","enum":["photo","logo","any"],"description":"Only photos or only logos; default any"}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/use_asset":{"post":{"operationId":"use_asset","summary":"Put one of the business's own images (a url from list_assets) to use: as the logo (target \"logo\") or as a menu item's photo (target \"item\" with item_id). For a site section or block image, pass the same url to update_section / update_block instead.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"url":{"type":"string","format":"uri","description":"An image url from list_assets"},"target":{"type":"string","enum":["logo","item"]},"item_id":{"type":"string","minLength":1,"description":"The menu item, for target item"}},"required":["business_id","url","target"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/suggest_styles":{"post":{"operationId":"suggest_styles","summary":"Recommend looks for the business's website from Lokand's style library (14 hand-made looks, from a Michelin-style 'gastronomique' to a street 'bufe'), read from its menu, prices, logo and photos. Returns the three best fits, how bold to go (safe / distinct / bold, from how much material the business has) and why, and the whole library. Call this before a new look or a redesign, then get_style for the chosen look.","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/get_style":{"post":{"operationId":"get_style","summary":"Compile one look from the style library into the exact settings to send in ONE update_theme_settings call (palette, fonts, shape, spacing and a signature custom_css on the stable [data-lk] hooks), plus the menu section style to set, the photo to put in the home hero (hero_image, if any), how to shape the home page, the copy voice, and do / don't lists. By default it uses the logo's color when the logo has a strong one. level: safe, distinct or bold (from suggest_styles, or the owner's ask: 'bolder' / 'simpler').","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"style":{"type":"string","enum":["gastronomique","bufe","firin","ocakbasi","meyhane","esnaf","kahvalti","third-wave","pastane","burger","trattoria","sushi","cocktail-bar","fresh"]},"level":{"type":"string","enum":["safe","distinct","bold"]},"seed_color":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Lead color to build the palette from, e.g. the owner's brand color"},"use_logo_colors":{"type":"boolean","description":"Default true"}},"required":["business_id","style"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/list_tables":{"post":{"operationId":"list_tables","summary":"List the business's tables — the places that each need their own QR code for table ordering (the code tells the order which table it's from). Returns each table's name, zone, code, the short URL its QR encodes (qr_url; null until first exported) and the order page that opens.","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/create_tables":{"post":{"operationId":"create_tables","summary":"Add tables in bulk — each gets its own permanent table-ordering QR code with its name printed under it. Either pass `names` ([\"Table 1\",\"Terrace 2\"]) or `count` with an optional `prefix` (\"Table\" → \"Table 4\", \"Table 5\", … continuing after the highest existing number). Names that already exist are skipped. Follow with export_qr_codes(purpose: table_ordering) to print them.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"names":{"type":"array","items":{"type":"string","minLength":1,"maxLength":40},"minItems":1,"maxItems":100,"description":"Exact table names"},"count":{"type":"integer","minimum":1,"maximum":100,"description":"How many numbered tables to add"},"prefix":{"type":"string","minLength":1,"maxLength":36,"description":"Name before the number; default \"Table\""},"start_number":{"type":"integer","minimum":0,"maximum":9999,"description":"First number; default continues after existing ones"},"zone":{"type":"string","minLength":1,"maxLength":40,"description":"Area, e.g. \"Terrace\""}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/list_qr_codes":{"post":{"operationId":"list_qr_codes","summary":"List the business's QR codes. Every printed QR is a short link (lknd.to/<code>) whose destination can change without reprinting. role: menu (the menu QR — is_default marks the one export_qr_codes prints; extra ones are separate placements such as a window), table (one per table, opens that table's order page) or link (any other URL). Returns each code's url (what the QR encodes), where a scan goes now (destination), its all-time scans and whether it is retired (retired codes open the menu, and so do table codes while the business doesn't take orders).","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"include_retired":{"type":"boolean","description":"Default false"}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/create_qr_code":{"post":{"operationId":"create_qr_code","summary":"Create a QR code (a short link). With target_url it is a link code to that URL (Wi-Fi page, reviews, Instagram, a campaign). Without target_url it is another menu code — a separate placement (e.g. \"Window\") with its own scan count; the menu already has a default code, so only add one when the owner wants to tell placements apart. Table codes are made by create_tables. Print it with export_qr_codes(purpose: link, shortlink_ids: [code]).","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"label":{"allOf":[{"type":"string","maxLength":80},{"type":"string","minLength":1}],"description":"What it is or where it goes, e.g. \"Window\""},"target_url":{"type":"string","minLength":1,"maxLength":2048,"format":"uri","pattern":"^https?:\\/\\/","description":"http(s) URL; omit for a menu code"}},"required":["business_id","label"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_qr_code":{"post":{"operationId":"update_qr_code","summary":"Change a QR code without reprinting it. target_url re-points it (not for table codes, which always open their table). label renames it. retired: true takes it out of use — its printed QR then opens the menu, and the code stays reserved; retired: false restores it. A printed code is never deleted. Find codes with list_qr_codes.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"code":{"type":"string","minLength":1,"maxLength":64},"target_url":{"type":"string","minLength":1,"maxLength":2048,"format":"uri","pattern":"^https?:\\/\\/"},"label":{"type":"string","maxLength":80},"retired":{"type":"boolean"}},"required":["business_id","code"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/get_qr_design":{"post":{"operationId":"get_qr_design","summary":"Read how the business's printed QR codes look: colors, module and corner style, frame, call-to-action and whether the logo is in the middle.","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_qr_design":{"post":{"operationId":"update_qr_design","summary":"Change how the business's printed QR codes look. Only the fields you pass change. The code color must be darker than the background with enough contrast to scan — rejected otherwise. `reset: true` restores the default look.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"fg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Code color (dark modules)"},"bg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Background behind the code"},"module_style":{"type":"string","enum":["square","rounded","dots"],"description":"square (classic), rounded (soft, joined) or dots"},"eye_style":{"type":"string","enum":["square","rounded","circle"],"description":"Corner markers: square, rounded or circle"},"logo":{"type":"boolean","description":"Put the business logo in the middle"},"frame":{"type":"string","enum":["none","caption","card"],"description":"none (code + label only), caption (call-to-action text above the code) or card (filled color card around the code)"},"accent":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Frame color: caption text, card fill"},"cta":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"Optional text above the code, e.g. \"Scan to order\". null = none (only the name is printed)"},"show_label":{"type":"boolean","description":"Print the table's name under each per-table code (default true). Only turn off for stickers fixed to their table: on a stand that can move, an unnamed code sends orders to the wrong table"},"reset":{"type":"boolean"}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/export_qr_codes":{"post":{"operationId":"export_qr_codes","summary":"Render the business's QR codes as a printable file and return a download URL. Every code is a short link (lknd.to/<code>) the owner can re-point without reprinting. purpose: menu (one code to the menu site, repeated `copies` times), table_ordering (ONE CODE PER TABLE, each with its table name printed under it — needs tables, see create_tables) or link (its short links). format: home_pdf (sheets with cut guides on any paper: a4, a3, a5, letter, or custom with paper_width_mm and paper_height_mm; layout large=1, medium=4, small=12 per page, or size_mm for an exact code width with as many per page as fit), press_pdf (print shop: one code per page at size_mm wide, 3 mm bleed, trim box and crop marks, all vector) or svg_zip (one vector SVG per code, for a designer). Uses the saved design (get_qr_design) unless `design` overrides it for this file only.","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"purpose":{"type":"string","enum":["menu","table_ordering","link"]},"format":{"type":"string","enum":["home_pdf","press_pdf","svg_zip"],"description":"Default home_pdf"},"table_ids":{"type":"array","items":{"type":"string","minLength":1},"maxItems":500,"description":"table_ordering: which tables; default all active ones"},"shortlink_ids":{"type":"array","items":{"type":"string","minLength":1},"maxItems":200,"description":"link: which short links (default all); menu: the short link to encode"},"copies":{"type":"integer","minimum":1,"maximum":200,"description":"menu/link: copies of each code; default fills one sheet"},"layout":{"type":"string","enum":["large","medium","small"],"description":"home_pdf: default medium; ignored when size_mm is set"},"paper":{"type":"string","enum":["a4","a3","a5","letter","custom"],"description":"home_pdf: default a4"},"paper_width_mm":{"type":"number","minimum":50,"maximum":1000,"description":"home_pdf, paper custom"},"paper_height_mm":{"type":"number","minimum":50,"maximum":1000,"description":"home_pdf, paper custom"},"size_mm":{"type":"number","minimum":20,"maximum":300,"description":"Printed code width in mm. press_pdf/svg_zip: default 90. home_pdf: exact width instead of a layout"},"cut_lines":{"type":"boolean","description":"home_pdf: dashed cut guides around each code; default true"},"bleed_mm":{"type":"number","minimum":0,"maximum":10,"description":"press_pdf: default 3"},"design":{"type":"object","properties":{"fg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Code color (dark modules)"},"bg":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Background behind the code"},"module_style":{"type":"string","enum":["square","rounded","dots"],"description":"square (classic), rounded (soft, joined) or dots"},"eye_style":{"type":"string","enum":["square","rounded","circle"],"description":"Corner markers: square, rounded or circle"},"logo":{"type":"boolean","description":"Put the business logo in the middle"},"frame":{"type":"string","enum":["none","caption","card"],"description":"none (code + label only), caption (call-to-action text above the code) or card (filled color card around the code)"},"accent":{"type":"string","pattern":"^#[0-9a-fA-F]{6}$","description":"Frame color: caption text, card fill"},"cta":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"description":"Optional text above the code, e.g. \"Scan to order\". null = none (only the name is printed)"},"show_label":{"type":"boolean","description":"Print the table's name under each per-table code (default true). Only turn off for stickers fixed to their table: on a stand that can move, an unnamed code sends orders to the wrong table"}},"additionalProperties":false},"print_link":{"type":"boolean","description":"Also return print_link: a short link to forward to a print shop, opening a download page with the press PDF + SVGs and their specs (expires in 60 days). Default true for press_pdf and svg_zip"}},"required":["business_id","purpose"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/set_translations":{"post":{"operationId":"set_translations","summary":"Write translations of a business's menu into one locale: section names, dish names and descriptions, menu names, and the business name/description. Use the menu's own wording when the owner has it (e.g. a bilingual printed menu) rather than machine-translating. Fields you leave out keep their current translation. Visitors see a locale once it is in the business's supported_locales (update_business).","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"locale":{"type":"string","enum":["en","tr","es","fr","de","it","pt","nl","pl","ja","zh","ar"],"description":"Target locale, e.g. en"},"business":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"additionalProperties":false},"menus":{"type":"array","items":{"type":"object","properties":{"menu_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["menu_id"],"additionalProperties":false},"maxItems":20},"categories":{"type":"array","items":{"type":"object","properties":{"category_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200}},"required":["category_id","name"],"additionalProperties":false},"maxItems":100},"items":{"type":"array","items":{"type":"object","properties":{"item_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"type":"string","maxLength":2000}},"required":["item_id"],"additionalProperties":false},"maxItems":500}},"required":["business_id","locale"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/connect_registered_domain":{"post":{"operationId":"connect_registered_domain","summary":"STAFF ONLY. Connect a domain already registered in Lokand's registrar account to a business as its menu domain: records it as a managed domain, provisions HTTPS, and points its DNS here. Fails unless the caller is Lokand staff and an owner/admin of the business.","security":[{"oauth2":["business:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1,"description":"The business id"},"domain":{"type":"string","minLength":3,"maxLength":253,"pattern":"^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)(\\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$","description":"The registered domain, e.g. myrestaurant.com"}},"required":["business_id","domain"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/list_events":{"post":{"operationId":"list_events","summary":"List the business's events (upcoming first, then past) with their ticket types, prices, capacity, and tickets sold / checked in.","security":[{"oauth2":["menu:read"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"include_past":{"type":"boolean","description":"Also list events that already started; default false"}},"required":["business_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/create_event":{"post":{"operationId":"create_event","summary":"Create an event with its ticket types, e.g. a concert night with General and VIP tickets. Tickets are sold in person by staff (issue_tickets or the dashboard); customers see them on the site's My tickets page. Starts as a draft unless publish is true. Requires the Pro plan.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":120},"starts_at":{"type":"string","format":"date-time","description":"ISO 8601 with offset, e.g. 2026-12-31T21:00:00+03:00"},"ends_at":{"type":"string","format":"date-time","description":"ISO 8601 with offset, e.g. 2026-12-31T21:00:00+03:00"},"description":{"type":"string","maxLength":4000},"venue_name":{"type":"string","maxLength":120,"description":"Defaults to the business itself"},"venue_address":{"type":"string","maxLength":240},"image_url":{"type":"string","format":"uri"},"ticket_types":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":60,"description":"e.g. \"General\", \"VIP\""},"price":{"type":"number","minimum":0,"description":"In the business's currency; 0 for free"},"capacity":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}],"description":"How many are for sale; omit for no limit"},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"max_per_order":{"anyOf":[{"type":"integer","minimum":1,"maximum":50},{"type":"null"}]}},"required":["name","price"],"additionalProperties":false},"minItems":1,"maxItems":20},"publish":{"type":"boolean","description":"Show it on the site and open sales now; default false"}},"required":["business_id","title","starts_at","ticket_types"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/update_event":{"post":{"operationId":"update_event","summary":"Change an event's details or status (draft, published, cancelled). Only provided fields change. Cancelling keeps sold tickets on record; void them in the dashboard if you refund.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"event_id":{"type":"string","minLength":1},"title":{"type":"string","minLength":1,"maxLength":120},"starts_at":{"type":"string","format":"date-time","description":"ISO 8601 with offset, e.g. 2026-12-31T21:00:00+03:00"},"ends_at":{"anyOf":[{"type":"string","format":"date-time","description":"ISO 8601 with offset, e.g. 2026-12-31T21:00:00+03:00"},{"type":"null"}],"description":"ISO 8601 with offset, e.g. 2026-12-31T21:00:00+03:00"},"description":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}]},"venue_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]},"venue_address":{"anyOf":[{"type":"string","maxLength":240},{"type":"null"}]},"image_url":{"anyOf":[{"type":"string","format":"uri"},{"type":"null"}]},"status":{"type":"string","enum":["draft","published","cancelled"]}},"required":["business_id","event_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/set_ticket_type":{"post":{"operationId":"set_ticket_type","summary":"Add a ticket type to an event, or change one (pass ticket_type_id). Setting is_active false stops sales but keeps sold tickets valid.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"event_id":{"type":"string","minLength":1},"ticket_type_id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1,"maxLength":60},"price":{"type":"number","minimum":0},"capacity":{"anyOf":[{"type":"integer","minimum":1},{"type":"null"}]},"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"max_per_order":{"anyOf":[{"type":"integer","minimum":1,"maximum":50},{"type":"null"}]},"is_active":{"type":"boolean"}},"required":["business_id","event_id"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}},"/agent/v1/ops/issue_tickets":{"post":{"operationId":"issue_tickets","summary":"Record an in-person ticket sale and issue the tickets: which ticket types, how many, how it was paid (cash, card_terminal, other), and optionally the buyer's name, email or phone. With an email, the buyer is emailed their tickets and can sign in on the site to keep them. Returns each ticket's code. Requires the Pro plan.","security":[{"oauth2":["menu:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"business_id":{"type":"string","minLength":1},"event_id":{"type":"string","minLength":1},"lines":{"type":"array","items":{"type":"object","properties":{"ticket_type_id":{"type":"string","minLength":1},"qty":{"type":"integer","minimum":1,"maximum":50}},"required":["ticket_type_id","qty"],"additionalProperties":false},"minItems":1,"maxItems":20},"payment_method":{"type":"string","enum":["cash","card_terminal","other"]},"buyer":{"type":"object","properties":{"name":{"type":"string","maxLength":80},"email":{"type":"string","format":"email"},"phone":{"type":"string"}},"additionalProperties":false}},"required":["business_id","event_id","lines","payment_method"],"additionalProperties":false,"$schema":"http://json-schema.org/draft-07/schema#"}}}},"responses":{"200":{"description":"Success envelope: { ok: true, result: ... }","content":{"application/json":{"schema":{"type":"object","required":["ok","result"],"properties":{"ok":{"const":true},"result":{}}}}}},"400":{"description":"Invalid input"},"401":{"description":"Missing/invalid credentials"},"403":{"description":"Missing scope or not a member"},"404":{"description":"Not found"},"429":{"description":"Rate limited"}}}}}}