Best practices for agents
Read this first. It is the method: global settings first, then SEO and tags, then pages built from the theme, then media, forms, publish and check.
Get your API keyBefore you start
- Connect. REST:
https://<host>/api/v1/with the headerAuthorization: Bearer <API key>. MCP:https://<host>/api/v1/mcp/with the same key; tools are namedescalateflow_<tool>_<action>and every one takesproject_id. See Agent & MCP. - The key gives write access to the user's websites. Never print it, store it in a page, a script or a commit, or send it anywhere other than the EscalateFlow API.
- Read before you write.
GET /api/v1/projects/lists the websites;GET …/pages/,GET …/theme/,GET …/settings/andGET …/navigation/show what already exists. Change what is there instead of creating duplicates. - Never delete pages, posts, products, forms or submissions unless the user asked for it. Unpublish (
status: "draft") instead when in doubt. - The website's public address is its
primary_url(GET /api/v1/projects/); do not build it from the docs' examples (their addresses are only examples). - Every docs page is also available as Markdown (
/developers/<page>.md); the index is /llms.txt.
Order of work
Build from the outside in: what every page shares first, the pages last. Each step links to its reference on Settings, SEO & tags.
- Project and global settings. Create or pick the website (
POST /api/v1/projects/or an existing one). Set the language (PUT …/settings/default_language; more languages withPOST …/locales/), the theme (PATCH …/theme/: colors, typography, spacing, buttons — or start from a preset withPOST …/theme/apply-preset/), the logo and favicon (logo_url,favicon_urlinsettings/), the website name (PATCH /api/v1/projects/{id}/{"name"}; it is not a setting), web fonts (the theme only names the font: load a web font such as Google Fonts with a<link>inglobal_head_html,PUT …/chrome/), the header and footer (PUT …/navbar/,PUT …/footer/) and the navigation (PUT …/navigation/). - SEO and tags. Default title suffix and description, Open Graph image, sitemap and robots (
PUT …/settings/), and the measurement tags the user already has: GA4, GTM, Meta pixel, TikTok pixel, search-console verification (PUT …/settings/tracking), plus the cookie consent mode when tags are present (consent_mode: "required"). Create the legal pages (privacy, cookies, terms, legal notice) withPOST …/legal/and the business details (business_name,tax_id,address,emailare required). They are linked in the footer, and the cookie banner links to them. A link withhref="#ef-consent", for example in a custom footer, reopens the cookie preferences. - Pages from blocks. Home, services or products, about, contact… with
POST …/pages/and…/pages/{id}/blocks/(block types:GET /api/v1/block-types/; templates:GET /api/v1/templates/). Each page gets its ownmeta_titleandmeta_description. Use a page template (…/page-templates/, a layout with[content]) when several pages share the same frame. Ads/campaign landings that must not appear in the menu or the sitemap areis_standalone: true(served at/lp/<slug>/). - Media. Upload images to the media library (
POST …/media/upload/) withalt_text, and use the returnedurlin the pages. - Forms. Create the contact (or lead) form (
POST …/forms/, fields with…/fields/;select/checkboxfields needoptions) and put it on the page ([FORM:uuid]or aformblock). See Forms. - Publish. Pages are published by default (
"status": "draft"keeps one private). Blog posts are drafts by default: send"status": "published". The blog itself is off untilPUT …/blog/settings/ {"is_enabled": true}. - Check the public site (next section) and report: public URL, what you did, what you decided on your own and the recommended next step.
Rules
- The theme, not loose styles. Colors, fonts, spacing and buttons live in
theme/and reach every page as CSS variables (var(--brand-primary), …). Never hard-code a color or font in one page's HTML when the theme has it: a later theme change would not reach that page. Site-wide extra CSS goes inglobal_css(PUT …/chrome/), not repeated per page. - Reuse. The header, footer and navigation are global (
navbar/,footer/,navigation/); never paste a header or footer into a page. Shared layouts are page templates. Prefer blocks of the catalogue over one big HTML string: blocks can be edited one by one. - One H1 per page, then H2/H3 in order. The H1 says what the page is about.
- Every image has
alttext describing it (emptyalt=""only for purely decorative images). Set it in the library too (alt_text). - Performance. Upload images at the size they are shown (not 4000 px for a 600 px slot), prefer WebP/JPEG, and add no script the page does not need. Tracking goes through
tracking, not hand-written snippets. - Accessibility. Enough contrast between text and background, labels on form fields, links that say where they go, buttons that are
<button>or<a>. - Languages. One language per page. For a multilingual site add locales (
…/locales/) and create translations (POST …/pages/{id}/translations/) instead of mixing languages on one page. - Standard routes only. Some old routes still answer with a
Deprecationheader (for examplestyles/,projects/list/,settings/seo/): use the replacement named in theirLinkheader. They are removed on 2026-12-14.
Check the result
- Open the public URL (the website's
primary_urlplus each page'sfull_path). Saving a page, the theme, the settings, the header or the footer clears the cached copies automatically: the next load shows the change. - Desktop and mobile. Look at the page at a phone width too (about 390 px): navigation menu, images and text must fit without horizontal scrolling.
- No errors. Every page answers 200, the links of the navigation work,
/sitemap.xmllists the published pages and/robots.txtis what you expect. - The form works. A submission sent from a script (curl) arrives but is flagged by the anti-spam and hidden from the default list: see it with
GET …/submissions/?form_id=…&is_bot=true. Never try to disguise a script as a browser to get past the anti-spam. A real lead comes from a browser on the public page; ask the user to send one if you cannot. - Numbers.
GET …/analytics/summary/gives the same visits and leads as the dashboard.
Undo
- Pages keep versions.
GET …/pages/{id}/versions/lists them (newest first),GET …/versions/diff/?a=&b=compares two andPOST …/pages/{id}/versions/{version_id}/restore/brings one back. Blog posts, forms and products have the same endpoints. - Theme.
GET …/theme/before changing it; to go back,PUTthe saved config (it replaces) orPOST …/theme/reset/for the defaults. - Unpublish instead of delete:
status: "draft".
Frequent mistakes
| Mistake | Do instead |
|---|---|
| Styling each page by hand (inline colors and fonts) | Set the theme once (PATCH …/theme/) and use its CSS variables |
PUT …/theme/ to change one color | PUT replaces the whole theme; use PATCH to merge |
PATCH …/settings/ | Settings take PUT, and a PUT with only some fields changes only those fields |
| Pasting the menu into every page | PUT …/navigation/ (or POST …/navigation/regenerate/) and the global navbar/ |
| Analytics or pixel snippets pasted into pages | tracking in PUT …/settings/ (GA4, GTM, Meta, TikTok IDs); consent with consent_mode |
| A per-page Open Graph image | There is one site-wide og_image_url; per page you set meta_title and meta_description |
Images without alt or several H1s | One H1 per page; alt on every content image |
Leaving pages in draft | Publish (status: "published") and open the public URL |
| Creating a second website or duplicate pages | List first (GET …/projects/, GET …/pages/) and update |
Renaming the website with PUT …/settings/ {"name"} (400 "Unknown field") | PATCH /api/v1/projects/{id}/ {"name"} |
Navigation items with url | Each item is {"label", "path", "children"} |
| Expecting the theme font to load by itself | The theme sets the font name; load the web font with a <link> in global_head_html |
Mixing html and blocks on one page | A page with blocks shows only its blocks; put raw markup in an html block |
| Calling a deprecated route | Use the route in its Link: rel="successor-version" header |