The HTTP API.
FleekSite exposes a JSON HTTP API under a single base path. This page maps the surface: the request and response envelope, and every endpoint group with the access it needs, from the public content reads a theme calls to the role-gated endpoints that manage a site.
The API is the same runtime that renders your pages, so what a template can read, a request can usually read too. Most content reads are public. Everything that writes, and everything that returns personal data, is behind a credential and often a role. This page is the map; Authentication and roles covers how you sign a request and what each role may do.
The request and response model
Every JSON endpoint lives under the base path /api/v1, addressed on your own site host, for example https://your-site.fleeksite.com/api/v1/posts. The host resolves the tenant: a request always acts on the site whose address it was sent to. A handful of theme-facing endpoints (the PWA and SEO files below) sit at the site root instead, not under /api/v1.
Responses share one envelope. The top-level state says how it went, and the payload sits under data:
{ "data": { "item": { "uid": "a1b2c3", "title": "Home" } }, "state": "ok" }A list endpoint returns its rows under data.items with a data.pagination block:
{ "data": { "items": [], "pagination": { "page": 1, "page_size": 20, "total_entries": 42, "more": true, "next_page": 2 } }, "state": "ok" }An error carries a human-readable message at data.text:
{ "data": { "text": "Item Not Found" }, "state": "error" }A few older handlers vary the envelope: state can be success (some auth and lead responses) or occasionally info, and a few write handlers put the payload under result rather than data, so an error message may read from result.text. Read state first, then look under both data and result. Key order in the raw JSON is data before state, which is cosmetic.
| Status | Meaning |
|---|---|
200, 201 | Success. 201 on a create. |
401 | No valid credential, where one was required. |
403 | Authenticated, but your role on this site is too low. |
404 | The host resolved to no site, or the record was not found. |
422 | The request was understood but rejected (validation). |
Access levels
The auth column in every table below uses three levels. They are enforced per handler, not per prefix, so two endpoints on the same resource can differ.
- Public. No credential. The tenant site is still resolved from the host, but no user is needed. Safe to call from a browser or a theme.
- Session. Any authenticated user. Send the bearer token from login, or rely on the
current_usercookie. See Authentication and roles. - Role. A per-site membership role at or above a threshold. In the tables,
role 3+means a membership role of 3 or higher on the site being addressed, andownermeans the caller created the record in question.
Roles are numbered 1 customer, 2 writer, 3 marketer, 4 designer, 5 admin, 7 super admin. A role is always scoped to one site: a token minted on another site grants nothing here unless the same person also has a membership on this site. The roles page lists what each tier may do.
Site data
The site record itself, and the sign-up endpoints that create one. Membership is resolved on the target site, so a caller cannot act on a site they do not belong to.
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /api/v1/sites | session | List the sites the caller owns or belongs to (super admins see all). |
| POST | /api/v1/sites | session | Create a site, seeded with an /index template. |
| GET | /api/v1/sites/available | public | Check whether a site address is free (rate limited). |
| POST | /api/v1/sites/new | public | Self-serve anonymous sign-up (rate limited per IP). |
| GET | /api/v1/sites/:uid | session | Read a site by uid (the caller needs a membership on it). |
| PUT | /api/v1/sites | role 5+ | Update the current tenant site. |
| DELETE | /api/v1/sites/:uid | owner or role 7+ | Delete a site. |
| POST | /api/v1/sites/:uid/switch | session | Mint a token scoped to another of the caller's sites. |
Content
The content resources a theme reads and an editor writes: posts, templates, bits, files, comments and redirects. Reads are public; writes take a credential, and most take a role.
Posts
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /api/v1/posts | public | List posts, with filters for type, tag, label, date and status. |
| GET | /api/v1/posts/:uid | public | Read one post, with its author, media and variants. |
| POST | /api/v1/posts | session | Create a post (upserts when a uid is supplied, then owner or role 3+). |
| PUT / PATCH | /api/v1/posts/:uid | owner or role 3+ | Update a post. |
| DELETE | /api/v1/posts/:uid | owner or role 3+ | Soft-delete a post. |
The post list has no default status filter. GET /api/v1/posts returns every non-deleted post of any status, drafts included, unless you pass ?status=. To list only published posts, ask for ?status=1 explicitly. This matters most on a public page that reads posts through the API: without a status filter, a draft can surface.
Templates
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /api/v1/templates | public | List templates. Each row includes the raw body. |
| GET | /api/v1/templates/:uid | public | Read one template, including the raw body. |
| POST | /api/v1/templates/validate | session, role 3+ | Parse-check a template body. See Validate and deploy. |
| POST | /api/v1/templates | session | Create a template (upserts when a uid is supplied). |
| PUT / PATCH | /api/v1/templates/:uid | owner or role 3+ | Update a template. |
| DELETE | /api/v1/templates/:uid | owner or role 3+ | Soft-delete a template. |
Template source is world-readable through the API. The template list and single-template reads are public and return the raw body, which is your theme source: the Liquid, CSS and JS of every template. Anyone who can reach the site can read it. Treat template source as public, and never place a secret, key or token in a template body.
Bits, files, comments and redirects
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /api/v1/bits, /api/v1/bits/:uid | public | List or read bits (named content snippets and key-value pairs). |
| POST / PUT / DELETE | /api/v1/bits, /api/v1/bits/:uid | role 3+ | Create, update or delete a bit. |
| GET | /api/v1/files, /api/v1/files/:uid | public | List or read file records (with stock and library variants). |
| POST | /api/v1/files | session | Create a file record (metadata). |
| PUT / DELETE | /api/v1/files/:uid | owner or role 2+ | Update or delete a file record. |
| GET | /api/v1/comments, /api/v1/comments/:id | public | List or read comments and reviews. |
| POST / DELETE | /api/v1/comments | session | Post a comment, or delete one you own. |
| GET | /api/v1/redirects, /api/v1/redirects/:id | public | List or read the site's redirect rules. |
| POST / PUT / DELETE | /api/v1/redirects, /api/v1/redirects/:id | role 3+ | Manage redirect rules. |
Leads and personal data
Lead submission is public, so a contact form on any page can post to it. Reading leads back is not: the records carry the submitter's personal data.
| Method | Path | Auth | Purpose |
|---|---|---|---|
| POST | /api/v1/leads | public | Submit a lead or enquiry. Fires the lead_received hook and the lead webhook. |
| GET | /api/v1/leads | role 3+ | List every lead on the site (personal data). |
| GET | /api/v1/leads/:uid | submitter or role 3+ | Read one lead (personal data). |
| PUT / PATCH | /api/v1/leads/:uid | submitter or role 3+ | Update a lead's status or data. |
| DELETE | /api/v1/leads/:uid | submitter or role 3+ | Soft-delete a lead. |
Endpoints that return personal data are gated. Leads, orders and site users carry names, emails, phone numbers and addresses. Their listings need a role: GET /api/v1/leads and GET /api/v1/orders require role 3+, and GET /api/v1/users requires role 2+. Single-record reads still require authentication and an access check. None of this data appears on the public read endpoints.
Commerce
The storefront resources: product variants and their options and attributes, orders, carts, discounts and subscriptions. Catalogue reads are public so a storefront can price and display products; writes and customer records are gated.
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /api/v1/variants, /api/v1/variants/:postUid | public | Search variants, or list a product's variants. |
| POST | /api/v1/variants/check_stock | public | Check stock for a set of variant ids. |
| POST / PUT / DELETE | /api/v1/variants, /api/v1/variants/:id | owner or role 2+ | Create, update or delete a variant (sold variants are protected). |
| GET | /api/v1/options/:postUid, /api/v1/attributes/:variantId | public | Read a product's options and a variant's attributes. |
| GET | /api/v1/orders | role 3+ | List every order on the site (addresses, so personal data). |
| GET | /api/v1/orders/mine | session | The caller's own orders. |
| GET | /api/v1/orders/:uid | buyer, seller or role 2+ | Read one order. |
| PUT / PATCH | /api/v1/orders/:uid | role 3+ | Update an order's status, address or tracking. |
| GET / POST | /api/v1/cart/session, /api/v1/cart/session/:id | public | Create or read an anonymous cart. |
| GET / POST | /api/v1/cart | session | Read or upsert the signed-in caller's cart. |
| POST | /api/v1/discounts/quote | public | Price a discount code against a bag of items (rate limited). Quote only. |
| GET | /api/v1/subscriptions | role 3+ | List the site's subscriptions. |
| GET | /api/v1/subscriptions/mine | session | The caller's own subscriptions. |
| POST | /api/v1/subscriptions/:uid/cancel | owner or role 5+ | Cancel a subscription. |
Checkout and the inbound payment webhooks sit under the /payments prefix, not /api/v1. POST /payments/checkout is public so guests can buy; the provider webhooks under /payments/webhooks/ verify a provider signature rather than a user credential.
PWA and SEO
These are theme-facing files, served from the site root and rendered from your templates when you supply one, else generated. They are all public GETs and none of them live under /api/v1. See PWA and push and SEO and meta for how each one is built.
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /manifest.json | public | The web app manifest (your template wins, else generated). |
| GET | /sw.js | public | The service worker. |
| GET | /favicon.ico | public | The favicon, resolved from favicon then logo. |
| GET | /robots.txt | public | A custom or generated robots file. |
| GET | /sitemap.xml, /sitemap.txt | public | Templates and published posts as a sitemap. |
| GET | /rss.xml | public | An RSS feed of published posts, with a ?label= filter. |
Runtime and management
The developer and editor endpoints: the runtime manifest that drives the editor, server-side template validation, plugin and webhook management, storage and logs. The manifest is public; the rest need a role, because they change how the site runs.
| Method | Path | Auth | Purpose |
|---|---|---|---|
| GET | /api/v1/runtime/manifest | public | The tags, filters, objects, hooks and limits the runtime supports. See The runtime manifest. |
| POST | /api/v1/templates/validate | session, role 3+ | Parse a template body and return syntax errors. See Validate and deploy. |
| GET / POST / PATCH / DELETE | /api/v1/plugins, /api/v1/plugins/:uid | role 3+ | Manage site plugins and read invocation logs. See Plugins. |
| GET / PUT / POST | /api/v1/webhooks, /api/v1/webhooks/test | role 3+ | Configure and test the outbound lead and post webhook slots. |
| POST | /api/v1/storage/presign | role 3+ | Get a presigned upload URL, confined to the site's own keys. |
| GET | /api/v1/analytics | session | Site analytics (a role below 3 is scoped to the caller's own posts). |
| GET | /api/v1/logs | role 3+ | Activity and integration logs. |
The runtime manifest is site-independent: it describes the template language and plugin taxonomy, which are identical for every site, so it carries no site data and needs no credential. Fetch it once and cache it. The runtime manifest documents every key it returns.
To sign a request and understand what each role may do, continue to Authentication and roles. To validate and ship a template change, see Validate and deploy.