FleekSiteFLEEKSITE
On this section
Platform API

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.

StatusMeaning
200, 201Success. 201 on a create.
401No valid credential, where one was required.
403Authenticated, but your role on this site is too low.
404The host resolved to no site, or the record was not found.
422The 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_user cookie. 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, and owner means 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.

MethodPathAuthPurpose
GET/api/v1/sitessessionList the sites the caller owns or belongs to (super admins see all).
POST/api/v1/sitessessionCreate a site, seeded with an /index template.
GET/api/v1/sites/availablepublicCheck whether a site address is free (rate limited).
POST/api/v1/sites/newpublicSelf-serve anonymous sign-up (rate limited per IP).
GET/api/v1/sites/:uidsessionRead a site by uid (the caller needs a membership on it).
PUT/api/v1/sitesrole 5+Update the current tenant site.
DELETE/api/v1/sites/:uidowner or role 7+Delete a site.
POST/api/v1/sites/:uid/switchsessionMint 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

MethodPathAuthPurpose
GET/api/v1/postspublicList posts, with filters for type, tag, label, date and status.
GET/api/v1/posts/:uidpublicRead one post, with its author, media and variants.
POST/api/v1/postssessionCreate a post (upserts when a uid is supplied, then owner or role 3+).
PUT / PATCH/api/v1/posts/:uidowner or role 3+Update a post.
DELETE/api/v1/posts/:uidowner 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

MethodPathAuthPurpose
GET/api/v1/templatespublicList templates. Each row includes the raw body.
GET/api/v1/templates/:uidpublicRead one template, including the raw body.
POST/api/v1/templates/validatesession, role 3+Parse-check a template body. See Validate and deploy.
POST/api/v1/templatessessionCreate a template (upserts when a uid is supplied).
PUT / PATCH/api/v1/templates/:uidowner or role 3+Update a template.
DELETE/api/v1/templates/:uidowner 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

MethodPathAuthPurpose
GET/api/v1/bits, /api/v1/bits/:uidpublicList or read bits (named content snippets and key-value pairs).
POST / PUT / DELETE/api/v1/bits, /api/v1/bits/:uidrole 3+Create, update or delete a bit.
GET/api/v1/files, /api/v1/files/:uidpublicList or read file records (with stock and library variants).
POST/api/v1/filessessionCreate a file record (metadata).
PUT / DELETE/api/v1/files/:uidowner or role 2+Update or delete a file record.
GET/api/v1/comments, /api/v1/comments/:idpublicList or read comments and reviews.
POST / DELETE/api/v1/commentssessionPost a comment, or delete one you own.
GET/api/v1/redirects, /api/v1/redirects/:idpublicList or read the site's redirect rules.
POST / PUT / DELETE/api/v1/redirects, /api/v1/redirects/:idrole 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.

MethodPathAuthPurpose
POST/api/v1/leadspublicSubmit a lead or enquiry. Fires the lead_received hook and the lead webhook.
GET/api/v1/leadsrole 3+List every lead on the site (personal data).
GET/api/v1/leads/:uidsubmitter or role 3+Read one lead (personal data).
PUT / PATCH/api/v1/leads/:uidsubmitter or role 3+Update a lead's status or data.
DELETE/api/v1/leads/:uidsubmitter 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.

MethodPathAuthPurpose
GET/api/v1/variants, /api/v1/variants/:postUidpublicSearch variants, or list a product's variants.
POST/api/v1/variants/check_stockpublicCheck stock for a set of variant ids.
POST / PUT / DELETE/api/v1/variants, /api/v1/variants/:idowner or role 2+Create, update or delete a variant (sold variants are protected).
GET/api/v1/options/:postUid, /api/v1/attributes/:variantIdpublicRead a product's options and a variant's attributes.
GET/api/v1/ordersrole 3+List every order on the site (addresses, so personal data).
GET/api/v1/orders/minesessionThe caller's own orders.
GET/api/v1/orders/:uidbuyer, seller or role 2+Read one order.
PUT / PATCH/api/v1/orders/:uidrole 3+Update an order's status, address or tracking.
GET / POST/api/v1/cart/session, /api/v1/cart/session/:idpublicCreate or read an anonymous cart.
GET / POST/api/v1/cartsessionRead or upsert the signed-in caller's cart.
POST/api/v1/discounts/quotepublicPrice a discount code against a bag of items (rate limited). Quote only.
GET/api/v1/subscriptionsrole 3+List the site's subscriptions.
GET/api/v1/subscriptions/minesessionThe caller's own subscriptions.
POST/api/v1/subscriptions/:uid/cancelowner 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.

MethodPathAuthPurpose
GET/manifest.jsonpublicThe web app manifest (your template wins, else generated).
GET/sw.jspublicThe service worker.
GET/favicon.icopublicThe favicon, resolved from favicon then logo.
GET/robots.txtpublicA custom or generated robots file.
GET/sitemap.xml, /sitemap.txtpublicTemplates and published posts as a sitemap.
GET/rss.xmlpublicAn 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.

MethodPathAuthPurpose
GET/api/v1/runtime/manifestpublicThe tags, filters, objects, hooks and limits the runtime supports. See The runtime manifest.
POST/api/v1/templates/validatesession, role 3+Parse a template body and return syntax errors. See Validate and deploy.
GET / POST / PATCH / DELETE/api/v1/plugins, /api/v1/plugins/:uidrole 3+Manage site plugins and read invocation logs. See Plugins.
GET / PUT / POST/api/v1/webhooks, /api/v1/webhooks/testrole 3+Configure and test the outbound lead and post webhook slots.
POST/api/v1/storage/presignrole 3+Get a presigned upload URL, confined to the site's own keys.
GET/api/v1/analyticssessionSite analytics (a role below 3 is scoped to the caller's own posts).
GET/api/v1/logsrole 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.