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 key

Before you start

  • Connect. REST: https://<host>/api/v1/ with the header Authorization: Bearer <API key>. MCP: https://<host>/api/v1/mcp/ with the same key; tools are named escalateflow_<tool>_<action> and every one takes project_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/ and GET …/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.

  1. 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 with POST …/locales/), the theme (PATCH …/theme/: colors, typography, spacing, buttons — or start from a preset with POST …/theme/apply-preset/), the logo and favicon (logo_url, favicon_url in settings/), 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> in global_head_html, PUT …/chrome/), the header and footer (PUT …/navbar/, PUT …/footer/) and the navigation (PUT …/navigation/).
  2. 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) with POST …/legal/ and the business details (business_name, tax_id, address, email are required). They are linked in the footer, and the cookie banner links to them. A link with href="#ef-consent", for example in a custom footer, reopens the cookie preferences.
  3. 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 own meta_title and meta_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 are is_standalone: true (served at /lp/<slug>/).
  4. Media. Upload images to the media library (POST …/media/upload/) with alt_text, and use the returned url in the pages.
  5. Forms. Create the contact (or lead) form (POST …/forms/, fields with …/fields/; select/checkbox fields need options) and put it on the page ([FORM:uuid] or a form block). See Forms.
  6. 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 until PUT …/blog/settings/ {"is_enabled": true}.
  7. 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 in global_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 alt text describing it (empty alt="" 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 Deprecation header (for example styles/, projects/list/, settings/seo/): use the replacement named in their Link header. They are removed on 2026-12-14.

Check the result

  • Open the public URL (the website's primary_url plus each page's full_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.xml lists the published pages and /robots.txt is 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 and POST …/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, PUT the saved config (it replaces) or POST …/theme/reset/ for the defaults.
  • Unpublish instead of delete: status: "draft".

Frequent mistakes

MistakeDo 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 colorPUT 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 pagePUT …/navigation/ (or POST …/navigation/regenerate/) and the global navbar/
Analytics or pixel snippets pasted into pagestracking in PUT …/settings/ (GA4, GTM, Meta, TikTok IDs); consent with consent_mode
A per-page Open Graph imageThere is one site-wide og_image_url; per page you set meta_title and meta_description
Images without alt or several H1sOne H1 per page; alt on every content image
Leaving pages in draftPublish (status: "published") and open the public URL
Creating a second website or duplicate pagesList 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 urlEach item is {"label", "path", "children"}
Expecting the theme font to load by itselfThe theme sets the font name; load the web font with a <link> in global_head_html
Mixing html and blocks on one pageA page with blocks shows only its blocks; put raw markup in an html block
Calling a deprecated routeUse the route in its Link: rel="successor-version" header