# Lynkow Docs > Official Lynkow documentation: integration guides, REST API reference (Admin and Storefront), TypeScript SDK, plugins, and operational guides for the Lynkow headless CMS. Optimized for agent and LLM consumption with Markdown counterparts at /.md or via Accept: text/markdown. ## Search This site has a full-text search API with typo tolerance. Instead of reading all the content below, you can search for specific topics. **Endpoint:** ``` GET https://search.lynkow.com/storefront/c3bc8a0a-7820-4945-b174-5c9328b98719/search?q={query} ``` **Parameters:** `q` (required), `locale`, `category` (slug), `tag` (slug), `page`, `limit` (max 100) **Example:** ``` GET https://search.lynkow.com/storefront/c3bc8a0a-7820-4945-b174-5c9328b98719/search?q=getting+started&limit=5 ``` Returns `{ data: [{ id, title, slug, path, excerpt, categories, tags, publishedAt }], meta: { total, page, totalPages, query, processingTimeMs } }` --- # Pages & Site Configuration **Publié le** : 2026-11-30 **Catégorie** : Features > **Reference** - This guide is a tutorial. For exhaustive, always-current signatures and field lists, see the auto-generated reference: > > - SDK: [`PagesService`](/sdk/services/sdk-pages-service), [`BlocksService`](/sdk/services/sdk-blocks-service), [`SiteService`](/sdk/services/sdk-site-service) > - Types: [SDK Types](/sdk/types) > - API: [Storefront: Pages](/storefront-api/storefront-pages) ## Prerequisites - A Next.js App Router project with the SDK client in `lib/lynkow.ts` ([Add Lynkow to an Existing Project](/sdk/getting-started/existing-project)). - At least one global block (a header, for example) and one page published in your Lynkow site. ## Layout from global blocks `lynkow.globals.siteConfig()` returns the site's name and favicon, and every published global block keyed by its slug, in one request. `lynkow.globals` and `lynkow.blocks` are the same service. ```tsx // app/layout.tsx import { lynkow } from '@/lib/lynkow' import { Header } from '@/components/header' export default async function RootLayout({ children }: { children: React.ReactNode }) { const { data } = await lynkow.globals.siteConfig() const header = data.globals['header'] // the block whose slug is "header" return ( {data.site.favicon && } {header &&
}
{children}
) } ``` A block's `data` follows the schema you gave the block in the admin. Type it for your own schema. This header reads a `logo` and a `navigation` list: ```tsx // components/header.tsx import Link from 'next/link' interface HeaderData { logo?: { url: string; alt: string } | null navigation?: Array<{ label: string; url: string }> } export function Header({ data, siteName }: { data: Record; siteName: string }) { const { logo, navigation } = data as unknown as HeaderData return (
{logo ? {logo.alt : siteName}
) } ``` A footer follows the same pattern with `data.globals['footer']`. To read one block outside the layout, call `lynkow.globals.getBySlug('footer')`, which answers `{ data: GlobalBlock }`. ### On a multi-language site Pass the route's locale to `siteConfig()` to read the blocks in that language. `data.site` is not translated: take the localized name, description and logo from `lynkow.site.getConfig()`. ```tsx const [{ data }, site] = await Promise.all([ lynkow.globals.siteConfig({ locale }), lynkow.site.getConfig({ locale }), ]) //
``` Locale routing and the fallback a missing translation gets are covered in [Multi-language (i18n)](/sdk/features/i18n). ## Render a page by URL `pages.getByPath()` finds the page published at a URL path, nested paths included (`/services/consulting`). It returns one of two answers: - a `Page`, with its `data`, `seo`, `alternates` and `structuredData`; - a redirect answer, when a redirect covers the path and no page holds it. Narrow it with `isRedirectResponse()` before reading a page field. It throws a `LynkowError` with code `NOT_FOUND` when neither exists. ```tsx // app/[[...slug]]/page.tsx import type { Metadata } from 'next' import { notFound, permanentRedirect, redirect } from 'next/navigation' import { isLynkowError, isRedirectResponse, renderJsonLdGraph } from 'lynkow' import { lynkow } from '@/lib/lynkow' import { PageRenderer } from '@/components/page-renderer' type Params = Promise<{ slug?: string[] }> const SITE_ORIGIN = new URL(process.env.NEXT_PUBLIC_SITE_URL!).origin const pathOf = (url: string) => new URL(url, SITE_ORIGIN).pathname.replace(/\/+$/, '') || '/' async function getPage(slug: string[] = []) { const path = `/${slug.join('/')}` try { const page = await lynkow.pages.getByPath(path) if (isRedirectResponse(page)) { const { target, statusCode } = page.redirect // A rule can point a path back at itself (`/*` to `/*`): answer 404 instead of looping if (new URL(target, SITE_ORIGIN).origin === SITE_ORIGIN && pathOf(target) === pathOf(path)) notFound() // Next.js answers 308 or 307; it cannot send 301 or 302 from a page if (statusCode === 301 || statusCode === 308) permanentRedirect(target) redirect(target) } return page } catch (error) { // redirect() throws too: anything that is not a LynkowError is rethrown if (isLynkowError(error) && error.code === 'NOT_FOUND') notFound() throw error } } export async function generateStaticParams() { const { data: pages } = await lynkow.pages.list() return pages.map((page) => ({ // The home page ("/") takes no segment slug: page.publicPath === '/' ? undefined : page.publicPath.split('/').filter(Boolean), })) } export async function generateMetadata({ params }: { params: Params }): Promise { const { seo } = await getPage((await params).slug) if (!seo) return {} return { title: seo.metaTitle, description: seo.metaDescription, openGraph: { images: seo.ogImage ? [{ url: seo.ogImage.url }] : undefined }, alternates: { canonical: seo.canonicalUrl }, robots: seo.noIndex ? { index: false } : undefined, } } export default async function Page({ params }: { params: Params }) { const page = await getPage((await params).slug) return ( <> {/* The page's schema.org graph, as one escaped ``` Outside the dashboard's preview frame, `startVisualEditor` does nothing. Inside it, each change is written into the page as it is typed. In a React island, `Editable` and `EditableBlock` from `@lynkow/astro/react` write the same markers, and `useLynkowField` and `useBlockData` follow the editor without a provider. See [Visual Editor](/sdk/advanced/visual-editor) for the field types. ## Environment variables | Variable | Scope | Purpose | | --- | --- | --- | | `PUBLIC_LYNKOW_SITE_ID` | Public | The site's UUID. Required | | `PUBLIC_SITE_URL` | Public | The origin the site is served from, with no trailing slash. Required | | `PUBLIC_LOCALES`, `PUBLIC_DEFAULT_LOCALE` | Public | Pin the languages instead of reading them from Lynkow | | `PUBLIC_LYNKOW_API_URL` | Public | The API origin, for a non-default environment | | `PUBLIC_LYNKOW_PUBLISHABLE_KEY` | Public | The site's publishable key (`lkw_pk_...`), needed by the store | | `PUBLIC_LYNKOW_CHECKOUT_MODE` | Public | `embedded` (default) or `hosted`: where the card payment form appears | | `PUBLIC_LYNKOW_CDN_HOST` | Public | The host Lynkow media resolves to | | `LYNKOW_WEBHOOK_SECRET` | Server only | Verifies the revalidation webhook | | `LYNKOW_SERVER_KEY` | Server only | Forwards the buyer's IP on writes | | `LYNKOW_CLIENT_IP_HEADER` | Server only | The header your CDN writes the visitor's address in | | `LYNKOW_COUNTRY_HEADERS` | Server only | The header that carries the visitor's country, which picks the store's market | A `PUBLIC_*` value is inlined in the browser bundle: never put a secret in one. Read each with a literal `import.meta.env.PUBLIC_NAME` so Vite can inline it. ## Deploy The starter builds a Node server: `npm run build`, then `npm start`, which runs `node --env-file-if-exists=.env.local ./dist/server/entry.mjs` and listens on `$HOST` and `$PORT` when set, else on port 3000. Run it anywhere that runs Node.js, with the server-only variables in its environment, and set `PUBLIC_SITE_URL` to the public origin before you deploy. The starter adds its security headers through a middleware. The Node server answers the built assets under `/_astro/` and the files of `public/` before any middleware runs, so they carry no such headers. If you need them there, set the same headers at your reverse proxy or CDN. The starter sets no `X-Frame-Options`, because the visual editor frames the site and the middleware varies `frame-ancestors` per request. ## Troubleshooting | Symptom | Cause | Fix | | --- | --- | --- | | An edit does not show up | The webhook does not reach `/api/revalidate`, or its secret differs | Send a test delivery from the webhook's row and check its status code | | `503` from `/api/revalidate` | `LYNKOW_WEBHOOK_SECRET` is not in the server's environment | Set it and restart the server | | A language enabled in the dashboard is missing | `PUBLIC_LOCALES` pins the list | Remove it, or add the language to it | | The editor frame stays empty | A header or CSP of your own forbids framing | Let the Lynkow middleware set `frame-ancestors`, and do not send `X-Frame-Options` | | Buyers hit rate limits together | The server key is not set | Set `LYNKOW_SERVER_KEY` | ## Next Steps - [Quick Start](/sdk/getting-started/quick-start) - [Cart and Checkout](/sdk/features/commerce-cart-checkout) - [Customer Accounts](/sdk/features/commerce-customer-accounts) --- # LLM-Ready Content **Publié le** : 2026-11-30 **Catégorie** : Advanced Serve your content to AI assistants in Markdown: an `llms.txt` index, an `llms-full.txt` document, a `.md` version of each article and page, and Markdown on the page URL itself when a client asks for it in its `Accept` header. Lynkow generates all of it from your published content. > **Reference** - This guide is a tutorial. For exhaustive, always-current signatures and field lists, see the auto-generated reference: > > - SDK: [`SeoService`](/sdk/services/sdk-seo-service) > - API: [Storefront: SEO](/storefront-api/storefront-seo) ## Prerequisites - A Lynkow client in `@/lib/lynkow` ([Add Lynkow to an Existing Project](/sdk/getting-started/existing-project)) - llms.txt turned on: in the dashboard, **Settings > SEO > Robots and AI**, switch **Enable llms.txt generation**. While it is off, every call in this guide fails with a 404. - Next.js 16 for the content negotiation of section 4 ## What Lynkow generates | SDK call | Your URL | Content | | --- | --- | --- | | `lynkow.seo.llmsTxt()` | `/llms.txt` | Index: site name, description, links to every article and page | | `lynkow.seo.llmsFullTxt()` | `/llms-full.txt` | The full Markdown of every article and page in one document | | `lynkow.seo.getMarkdown(path)` | `/{path}.md` | One article, page or category index as Markdown | ```markdown # My Tech Blog > A blog about web development and developer tools. ## Blog ### Tutorials - [Getting Started with Next.js](https://example.com/tutorials/getting-started-nextjs.md): Build your first Next.js app. ## Products - [Linen Shirt](https://example.com/products/linen-shirt) ## Pages - [About Us](https://example.com/about.md): Our team and mission. ``` Links are absolute URLs on the site's domain. Articles and pages link to their `.md` version. On a site with a product catalog, `## Products`, `## Product categories` and `## Collections` sit between the articles and the pages, and link to the page itself: commerce pages have no Markdown version. In both files: - a commerce line never carries a price or a stock level, - an article, page, product, category or collection marked noindex is left out, - the sitemap settings do not apply: a commerce type excluded from the sitemap is still listed. ## 1. Serve llms.txt and llms-full.txt ```typescript // app/llms.txt/route.ts import { lynkow } from '@/lib/lynkow' export async function GET() { const body = await lynkow.seo.llmsTxt() return new Response(body, { headers: { 'Content-Type': 'text/plain; charset=utf-8', 'Cache-Control': 'public, s-maxage=86400', }, }) } ``` `app/llms-full.txt/route.ts` is the same file with `lynkow.seo.llmsFullTxt()`. That document can weigh hundreds of KB, so keep the cache. To refresh both on publish, see [Webhooks & Cache Revalidation](/sdk/advanced/webhooks-revalidation). ### With `@lynkow/next` `textRoute` from `@lynkow/next/server` caches the read and rewrites the absolute URLs to your `siteUrl`, so a copy served from localhost or a preview deployment links to itself. It answers 404 instead of throwing when llms.txt is turned off, which keeps a prerendered build from failing. ```typescript // app/llms.txt/route.ts import { TEXT } from '@lynkow/next/server' import { server } from '@/lib/server' // your createLynkowServer() instance export const revalidate = 3600 export const GET = server.textRoute((client, options) => client.seo.llmsTxt(options), TEXT) ``` ## 2. One file per locale ```typescript // app/[locale]/llms.txt/route.ts import { isLynkowError } from 'lynkow' import { lynkow } from '@/lib/lynkow' export async function GET( _request: Request, { params }: { params: Promise<{ locale: string }> } ) { const { locale } = await params try { const body = await lynkow.seo.llmsTxt({ locale }) return new Response(body, { headers: { 'Content-Type': 'text/plain; charset=utf-8' }, }) } catch (error) { if (isLynkowError(error) && error.status === 404) { return new Response('Not Found', { status: 404 }) } throw error } } ``` - `llmsTxt()` and `llmsFullTxt()` read the locale from their `locale` option only. The client's locale is ignored, so a call without the option returns the default locale's file. - On a multi-language site, a locale the site does not enable answers 404. A single-language site serves its one file for any locale. - Each locale's file lists the entries written or translated in that locale, with their names and URLs in it. A product hidden in a locale is left out of that locale's file. With `@lynkow/next`, pass the route's locale explicitly: `server.textRoute((client, options, locale) => client.seo.llmsTxt({ ...options, locale }), TEXT)`. ## 3. Markdown version of a page `getMarkdown()` takes the public path without `.md` and appends it. Pass an article's `path` or a page's `publicPath`: both already carry the locale prefix on a multi-language site. ```typescript // app/md/[...path]/route.ts import { isLynkowError } from 'lynkow' import { lynkow } from '@/lib/lynkow' export async function GET( _request: Request, { params }: { params: Promise<{ path: string[] }> } ) { const { path } = await params try { const markdown = await lynkow.seo.getMarkdown('/' + path.join('/')) return new Response(markdown, { headers: { 'Content-Type': 'text/markdown; charset=utf-8', 'Cache-Control': 'public, s-maxage=3600', Vary: 'Accept', }, }) } catch (error) { if (isLynkowError(error) && error.status === 404) { return new Response('Not Found', { status: 404 }) } throw error } } ``` A path that resolves to nothing, or to a product, category or collection, throws a `LynkowError` with status 404 ([Error Handling](/sdk/advanced/error-handling)). ## 4. `.md` URLs and content negotiation The proxy below sends two kinds of request to the route handler of section 3: - `/blog/my-article.md`, the URL `llms.txt` links to, - `/blog/my-article` with an `Accept` header that prefers `text/markdown` to `text/html`. ```typescript // proxy.ts import { NextResponse, type NextRequest } from 'next/server' import { markdownProxy } from '@lynkow/next/proxy' export function proxy(request: NextRequest) { const { pathname } = request.nextUrl if (pathname.endsWith('.md')) { const url = request.nextUrl.clone() url.pathname = `/md${pathname.slice(0, -3)}` return NextResponse.rewrite(url) } // Keep llms.txt, robots.txt and sitemaps out of the negotiation. if (/\.(txt|xml)$/.test(pathname)) return NextResponse.next() return markdownProxy(request) ?? NextResponse.next() } export const config = { matcher: ['/((?!_next|favicon.ico|md|api).*)'], } ``` `markdownProxy()` parses q-values and wildcards, keeps HTML on a tie, and returns `null` when the client prefers HTML. On a rewrite it sets `Vary: Accept` on the response and `X-Forwarded-Accept: text/markdown` on the request. Its options: - `mdPathPrefix`: where the route handler is mounted, `'/md'` by default. - `setVary: false`: skip `Vary` when your CDN sets it. - `setForwardedAccept: false`: skip the forwarded header. Set `Vary: Accept` from the proxy or a route handler, as above. Next.js replaces the `Vary` header of App Router pages, so setting it from `next.config` headers has no effect there. `@lynkow/next` requires Next.js 16, where the file is `proxy.ts` and the export `proxy`. On Next.js 14 or 15, stay on `lynkow` 1.59, which ships the same helpers as `lynkow/middleware/next`, and use `middleware.ts` with a `middleware` export. ### Leave commerce URLs out The helper also rewrites a product URL, which then answers 404. To serve the HTML page to such a client, skip your commerce prefixes: ```typescript const COMMERCE_PREFIXES = ['/products', '/product-categories', '/collections'] const isCommerce = COMMERCE_PREFIXES.some( (prefix) => pathname === prefix || pathname.startsWith(`${prefix}/`) ) if (isCommerce) return NextResponse.next() ``` These are the default prefixes. A site can change them, and a multi-language site serves its other locales under the locale prefix with translated segments (`/fr/produits/...`): see [Public URLs and routes](/sdk/features/commerce-products#public-urls-and-routes). ## 5. Discovery and testing Crawlers look for `/llms.txt` at the site root. When llms.txt is on, the `robots.txt` Lynkow generates also disallows the llms files for Googlebot and Bingbot, so they stay out of search results ([SEO & Analytics](/sdk/media-seo/seo-analytics)). ```bash curl -s http://localhost:3000/llms.txt curl -s http://localhost:3000/fr/llms.txt curl -s http://localhost:3000/blog/my-article.md curl -si -H 'Accept: text/markdown' http://localhost:3000/blog/my-article # text/markdown, Vary: Accept curl -si -H 'Accept: text/html' http://localhost:3000/blog/my-article # text/html ``` ## Next Steps - [Instant Search](/sdk/features/search) - add a search API that llms.txt advertises to AI agents - [Webhooks & Cache Revalidation](/sdk/advanced/webhooks-revalidation) - refresh these files on publish - [SEO & Analytics](/sdk/media-seo/seo-analytics) - sitemap, robots.txt and meta tags --- # Error Handling & Resilience **Publié le** : 2026-11-30 **Catégorie** : Advanced > **Reference** - This guide is a tutorial. For exhaustive, always-current signatures and field lists, see the auto-generated reference: > > - SDK: [Lynkow SDK](/sdk) > - Types: [SDK Types](/sdk/types) > - SDK: [`CheckoutService`](/sdk/services/sdk-checkout-service) > - API: [Storefront API](/storefront-api/overview) ## Prerequisites - A shared client in `@/lib/lynkow` ([Add Lynkow to an Existing Project](/sdk/getting-started/existing-project)) - A Next.js App Router project ## Catch a LynkowError Every SDK method rejects with a `LynkowError`. `isLynkowError()` narrows the caught value: ```typescript import { isLynkowError } from 'lynkow' import { lynkow } from '@/lib/lynkow' try { const article = await lynkow.contents.getBySlug('my-article') } catch (error) { if (isLynkowError(error)) { console.error(error.code, error.status, error.toJSON()) } throw error } ``` The fields you branch on: - `code`: the category of the failure, derived from the HTTP status. Always set. - `apiCode`: the API's stable reason, taken from the first entry of the error body that carries a code. `undefined` when the body has none, and on network failures. - `status`: the HTTP status, `0` when no response was received. - `details`: the entries of the API's error body. Each has a `message`, a `field` on a validation error, and its own `code` when the API sends one. `toJSON()` returns `name`, `message`, `code`, `apiCode`, `status` and `details` as a plain object for your logs. ## `code` and `apiCode` `code` tells you what kind of failure happened, `apiCode` tells you why. A checkout refused because the buyer did not accept the terms has `code: 'VALIDATION_ERROR'` and `apiCode: 'TERMS_NOT_ACCEPTED'`. Branch on `code` for generic handling, and on `apiCode` when one status covers several situations the visitor should see differently. ## Error Codes | `code` | Status | What to do | | --- | --- | --- | | `BAD_REQUEST` | 400 | Fix the request, for example a site ID that is not a UUID | | `UNAUTHORIZED` | 401 | Check the publishable key, or sign the buyer in again | | `PAYMENT_REQUIRED` | 402 | The site's subscription blocks the operation: hide the feature | | `FORBIDDEN` | 403 | The request is refused, for example from a domain the site does not allow | | `NOT_FOUND` | 404 | Render a 404 page | | `CONFLICT` | 409 | Reload the resource and let the user start again | | `VALIDATION_ERROR` | 422 | Show `details[].message` next to the matching `field` | | `TOO_MANY_REQUESTS` | 429 | Rate limited. Reads are retried first, writes are not. When every buyer gets it, see [Server Key and Buyer IP](/sdk/advanced/server-key-buyer-ip) | | `SERVICE_UNAVAILABLE` | 503 | API temporarily unavailable, after the SDK's retries on reads | | `INTERNAL_ERROR` | 500 and any other status | Log it and show a generic error | | `NETWORK_ERROR` | `0` | No response: offline, DNS failure, or a request aborted by its signal | The `ErrorCode` type also lists `RATE_LIMITED`, `TIMEOUT` and `UNKNOWN`. The SDK's methods never throw them: only the static builders `LynkowError.fromResponse()` and `LynkowError.fromNetworkError()` produce them. ### API error codes (`apiCode`) The terms and payment refusals of checkout and booking: ```typescript import { isLynkowError } from 'lynkow' try { await lynkow.checkout.placeOrder({ email: 'buyer@example.com', acceptsTerms: true }) } catch (error) { if (isLynkowError(error) && error.apiCode === 'TERMS_PAGE_NOT_CONFIGURED') { // The site has no terms page: checkout stays closed until the merchant sets one. } else if (isLynkowError(error) && error.apiCode === 'TERMS_NOT_ACCEPTED') { // Ask the buyer to tick the terms box. } else { throw error } } ``` | `apiCode` | `code` | When | | --- | --- | --- | | `TERMS_PAGE_NOT_CONFIGURED` | `VALIDATION_ERROR` | `checkout.placeOrder()` or `reservations.book()` while the site has no terms page | | `TERMS_NOT_ACCEPTED` | `VALIDATION_ERROR` | The same calls without `acceptsTerms: true` | | `PAYMENT_METHOD_UNAVAILABLE` | `VALIDATION_ERROR` | Card payment is not available for this order. Offline methods still work | | `PAYMENT_FLOW_UNAVAILABLE` | `VALIDATION_ERROR` | `paymentFlow: 'embedded'` while in-page card payment is not available. No order is created; the hosted payment page still works | | `PAYMENT_CHECKOUT_UNAVAILABLE` | `SERVICE_UNAVAILABLE` | The card payment page could not start. The order exists unpaid, and a site that tracks stock cancels it | Both terms refusals point at `acceptsTerms` in `details[0].field`. They create no order or booking and leave the cart open. Other codes have their own guide: market, shipping, VAT and stock refusals in [Markets, Shipping and VAT](/sdk/features/commerce-markets-shipping-vat), cart errors in [Cart and Checkout](/sdk/features/commerce-cart-checkout). Each endpoint of the [Storefront API reference](/storefront-api/overview) lists the codes it returns. ## Retries and Timeouts The SDK retries reads (GET requests and text endpoints such as the sitemap) on HTTP 429, HTTP 503 and network errors. It waits with exponential backoff and honors the `Retry-After` header. Writes are sent once. You receive the error only when the retries run out. A sign-in refused for too many failed attempts stays refused for up to 15 minutes: tell the buyer to try again later. The defaults are `retries: 3`, `backoffMs: 500` and `maxDelayMs: 20000`. Tune them, or turn them off with `retry: false`: ```typescript // lib/lynkow.ts import { createClient } from 'lynkow' export const lynkow = createClient({ siteId: process.env.NEXT_PUBLIC_LYNKOW_SITE_ID!, retry: { retries: 2, maxDelayMs: 5000 }, }) ``` The SDK sets no timeout. Pass a signal in the request's `fetchOptions`: ```typescript const article = await lynkow.contents.getBySlug(slug, { fetchOptions: { signal: AbortSignal.timeout(5000) }, }) ``` An aborted request throws `NETWORK_ERROR` with status `0` and is not retried. ## Next.js Pages Map `NOT_FOUND` to `notFound()` and rethrow everything else: ```typescript // app/blog/[slug]/page.tsx import { notFound } from 'next/navigation' import { isLynkowError } from 'lynkow' import { lynkow } from '@/lib/lynkow' export default async function ArticlePage({ params }: { params: Promise<{ slug: string }> }) { const { slug } = await params let article try { article = await lynkow.contents.getBySlug(slug) } catch (error) { if (isLynkowError(error) && error.code === 'NOT_FOUND') notFound() if (isLynkowError(error)) console.error('[lynkow]', error.toJSON()) throw error } return (

{article.title}

) } ``` The rethrown error reaches the nearest `error.tsx`. An error thrown in a Server Component arrives there serialized: it is no longer a `LynkowError`, so read `code` and log on the server, before you rethrow. In a Client Component, the `catch` receives the `LynkowError` itself, so it can show a retry button on `NETWORK_ERROR` or `SERVICE_UNAVAILABLE`: ```typescript 'use client' import { isLynkowError } from 'lynkow' import { lynkow } from '@/lib/lynkow' async function loadLatest(setError: (message: string | null) => void) { try { const { data } = await lynkow.contents.list({ limit: 5 }) setError(null) return data } catch (error) { const transient = isLynkowError(error) && (error.code === 'NETWORK_ERROR' || error.code === 'SERVICE_UNAVAILABLE') setError(transient ? 'Connection problem. Try again.' : 'Failed to load articles.') return [] } } ``` On `VALIDATION_ERROR`, each entry of `details` names the `field` it is about. [Dynamic Forms](/sdk/features/forms) maps them to form inputs. ## Next Steps - [Dynamic Forms](/sdk/features/forms): field errors and spam refusals on submit - [Cart and Checkout](/sdk/features/commerce-cart-checkout): the errors of a cart and an order - [Catch-all Routes & Path Resolution](/sdk/advanced/catch-all-routes): 404s and redirects from a path --- # SEO Basics **Published**: 2026-11-30 **Category**: Settings This guide shows you how to help search engines find and present your site: titles and descriptions, redirects, the sitemap, and the work Lynkow already does for you. ## Before you start - Sign in and select your site. The [dashboard tour](/user-guides/dashboard-basics/dashboard-tour) shows where everything is. - The site-wide SEO settings are in **Settings** > **SEO**. Its pages are **URLs**, **Sitemap**, **Indexing**, **Search Console**, **Redirects**, **Robots and AI** and **JSON-LD**. **Search Console** appears only when your role can manage it. - Your role decides what you can change. Ask a site administrator when a control is disabled. ## What Lynkow does for you - **Sitemap.** Lynkow keeps your sitemap, the list of addresses search engines should visit, up to date with your published articles and pages. Both are included by default. - **Redirects when an address changes.** When the address of a blog article or a blog category changes, Lynkow adds a redirect from the old address to the new one, so existing links keep working. - **Language redirects.** On a site with several languages, Lynkow redirects the addresses of a language that is not enabled, and sends a translated page's other addresses to the one in its own language. These rules are listed under **Automatic redirects** on the **Redirects** page. - **Default search titles.** On a new article, the SEO title follows the article title until you change it. ## Write titles and descriptions Search engines show a title and a short text for each result. Write them for every important page. For a blog article, open it and click **SEO** in the left column. The [content guide](/user-guides/content-editing/create-and-publish-content) describes each field. For a page: 1. Open **Pages**, then click the page. 2. Click **SEO** in the left column. 3. Fill in **Meta title**: up to 70 characters, with the words people search for. 4. Fill in **Meta description**: up to 160 characters that make people want to click. 5. Under **Open Graph**, add an **OG Image** for the preview shown when someone shares the page. 1200 by 630 pixels works best. 6. Click **Save**. Turn on **Do not index** only for a page that must stay out of search results, such as a thank-you page. ## Redirect an old address A redirect sends visitors and search engines from an old address to a new one. Add one when you delete a page or change its URL path. 1. Go to **Settings** > **SEO**, then **Redirects**. 2. Click **New redirect**. 3. In **Source path**, enter the old address, for example `/old-offer`. 4. In **Target path**, enter the new address, for example `/offers`. 5. Keep **301 - Permanent redirect** for a move that lasts. Pick **302 - Temporary redirect** for a short-term one. 6. Click **Create**. To pause a redirect without deleting it, choose **Deactivate** in the menu at the end of its row. ## Check your sitemap 1. Go to **Settings** > **SEO**, then **Sitemap**. 2. Turn on **Auto-generated URLs** to list the addresses Lynkow adds for you. 3. Click **Configuration** to choose what goes in the sitemap. Under **Content**, turn **Articles**, **Pages** or **Article categories** on or off, then click **Save**. To add an address Lynkow does not know about, such as a page hosted elsewhere: 1. Click **Add**. 2. Enter the **URL**, for example `/contact` or a full address. 3. Choose a **Priority** and a **Frequency**, then click **Create**. ## Connect Google Search Console Search Console shows how your site appears in Google results. Once connected, its data appears in **Analytics**. 1. Go to **Settings** > **SEO**, then **Search Console**. 2. Click **Connect** and sign in with the Google account that manages your site in Search Console. 3. Back in Lynkow, check the **Google account** and the **Property to connect**, then click **Confirm and connect**. 4. Click **Sync now** to import your data the first time. If you do not recognise the Google account shown, do not confirm. ## Other SEO settings These pages are rarely needed day to day. Ask your developer before you change them. - **URLs** sets how article addresses are built and the **Default Author** of your articles. - **Indexing** can tell search engines about new content as soon as you publish it, with **IndexNow** and **Google Indexing**. Each needs setup on your site. - **Robots and AI** holds the rules for search engine robots and the **llms.txt** files that help AI assistants read your site. - **JSON-LD** holds the structured data that describes your organization to search engines. ## Good to know - Search engines take days or weeks to reflect a change. A new title does not appear in results at once. - Give each page its own title and description. Repeated texts make results harder to tell apart. - Every image needs alt text too. See [Media library](/user-guides/content-editing/media-library). ## Next steps - [Read your analytics](/user-guides/dashboard-basics/analytics-dashboard) to see which pages bring visitors. - [Build your pages](/user-guides/content-editing/pages-and-global-blocks). - [Configure your site settings](/user-guides/site-settings/site-settings), including your languages. --- # Connect Claude or ChatGPT to Lynkow **Published**: 2026-11-30 **Category**: Settings Once connected, your AI assistant works on your Lynkow sites from the chat: it can write and publish content, update pages, translate, review your SEO or read your analytics. It acts with your own access, on the sites you choose. The Lynkow server address is: ```text https://mcp.lynkow.com/mcp ``` ## Before you start - You need a Lynkow account with access to the site you want to connect. - The site's plan must include **AI connections**. If it does not, Lynkow tells you when you approve the access. - Your assistant can do what your role allows on that site, and nothing more. - Changes the assistant makes are real: a page it publishes is live on your website. Ask it to save as a draft when you want to review first. ## Connect Claude ### One-click link 1. Sign in to Claude in your browser. 2. Open this link: [Add Lynkow to Claude](https://claude.ai/customize/connectors?modal=add-custom-connector&connectorName=Lynkow&connectorUrl=https%3A%2F%2Fmcp.lynkow.com%2Fmcp). 3. Claude opens the **Add custom connector** window with the name **Lynkow** and the server address already filled in. Check that the address is `https://mcp.lynkow.com/mcp`, then click **Add**. 4. Click **Connect** next to Lynkow. A Lynkow page opens: [approve the access](#approve-access-in-lynkow). ### By hand 1. In Claude, go to **Customize** > **Connectors**. 2. Click **+ Add**, then **Add custom connector**. 3. Enter `Lynkow` as the name and `https://mcp.lynkow.com/mcp` as the server URL. 4. Keep the suggested settings and click **Add**, then **Connect**. ### Claude plans - Every Claude plan can add Lynkow. The Free plan allows one custom connector. - On a Team or Enterprise plan, an owner adds Lynkow once for the whole organization, with this link: [Add Lynkow to your Claude organization](https://claude.ai/admin-settings/connectors?modal=add-custom-connector&connectorName=Lynkow&connectorUrl=https%3A%2F%2Fmcp.lynkow.com%2Fmcp). Each member then goes to **Customize** > **Connectors**, finds Lynkow and clicks **Connect**. - Once added, Lynkow also works in the Claude desktop and mobile apps, signed in to the same account. To use Lynkow in a conversation, click **+** at the bottom left of the chat, open **Connectors** and check that Lynkow is turned on. ## Connect ChatGPT ChatGPT has no link that fills in the form for you, so add Lynkow by hand. It works on chatgpt.com in a browser. 1. Go to [chatgpt.com/plugins](https://chatgpt.com/plugins). 2. Click the **+** button, then **Add custom MCP server**. 3. Enter `Lynkow` as the name. 4. Under **Connection**, enter `https://mcp.lynkow.com/mcp`. 5. For authentication, choose OAuth. 6. Read the warning, check **I understand and want to continue**, then click **Create as a plugin**. 7. ChatGPT asks you to sign in to Lynkow: [approve the access](#approve-access-in-lynkow). ### ChatGPT plans - On ChatGPT Business, Enterprise and Edu, an admin or owner of the workspace adds Lynkow. On Enterprise and Edu, an admin can also allow other members to add it. - On ChatGPT Pro, the assistant can read your sites but cannot change them. - If **Add custom MCP server** is missing from the menu, your plan or your workspace settings do not allow it. ## Approve access in Lynkow Whichever assistant you use, Lynkow shows a page titled **Connect Claude to Lynkow** or **Connect ChatGPT to Lynkow**. 1. Sign in to Lynkow if asked. 2. Under **Organization**, choose the organization that holds your sites. 3. Under **Sites**, select only the sites the assistant needs. 4. Click **Authorize**. You return to your assistant, which is now connected. If you are an owner or admin of the organization and select every site, the assistant also gets the sites you create later. Select sites one by one to avoid that. ## Try it Ask your assistant something like: ```text List my Lynkow sites, then show me the last 5 articles of my blog. ``` ```text Write a draft article about our summer opening hours on my Lynkow site. Do not publish it. ``` The assistant asks which site to use when you have several. ## Disconnect an assistant 1. In the Lynkow dashboard, click your avatar at the top right, then **Preferences**. 2. Open **External apps**. 3. Click **Revoke** next to the assistant. The assistant loses access to your sites at once. You can also remove Lynkow from the connectors or plugins of your assistant. ## Troubleshooting - **"AI connections are not included in the plan of these sites"**: deselect those sites, or upgrade their plan and try again. - **The assistant cannot do something you can do in the dashboard**: check that you selected that site when you approved the access. To change the selection, revoke the assistant in **External apps**, then connect it again. - **The assistant asks you to sign in again**: approve the access again. Your sites and data are not affected. - **Lynkow does not appear in the conversation**: turn it on in the connectors (Claude) or plugins (ChatGPT) of that conversation. ## Next steps - [Take the dashboard tour](/user-guides/dashboard-basics/dashboard-tour) - [Create and publish content](/user-guides/content-editing/create-and-publish-content) - [Configure your site settings](/user-guides/site-settings/site-settings) --- # Cloudflare Cache Purge **Published**: 2026-11-30 **Category**: Integrations > Clears your own Cloudflare cache when content changes in Lynkow, so visitors see the new version within seconds. ## Prerequisites - A Cloudflare account with the zone (domain) that serves your site. The Free plan works. - Admin access to your Lynkow site. ## Step 1: Create a Cloudflare API token 1. Open [dash.cloudflare.com/profile/api-tokens](https://dash.cloudflare.com/profile/api-tokens) and click **Create Token**. 2. On the **Create Custom Token** row, click **Get started**. 3. Fill in the token: - **Token name**: `Lynkow Cache Purge` - **Permissions**: one row, `Zone` / `Cache Purge` / `Purge` - **Zone Resources**: `Include` / `All zones from an account` / your account 4. Click **Continue to summary**, then **Create Token**. 5. Copy the token. Cloudflare shows it only once. ## Step 2: Install the plugin 1. In the Lynkow dashboard, open **Apps** in the sidebar. 2. Under **Available plugins**, find **Cloudflare Cache Purge** and click **Install**. A three-step drawer opens. ### Events Every event is selected by default. They are grouped by resource (`content`, `site_block`, `category`, `tag`, `review`, `redirect`, `variable`, and translation events for forms and products). Untick the groups that never change a cached page on your site, then click **Next**. ### API Token Paste the token from Step 1 and click **Next**. Lynkow checks it with Cloudflare and loads the zones it can reach. An invalid token keeps you on this step with an error. ### Zone and settings The plugin's own settings are labelled in French in every dashboard language. - **Zone**: select the zone that serves your site. - **Stratégie de purge** (purge strategy): - **Par préfixe (recommandé)**: purges only the URLs the change affects. - **Purge complète**: purges the whole zone on every change. - **Domaine personnalisé** (custom domain), optional: click **Add** when your Cloudflare zone serves the site on another domain than the one set in Lynkow, for example `https://www.example.com`. - **Préfixe de chemin absent des URLs publiques** (path prefix missing from public URLs), optional: leave it empty unless your front end drops a prefix your content is stored under. For a page saved at `/docs/getting-started` and served at `/getting-started`, enter `docs`. The plugin then purges both forms. Click **Install**. The plugin appears under **Installed** with a green dot. ## Step 3: Check that it works Hover the plugin row under **Installed** to show its actions: - **Test** (test tube icon) sends a real purge and shows the result in a toast. A failure usually means the token expired or was revoked. - **View logs** (file icon) opens **Activity logs**: one row per event, with its status, message, duration and time. Start with **Par préfixe**. Switch to **Purge complète** only if some pages stay stale after a change. ## Troubleshooting ### "Zone ID ou API Token invalide" Cloudflare rejected the credentials. Check that the token is still active, has the `Zone` / `Cache Purge` / `Purge` permission, and covers the zone. When in doubt, create a new token and paste it with **Configure** (gear icon). ### A log row says success but the page is still stale The plugin sends its purge about 5 seconds after a change, so that changes made close together share one request. Cloudflare then needs a few more seconds to apply it. If the page is still stale 30 seconds later, the purge did not cover its URL: 1. Set **Domaine personnalisé** if the zone serves the site on another domain than the one in Lynkow. 2. Set **Préfixe de chemin absent des URLs publiques** if public URLs drop a prefix your content is stored under. 3. If neither applies, switch to **Purge complète**. ### Bulk edits and rate limits Changes made within a few seconds of each other are grouped into one purge request. Each event still gets its own log row, which says how many events were grouped, for example `1 préfixe(s) purgé(s) (40 événements groupés)`. When a burst touches too many different pages for a targeted purge, the plugin purges the whole zone instead and the row reads `Purge complète effectuée`. Keep the plugin enabled during bulk operations. Changes made while it is disabled are never purged, and no log row records them. When Cloudflare answers that the account is rate-limited, the plugin waits the delay Cloudflare asks for, up to a few seconds, and retries once. A row ending with `1 nouvel essai après limitation Cloudflare` succeeded on that retry. If the retry fails too, the row shows the error: - Your next change sends a new purge and usually clears it. - To purge now, click **Purge everything** (eraser icon) on the plugin row and confirm. - Cloudflare counts its purge limit per account, across all zones. Sites that purge through the same Cloudflare account share that limit, so avoid running bulk operations on them at the same time. ## Security The API token is encrypted at rest. After saving, the dashboard shows only its last four characters (`••••a3f2`), and API responses never return it. ## Uninstall Hover the plugin row under **Installed**, click **Uninstall** (trash icon) and confirm. Uninstalling deletes the plugin settings and activity logs. The Cloudflare token stays valid: delete it in Cloudflare if you no longer need it. ## Next Steps - [Webhooks & Cache Revalidation](/sdk/advanced/webhooks-revalidation) - refresh your Next.js cache on the same changes. --- # Customer Reviews **Published**: 2026-11-30 **Category**: Forms This guide shows you how to collect reviews from your customers, decide which ones appear on your site, and set how new reviews are handled. ## Before you start - Sign in and select your site. The [dashboard tour](/user-guides/dashboard-basics/dashboard-tour) shows where everything is. - In the sidebar, open **Reviews**. On a site that sells online, **Reviews** sits under **Customers**. - Your role decides what you can do. Viewing, adding, editing, moderating, deleting, importing and exporting reviews, and changing review settings, are separate rights. Ask a site administrator when a button described here is missing. ## How reviews reach Lynkow Each review shows where it came from: - **Form**: a visitor sent it from the review form on your site. Your developer adds that form. - **Admin**: someone on your team added it with **New review**. - **CSV Import**: it came from a spreadsheet file. - **API**: another tool sent it. ## How review statuses work | Status | What it means | | --- | --- | | **Pending** | Waiting for your decision. Hidden from your site. | | **Approved** | Shown on your site. | | **Rejected** | Kept in the dashboard, hidden from your site. | ## Approve or reject a review 1. Open **Reviews**. The cards at the top show the **Total**, the **Average rating**, the reviews still **Pending** and those received **This month**. 2. To see only the reviews waiting for you, set the status filter to **Pending**. 3. Open the menu at the end of a review's row. 4. Choose **Approve** to show it on your site, or **Reject** to hide it. 5. When you reject a review, Lynkow asks for a **Rejection reason**. Write a short note for your team if you want, then click **Reject**. To change your mind later, the same menu offers the other statuses, including **Set pending**. To moderate several reviews at once, tick their rows, then click **Approve** or **Reject** above the list. ## Edit a review 1. Click a review's row, or choose **Edit** in its menu. 2. Change what you need: the author details, the **Rating**, the **Title**, the **Review content** or the **Review date**. 3. Click **Save**. When your site has several languages, a translation only lets you change the title and the content. The other fields are shared by every language. ## Highlight your best reviews Open the menu at the end of a review's row and choose **Add to featured**, or click the star in the **Featured** column. A lit star marks a featured review. Your site decides how to use featured reviews, for example by showing them first. Choose **Remove from featured** in the same menu to undo it. ## Add a review yourself Use this for a testimonial you received by email or by phone. 1. Click **New review**. 2. Fill in the author's **Name**, the **Rating** and the **Review content**. The content needs at least 10 characters. 3. Optionally, add the author's **Company**, **Position**, **City** and a **Title**. 4. Choose the status. 5. Click **Create review**. ## Import or export reviews To bring in reviews you already have elsewhere: 1. Click **Import CSV**. 2. Click **Download CSV template** to get a file with the expected columns, then fill it in. Each row needs at least an author name, a rating from 1 to 5 and the review content. 3. Select your file. It must be a CSV file of 10 MB or less. 4. Match each column of your file to a Lynkow field, then click **Import** followed by the number of reviews found. 5. Read the result. Rows with errors are listed with the reason. Importing depends on your plan. To download all your reviews as a spreadsheet file, click **Export CSV**. ## Choose how new reviews are handled 1. Click **Settings** above the list. 2. Under **Auto-approval**, turn on **Enable auto-approval** to publish good reviews without waiting for you. Choose the **Minimum rating for auto-approval**, for example 4 stars and above. Reviews below it stay **Pending**. 3. Under **Public submissions**, turn off **Enable public submissions** to stop accepting reviews from your site. Turn on **Require email** to ask every reviewer for an email address. 4. Under **Publicly displayed fields**, choose what your site may show about each reviewer: **Author photo**, **Company and position** and **City**. 5. Under **Custom fields**, click **Add field** to ask reviewers an extra question, such as the date of their visit. 6. Click **Save**. ## Good to know - Only approved reviews appear on your site. - To be told when a review waits for you, go to **Settings** > **General** > **Notifications**, turn on **Review pending moderation** and click **Save**. - Deleting a review is permanent. Reject it instead when you may want it back. ## Next steps - [Collect other messages with forms](/user-guides/forms-submissions/forms-and-submissions). - [Set up your site and your team](/user-guides/site-settings/site-settings). - [Read your analytics](/user-guides/dashboard-basics/analytics-dashboard) to see how visitors reach your reviews. --- # Rate Limits **Published**: 2026-11-30 **Category**: Getting Started > The API limits how many requests a client can send in a time window. This page lists the limits you can reach, the headers that report them, and how to handle a 429. Previous: [Pagination](/sdk/getting-started/pagination) | Next: [Add Lynkow to an Existing Project](/sdk/getting-started/existing-project) > **Reference** - This guide is a tutorial. For exhaustive, always-current signatures and field lists, see the auto-generated reference: > > - API: [Storefront API Overview](/storefront-api/overview), where each endpoint states its limit > - SDK: [SDK Reference](/sdk) ## Prerequisites - A first request done ([Quick Start](/sdk/getting-started/quick-start)) ## Storefront API limits Each limit is counted per site and per client, the client being the caller's IP address. One site's traffic never uses another site's budget, and one visitor never uses another visitor's. | Calls | Limit | | --- | --- | | Requests under `/storefront/{siteId}`, the general limit | 12,000 per minute | | Cart changes: add, update or remove a line, set the cart's address or shipping option | 120 per minute | | Form and review submissions, checkout, bookings, saved address changes, the guest order page | 10 per 15 minutes | | Analytics events and cookie consent logs | 600 per minute | | Buyer sign-in, sign-up and password reset | See [Server Key and Buyer IP](/sdk/advanced/server-key-buyer-ip) | A request can count toward several limits, and the strictest one decides. A request with a publishable key is also counted per key, at 18,000 per minute: that limit is higher than the others, so sending a key does not raise what you can reach. These figures are current values, not a contract: they can change. When your server calls the API for your buyers, every buyer shares your server's IP address, and so its limits. Forward each buyer's IP with a server key: [Server Key and Buyer IP](/sdk/advanced/server-key-buyer-ip). ## Admin API limits Requests to `/v1` count toward two limits: - A per-minute limit for each client of a site. - A per-minute budget for the whole site, set by its plan and shared by all its API tokens. Calls an AI assistant makes through the MCP server count toward the same limits. ## Headers A successful response carries two headers: | Header | Value | | --- | --- | | `X-RateLimit-Limit` | The number of requests allowed in the window | | `X-RateLimit-Remaining` | The number left in the current window | ```bash curl -s -D - -o /dev/null "https://api.lynkow.com/storefront/a779c43c-430e-45d1-8749-2144d7f60a0f/contents?limit=1" | grep -i ratelimit ``` They describe one limit, not all of them. On `/v1`, they report the per-client limit, not the site's plan budget. Browser code cannot read them: read them from a server. ## A 429 response Past a limit, the API returns 429: ```json { "errors": [ { "message": "Too many requests", "code": "RATE_LIMIT_EXCEEDED" } ], "requestId": "..." } ``` Only the failed sign-in limits send a `Retry-After` header, with the number of seconds to wait. The other limits send none. ## Retry - **Reads**: wait, then retry with an exponential backoff, for example 1, 2, then 4 seconds. Honor `Retry-After` when it is present. - **Submissions and checkout**: do not retry in a loop. The window is 15 minutes, so tell the visitor to try again later. - **Builds and syncs**: a static build runs from one machine, so all its requests share one budget. Fetch lists with `limit=100` to send fewer requests ([Pagination](/sdk/getting-started/pagination)). The SDK retries reads on 429 and 503 with an exponential backoff and honors `Retry-After`. It sends writes once. When its retries run out, it throws a `LynkowError` with `code: 'TOO_MANY_REQUESTS'` and `apiCode: 'RATE_LIMIT_EXCEEDED'`: ```typescript import { isLynkowError } from 'lynkow' import { lynkow } from '@/lib/lynkow' try { await lynkow.forms.submit('contact', { email: 'visitor@example.com', message: 'Hello' }) } catch (error) { if (isLynkowError(error) && error.apiCode === 'RATE_LIMIT_EXCEEDED') { // Show "Too many attempts, try again in a few minutes." } else { throw error } } ``` [Error Handling & Resilience](/sdk/advanced/error-handling) shows how to tune or turn off the retries. ## Reference - API: [Storefront API Overview](/storefront-api/overview), [Admin API Overview](/admin-api/api-overview) - SDK: [SDK Reference](/sdk) ## Next Steps - [Server Key and Buyer IP](/sdk/advanced/server-key-buyer-ip) - count each buyer on their own limit when your server calls the API - [Error Handling & Resilience](/sdk/advanced/error-handling) - retries, timeouts and error pages - [Add Lynkow to an Existing Project](/sdk/getting-started/existing-project) - the SDK in a Next.js app --- # Pagination **Published**: 2026-11-30 **Category**: Getting Started > Lists on both APIs are paginated the same way: `page` and `limit` in the query, `data` and `meta` in the response. Search is the one exception. Previous: [Errors](/sdk/getting-started/api-errors) | Next: [Rate Limits](/sdk/getting-started/rate-limits) > **Reference** - This guide is a tutorial. For exhaustive, always-current signatures and field lists, see the auto-generated reference: > > - SDK: [`ContentsService`](/sdk/services/sdk-contents-service), [`SearchService`](/sdk/services/sdk-search-service) > - API: [Storefront: Content](/storefront-api/storefront-content) ## Prerequisites - A first request done ([Quick Start](/sdk/getting-started/quick-start)) ## Query parameters ```bash curl "https://api.lynkow.com/storefront/a779c43c-430e-45d1-8749-2144d7f60a0f/contents?page=2&limit=10&locale=en" ``` | Parameter | Default | Maximum | | --- | --- | --- | | `page` | `1` | | | `limit` | `20` | `100` | Pages count from 1. A page past the last one returns an empty `data` array. Keep `limit` at 100 or below: depending on the list, a larger value returns 422 or is lowered to the maximum. Two Storefront routes built to fetch a whole catalog in one call default to 500 items and accept up to 500: a category with its posts (`/categories/{slug}`, `categories.getBySlug()` in the SDK) and path resolution (`/resolve`). The Admin API (`/v1`) uses the same parameters, defaults and maximum. ## The `meta` object ```json { "data": [ ... ], "meta": { "total": 42, "perPage": 10, "currentPage": 2, "lastPage": 5, "firstPage": 1, "firstPageUrl": "/?page=1", "lastPageUrl": "/?page=5", "nextPageUrl": "/?page=3", "previousPageUrl": "/?page=1" } } ``` - `total`: items matching the query, across all pages. - `perPage`: the page size applied. - `currentPage` and `lastPage`: where you are, and the last page number. `lastPage` is `1` when nothing matches. - `firstPage`: always `1`. - The `...Url` fields hold a query string only, without the endpoint path or your other parameters. `nextPageUrl` is `null` on the last page. Build the next request from `currentPage` instead. There is another page while `currentPage < lastPage`. ## With the SDK List methods take `page` and `limit` and return `{ data, meta }`: ```typescript import { lynkow } from '@/lib/lynkow' const { data, meta } = await lynkow.contents.list({ page: 2, limit: 10 }) const hasNext = meta.currentPage < meta.lastPage ``` To read a whole list, loop until the last page: ```typescript import type { ContentSummary } from 'lynkow' import { lynkow } from '@/lib/lynkow' export async function allPosts(): Promise { const posts: ContentSummary[] = [] let page = 1 let lastPage = 1 do { const { data, meta } = await lynkow.contents.list({ page, limit: 100 }) posts.push(...data) lastPage = meta.lastPage page++ } while (page <= lastPage) return posts } ``` The SDK's `PaginationMeta` type also declares `hasMorePages` and `hasPreviousPages`. The API never sends them, so they are always `undefined`: compare `currentPage` with `lastPage` and with `1`. ## Search results Search endpoints (`/search` and `/search/{profileSlug}`, `search.search()` in the SDK) return a different `meta`: ```json { "data": [ ... ], "meta": { "total": 37, "page": 1, "totalPages": 4, "perPage": 10, "query": "pricing", "processingTimeMs": 3, "profile": "default" } } ``` - `page` and `totalPages` replace `currentPage` and `lastPage`. `totalPages` is `0` when nothing matches. - `total` is an estimate. - The default and maximum `limit` come from the search profile's settings. ```typescript const results = await lynkow.search.search('pricing', { page: 1, limit: 10 }) const hasNext = results.meta.page < results.meta.totalPages ``` [Instant Search](/sdk/features/search) builds a search page on top of it. ## Reference - SDK: [`ContentsService`](/sdk/services/sdk-contents-service), [`SearchService`](/sdk/services/sdk-search-service), [SDK Types](/sdk/types) - API: [Storefront: Content](/storefront-api/storefront-content), [Storefront: Search](/storefront-api/storefront-search) ## Next Steps - [Rate Limits](/sdk/getting-started/rate-limits) - the limits a long loop can reach, and how to retry - [Build a Blog with Next.js](/sdk/getting-started/blog-nextjs) - a paginated blog list - [Instant Search](/sdk/features/search) - search with pages and filters --- # Markets, Shipping and VAT **Published**: 2026-11-30 **Category**: Features > Take a cart from the buyer's country to a placed order: markets, delivery or pickup, shipping options, pickup points, VAT figures and a confirmed total. Previous: [Guide 20](/docs/sdk/features/commerce-customer-accounts) | Next: [Guide 24](/docs/sdk/features/commerce-cart-checkout) > **Reference** - This guide is a tutorial. For exhaustive, always-current signatures and field lists, see the auto-generated reference: > > - SDK: [`MarketsService`](/docs/sdk/services/sdk-markets-service), [`ShippingOptionsService`](/docs/sdk/services/sdk-shipping-options-service), [`PickupPointsService`](/docs/sdk/services/sdk-pickup-points-service), [`CartService`](/docs/sdk/services/sdk-cart-service), [`CheckoutService`](/docs/sdk/services/sdk-checkout-service) > - Types: [SDK Types](/docs/sdk/types) > - API: [Storefront: Commerce](/docs/storefront-api/storefront-commerce) ## Prerequisites - A client created with a publishable key ([Guide 18](/docs/sdk/features/commerce-products)). Every call in this guide requires one. - A cart with at least one line ([Guide 24](/docs/sdk/features/commerce-cart-checkout)). - Markets, shipping options and taxes set up by the merchant under **Settings > E-commerce > Markets**. ## The flow 1. Read the markets and the countries checkout accepts, to build the country picker. 2. Store the buyer's delivery address on the cart. 3. List the shipping options of that country's market, and store the buyer's choice on the cart. 4. When that option delivers to a pickup point, search the points near the buyer and store the one they choose. 5. Show the cart's figures. 6. Place the order with the same address and the total the buyer saw. A pickup order, which the buyer collects from the merchant, skips steps 2 to 4. All amounts are integers in the minor unit of the site's currency (cents for EUR), in `cart.currency`. ## Markets ```typescript // Market (partial): { id, countries, defaultLocale } const { data: markets, meta } = await lynkow.markets.list() const market = markets.find((m) => m.countries.includes('FR')) const countries = meta?.checkoutCountries ?? null ``` A market is a group of countries the merchant sells into, with its languages (`locales`, `defaultLocale`) and the site's currency. `list()` returns the active markets, oldest first. A country belongs to at most one market, so `find()` returns one market or none. The call throws `NOT_FOUND` when markets are not enabled on the site. The API never picks a market for a visitor: it reads no cookie and no location header. Your storefront picks it from the country the buyer chose, then passes `market.id` to the catalogue reads ([Guide 18](/docs/sdk/features/commerce-products)) and to `shippingOptions.list()`. ### The country picker Build the picker from `meta.checkoutCountries`, the delivery countries checkout accepts now, as sorted ISO 3166-1 alpha-2 codes: | Value | Meaning | | --- | --- | | `null` | Any country. Offer your own list. | | `['BE', 'FR', 'LU']` | Only these: the countries of the active markets, or the EU countries when the site computes VAT and has no active market. | | `[]` | No delivery country, for example when prices are entered without VAT and the site cannot compute VAT. | `meta` is typed optional only so that a hand-built `MarketList` can omit it. The API always sends it. ## Delivery or pickup `fulfillmentMode` on `placeOrder()` says how the order reaches the buyer: - `'delivery'` (the default): the order ships to `address`, or to the pickup point stored on the cart. On a site with active markets, the country must belong to one and every line must be sold there. Shipping applies, and the delivery country decides the VAT. - `'pickup'`: the buyer collects the order from the merchant. Checkout skips the market checks and charges no shipping. VAT, when computed, is at the merchant country's rate. For a pickup, clear the delivery address and the shipping choice on the cart first, so the cart shows what the order charges: ```typescript const cart = await lynkow.cart.update({ deliveryAddress: null, shippingOptionId: null }) const order = await lynkow.checkout.placeOrder({ email: 'alice@example.com', fulfillmentMode: 'pickup', paymentMethod: 'click_and_collect', expectedTotalCents: cart.totalCents, acceptsTerms: true, }) ``` ## Shipping ### Store the delivery address ```typescript import type { OrderAddress } from 'lynkow' const address: OrderAddress = { firstName: 'Alice', lastName: 'Martin', address1: '12 rue de la Paix', city: 'Paris', postalCode: '75002', countryCode: 'FR', } let cart = await lynkow.cart.update({ deliveryAddress: address }) ``` `cart.update()` sends only the keys you pass: an absent key keeps the stored value, `null` clears it, and a new address replaces the stored one whole. It returns the cart with recomputed totals. The address's `countryCode` decides which market's shipping options apply and which country's VAT the figures show. An invalid `countryCode` throws `VALIDATION_ERROR`. ### List the shipping options ```typescript // Each option (partial): { id, label, priceCents } const { data: options } = market ? await lynkow.shippingOptions.list({ market: market.id, country: 'FR', locale: 'fr' }) : { data: [] } ``` `market` is required. `list()` returns that market's active options in the merchant's order, with `label` in the requested locale when translated. `country` prices the options at that country's VAT rate. Each option carries `priceNetCents`, `priceGrossCents` and `priceDisplayMode`, like a product. An unknown or draft market id lists nothing. The call throws `NOT_FOUND` when shipping is not enabled on the site. An empty list means the market has no active option. When the site ships to other markets, checkout then refuses delivery to that country with `SHIPPING_UNAVAILABLE`. When the site ships nowhere, a delivery order is charged no shipping. ### Store the buyer's choice ```typescript cart = await lynkow.cart.update({ shippingOptionId: selectedOptionId }) // a shp_... id if (cart.shippingOptionId === null) { // Not kept: list the options again and ask the buyer to pick. } ``` The cart keeps a choice only while it is an active option of the delivery country's market. Any other choice is cleared, never refused: an option of another market, a choice made before the cart has a country, or one a new address moves out of its market. The cart then reads `shippingOptionId: null` and `shippingTotalCents: 0`. Set the address first, or both in one call, and read `shippingOptionId` back after every cart call. ### Deliver to a pickup point ```typescript // PickupPoint (partial): { id, name, address, distanceMeters, openingHours } const option = options.find((o) => o.id === cart.shippingOptionId) if (option?.requiresPickupPoint === true) { const { data: points } = await lynkow.pickupPoints.search({ shippingOptionId: option.id, countryCode: 'FR', postalCode: '75002', }) // Show the points, then store the one the buyer picks. cart = await lynkow.cart.update({ pickupPointId: chosenPointId }) } ``` An option with `requiresPickupPoint: true` delivers to a pickup point: a shop or locker where the carrier leaves the parcel for the buyer. Read the flag as `option.requiresPickupPoint === true`. `deliveryLabelKey`, `'home_delivery'` or `'pickup_point_delivery'`, is a stable key to map to your own wording. `search()` takes the option and `countryCode`, then either `postalCode` or both `latitude` and `longitude`. It returns the points nearest first, 10 by default and up to 30 with `limit`, not paginated. `data` is empty when no point is near. It throws: - `NOT_FOUND` when pickup points are not enabled on the site. - `VALIDATION_ERROR` with `apiCode` `SHIPPING_OPTION_NO_PICKUP_POINTS` for an option that takes no point, or `SHIPPING_OPTION_INVALID` for an unknown or inactive one. - `SERVICE_UNAVAILABLE` with `apiCode` `PICKUP_POINT_SEARCH_UNAVAILABLE` when the points cannot be listed right now. Ask the buyer to try again, or to choose another option. Each buyer can search 60 times a minute. From your server, all buyers share that count unless you forward their IP ([Guide 26](/docs/sdk/advanced/server-key-buyer-ip)). `cart.update({ pickupPointId })` stores the point. Set the address and the option first. A refused call writes nothing: | `apiCode` | When | | --- | --- | | `SHIPPING_OPTION_NO_PICKUP_POINTS` | The cart has no delivery country or no option, or its option takes no point. | | `PICKUP_POINT_INVALID` | The point is unknown or closed. | | `PICKUP_POINT_SEARCH_UNAVAILABLE` | The point cannot be checked right now. Try again. | `cart.pickupPoint` then holds the point, with its `id`, `name` and `address`, or `null`. A new shipping option clears it unless the same call sends a point. A delivery country other than the point's clears it too, and so does an option that stops taking a point. Read `pickupPoint` back after every cart call, as you do `shippingOptionId`. Checkout freezes the point on the order. Send the buyer's address as for any delivery: checkout reads the market, the shipping and the VAT from it, and the point must be in its country. Order reads return the point as `order.pickupPoint`, and the parcels as `order.shipments`, each with its `status` and `trackingUrl`. ## VAT When the site computes VAT, every amount the cart and the order charge includes it. Every buyer pays the merchant country's rate, unless the merchant turns on One-Stop Shop (OSS): the delivery country's rate then applies, so the figures can change with the address. A site that computes VAT delivers inside the EU only: checkout refuses another destination with `DESTINATION_NOT_TAXABLE`. ### VAT on the cart ```tsx import type { Cart } from 'lynkow' function CartTotals({ cart }: { cart: Cart }) { const format = (cents: number) => `${(cents / 100).toFixed(2)} ${cart.currency}` if (cart.priceDisplayMode === 'exclusive') { return (
Total excl. VAT
{format(cart.totalCents - cart.taxTotalCents)}
VAT
{format(cart.taxTotalCents)}
Total
{format(cart.totalCents)}
) } return (
Subtotal
{format(cart.subtotalCents)}
Shipping
{format(cart.shippingTotalCents)}
Total
{format(cart.totalCents)}
Including VAT
{format(cart.taxTotalCents)}
) } ``` - `totalCents` is `subtotalCents` plus `shippingTotalCents`, both VAT included. `taxTotalCents` is the VAT inside the total: never add it. - Each line carries `netCents` and `grossCents`. A line's `unitPriceCents` and `subtotalCents` are gross. - `priceDisplayMode` is display only. The buyer always pays `totalCents`. - When the site computes no VAT, `taxTotalCents` is 0 and every net amount equals its gross. The cart computes its VAT for the delivery country, else the merchant's country. To preview a buyer's VAT before they enter an address, pass `country`: ```typescript const preview = await lynkow.cart.retrieve({ country: 'DE' }) ``` `country` affects that response only, never the stored cart, and is ignored once the address has a `countryCode`. An invalid code throws `VALIDATION_ERROR`. ### VAT on the order ```typescript // Order (partial): { vatTreatment, taxTotalCents, items, shippingLine } const order = await lynkow.customers.order(orderId) if (order.vatTreatment === 'charged') { for (const item of order.items) { console.log(item.buyerTitle ?? item.title, item.taxRateBp, item.taxCents) } console.log('Shipping VAT', order.shippingLine?.taxCents ?? 0) } ``` VAT is frozen on the order when it is placed: - `vatTreatment` is `'charged'` or `'not_computed'`. With `'not_computed'`, `taxTotalCents` is 0 and every rate is `null`. - Rates are basis points: `2000` is 20%. Each line's `taxCents` is the VAT its `subtotalCents` contains. - `shippingLine` is `{ name, amountCents, taxRateBp, taxCents }`, or `null` when no shipping applied. - `taxTotalCents` sums the lines' and the shipping line's `taxCents`, and is part of `totalCents`. Every order read returns this shape ([Guide 20](/docs/sdk/features/commerce-customer-accounts)). On the `placeOrder()` result only, `shippingLine` can be absent: read the order again to get it. ## Place the order ```typescript import { isLynkowError } from 'lynkow' try { const order = await lynkow.checkout.placeOrder({ email: 'alice@example.com', address, // the address stored on the cart fulfillmentMode: 'delivery', expectedTotalCents: cart.totalCents, // the total the buyer saw acceptsTerms: true, }) } catch (error) { if (isLynkowError(error) && error.apiCode === 'TOTAL_CHANGED') { const fresh = await lynkow.cart.retrieve() showTotal(fresh.totalCents) // show the new total and ask the buyer to confirm again } else { throw error } } ``` - Checkout reads the market, the shipping and the VAT from the `address` it receives, never from the cart. Send the address the cart holds. - `shippingOptionId` defaults to the cart's choice. Omit it unless you want to override that choice. - The pickup point always comes from the cart: `placeOrder()` takes none. - When the computed total differs from `expectedTotalCents`, checkout refuses with `TOTAL_CHANGED` and creates nothing. The error carries no amount: read the cart again. Without `expectedTotalCents`, checkout compares nothing, so send it from every confirmation page. ### Checkout refusals Each refusal is a `LynkowError` with `code` `VALIDATION_ERROR` (HTTP 422), the reason in `error.apiCode` and the field, when there is one, in `error.details?.[0]?.field`. A refusal creates no order and leaves the cart open. | `apiCode` | `field` | When | What to do | | --- | --- | --- | --- | | `DELIVERY_COUNTRY_REQUIRED` | `address.countryCode` | A delivery order has no country, on a site with markets or VAT. | Ask for the country. | | `MARKET_COUNTRY_NOT_SERVED` | `address.countryCode` | The country is in no active market. | Offer `checkoutCountries` only. | | `PRODUCT_NOT_SOLD_IN_MARKET` | none | An item is not sold in that market. | Tell the buyer which item cannot ship there. | | `SHIPPING_OPTION_INVALID` | `shippingOptionId` | The market has options and none of them is chosen. | List the options again. | | `SHIPPING_UNAVAILABLE` | `address.countryCode` | The market has no option while other markets do. | Offer another country, or pickup. | | `PICKUP_POINT_REQUIRED` | `pickupPointId` | The shipping option delivers to a pickup point and the cart holds none. | Ask the buyer to choose a point. | | `PICKUP_POINT_INVALID` | `pickupPointId` | The point is closed, unknown, or outside the delivery country. | Search again and ask for another point. | | `TOTAL_CHANGED` | `expectedTotalCents` | The total moved. | Show the new total and ask again. | | `DESTINATION_NOT_TAXABLE` | `address.countryCode` | The site computes VAT and the country is outside the EU. | Offer `checkoutCountries` only. | | `TAX_RATE_UNAVAILABLE` | none | No VAT rate can price the order. | Show a generic error. | | `CHECKOUT_TAX_DISABLED` | none | Prices are entered without VAT and the site cannot compute VAT. | Show a generic error: checkout stays closed and the buyer cannot fix it. | | `OUT_OF_STOCK` | none | A line exceeds the stock left, on a site that refuses overselling. | Read the cart again. | A pickup order, collected from the merchant, skips the market, shipping, pickup point and destination checks. The `pickupPointId` field names the cart input that fixes the refusal. The terms and payment refusals are in [Guide 24](/docs/sdk/features/commerce-cart-checkout). ## Next Steps - [Guide 24: Cart and Checkout](/docs/sdk/features/commerce-cart-checkout) - wire the cart and checkout into a Next.js storefront. - [Guide 20: Customer Accounts](/docs/sdk/features/commerce-customer-accounts) - order history and the guest order page. - [Guide 12: Error Handling](/docs/sdk/advanced/error-handling) - `LynkowError` and how to branch on it. --- # SDK Types: Reservation **Published**: 2026-11-30 **Category**: Types ## `AvailabilityFilters` *Interface* Filters for a reservation availability query. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `from` | `string` | No | Range start (inclusive) as a calendar date `'YYYY-MM-DD'`. Required. | | `offeringId` | `string` | Yes | Optional offering id from ReservationsService.offerings: slots then follow that
offering's duration. An id outside the product returns 422 `OFFERING_NOT_FOUND`. | | `partySize` | `number` | Yes | Optional party size (1 to 50). Slots are not filtered by it: compare it with each slot's `seatsRemaining`. | | `to` | `string` | No | Range end (inclusive) as a calendar date `'YYYY-MM-DD'`. Must not precede `from`. A too-wide span is shortened. Required. | --- ## `AvailabilityResponse` *Interface* The availability read response for a bookable product. With a locale, the LocaleResolution fields say which locale was served. Extends: `LocaleResolution` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.
Absent when the request carried no locale. Never `true` with `fallback: false`. | | `locale` | `string` | Yes | BCP 47 locale code of the record actually served (e.g. `'en'`, `'fr'`).
Equals `requestedLocale` unless `isFallback` is `true`. | | `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the
`locale` request option or the client's configured locale.
Absent when the request carried no locale. | | `slots` | `AvailabilitySlot[]` | No | The computed open slots across the effective window, in chronological order. | | `timezone` | `string` | No | IANA timezone the slots are expressed in for display (e.g. `'Europe/Paris'`). | | `window` | `AvailabilityWindow` | No | The effective window the slots cover. Its `to` may be earlier than requested when the span was clamped server-side. | --- ## `AvailabilitySlot` *Interface* A single computed bookable slot for a reservation product. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `available` | `boolean` | No | `true` when the slot can be booked now: a seat is free and the slot is inside the booking window. | | `endsAt` | `string` | No | Slot end as an ISO 8601 datetime. | | `seatsRemaining` | `number` | No | Largest party one booking can take on this slot, never below 0. With several resources, the most seats free on any one. | | `startsAt` | `string` | No | Slot start as an ISO 8601 datetime (e.g. `'2026-07-10T18:00:00.000Z'`). | --- ## `AvailabilityWindow` *Interface* The effective date window the returned availability slots cover. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `from` | `string` | No | Window start as a calendar date `'YYYY-MM-DD'`, echoing the requested `from`. | | `to` | `string` | No | Window end as a calendar date `'YYYY-MM-DD'`. May be earlier than the requested `to` when the server clamps an over-wide span. | --- ## `Booking` *Interface* A booking as returned on creation. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `endsAt` | `string` | No | The booked slot end as an ISO 8601 datetime. | | `guestEmail` | `string` | No | The email the booking was recorded under: the account email for a signed-in buyer, otherwise `guestEmail`. | | `guestName` | `string` | No | The name the booking was recorded under: the account name for a signed-in buyer whose
email is verified and who has one, otherwise the submitted `guestName`. | | `offering` | `Pick` | Yes | The offering booked, with its `label` as it was at booking time. Omitted when the
booking has no offering. | | `partySize` | `number` | No | Number of guests. | | `priceCents` | `number` | Yes | Booking price in cents, set by the server. | | `reference` | `string` | No | Booking reference (`'bkg_...'`) for the buyer's records. | | `resource` | `ReservationResource` | Yes | The booked resource. Present only when the merchant lets buyers pick a resource for
this product, whether the buyer picked it or it was assigned. | | `startsAt` | `string` | No | The booked slot start as an ISO 8601 datetime. | | `status` | `"confirmed"` | No | `'confirmed'`: a booking without an online deposit is confirmed at once. One awaiting
a deposit comes back as `'pending'` through BookingDepositResult. | --- ## `BookingCreateData` *Interface* Input for `book` and `bookings.create`: the slot, party size, contact details and terms acceptance. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `acceptsTerms` | `true` | No | The buyer's acceptance of the site's terms, ticked on the booking page. Only `true` is
accepted (422 `TERMS_NOT_ACCEPTED`); a site with no terms page refuses every booking
(422 `TERMS_PAGE_NOT_CONFIGURED`). | | `guestEmail` | `string` | No | Contact email, at most 320 characters. Replaced by the account email for a signed-in buyer. | | `guestName` | `string` | No | Contact name, 1 to 200 characters. Replaced by the account name for a signed-in buyer
whose email is verified and who has one on file. | | `guestPhone` | `string` | Yes | Optional phone number, 3 to 40 characters. Replaced by the account phone on the same rule as `guestName`. | | `locale` | `string` | Yes | The buyer's language for this booking's emails, a BuyerLocale. Omitted or
empty, the request `locale` option, then the client locale, then the site default apply. | | `offeringId` | `string` | Yes | Optional offering id from ReservationsService.offerings. Required (422
`OFFERING_REQUIRED`) when that list is not empty. The price is always set by the server. | | `partySize` | `number` | No | Number of guests, 1 to 50. Must fit the slot's `seatsRemaining`. | | `resourceId` | `string` | Yes | Optional resource id from ReservationsService.resources. Ignored when that list
is empty; omit it to assign a free resource. An id outside the list returns 422
`RESOURCE_NOT_IN_POOL`. | | `startsAt` | `string` | No | The chosen slot start, copied from an AvailabilitySlot `startsAt`. Full ISO 8601 datetime. | --- ## `BookingDeposit` *Interface* Buyer-facing details required to complete a reservation deposit. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `amountCents` | `number` | No | Deposit amount in minor currency units (for example, cents). Always a positive integer. | | `captureToken` | `string` | No | Short-lived, opaque capability authorizing a guest to refresh this payment.
Pass it unchanged to ReservationsService.refreshPayment after checkout. | | `checkoutUrl` | `string` | No | Opaque hosted-checkout URL where the buyer completes the deposit. | | `currency` | `string` | No | ISO 4217 currency code for the deposit (for example, `'EUR'`). | | `paymentId` | `string` | No | Opaque payment reference (prefixed `'pay_...'`) used by ReservationsService.refreshPayment. | --- ## `BookingDepositResult` *TypeAlias* Result of ReservationsService.book: a `confirmed` Booking, or a `pending` one carrying the `deposit` the buyer must pay at checkout. ```typescript type BookingDepositResult = Booking & { deposit?: never } | Omit & { deposit: BookingDeposit; status: "pending" } ``` --- ## `BuyerLocale` *TypeAlias* The buyer's language, as a BCP 47 tag (for example `'es'`, `'pt-BR'`), normally one of the site's enabled locales. The API keeps it as sent, normalized and capped at 35 characters, and never rejects a value it cannot serve. The buyer emails are sent in that language: their fixed strings exist in the 24 official EU languages and are sent in English beyond them, while the merchant's custom email texts can be written in every site language. ```typescript type BuyerLocale = string ``` --- ## `PaymentRefreshResult` *Interface* Status-only response returned by ReservationsService.refreshPayment. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `bookingStatus` | `"pending" \| "confirmed" \| "completed" \| "cancelled" \| "no_show" \| null` | No | Current reservation lifecycle status. `null` only when no payable reservation was
resolved; normally `pending` before capture and `confirmed` after capture. | | `status` | `PaymentRefreshStatus` | No | Current payment state, or a non-mutating reconciliation outcome. | --- ## `PaymentRefreshStatus` *TypeAlias* Reconciliation outcomes that do not replace the durable PaymentStatus. ```typescript type PaymentRefreshStatus = PaymentStatus | "ignored" | "mismatch" ``` --- ## `PaymentStatus` *TypeAlias* Durable payment lifecycle states exposed to storefront consumers. ```typescript type PaymentStatus = "pending" | "processing" | "captured" | "failed" | "expired" ``` --- ## `ReservationOffering` *Interface* An offering of a bookable product, with its own price, duration and party-size bounds, from ReservationsService.offerings. With a locale, `label` is translated and the LocaleResolution fields say which locale was served. Extends: `LocaleResolution` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `durationMin` | `number` | No | Duration of a booking under this offering, in minutes. | | `id` | `string` | No | Offering id (`'roff_...'`). Pass it as AvailabilityFilters.offeringId and BookingCreateData.offeringId. | | `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.
Absent when the request carried no locale. Never `true` with `fallback: false`. | | `label` | `string` | No | Offering name shown to the buyer. Never empty, at most 255 characters. | | `locale` | `string` | Yes | BCP 47 locale code of the record actually served (e.g. `'en'`, `'fr'`).
Equals `requestedLocale` unless `isFallback` is `true`. | | `maxPartySize` | `number \| null` | No | Maximum party size for this offering, or `null` when the resource capacity is the only ceiling. | | `minPartySize` | `number \| null` | No | Minimum party size for this offering, or `null` when only the global minimum of 1 applies. | | `position` | `number` | No | Merchant-defined display position. Ascending, but not guaranteed to be contiguous. | | `priceCents` | `number` | No | Price the buyer pays, in cents, VAT included when the site charges VAT. Equal to
ReservationOffering.priceGrossCents. `0` for a free offering. | | `priceDisplayMode` | `"inclusive" \| "exclusive"` | No | How the merchant wants prices shown: `'inclusive'` shows the prices with VAT
(`priceGrossCents`), `'exclusive'` without it (`priceNetCents`). `'inclusive'` unless the
merchant chose otherwise. Display only: it never changes the amount charged. | | `priceGrossCents` | `number` | No | ReservationOffering.priceCents with VAT, in cents: equal to `priceCents`. Always at
the merchant country's rate, the rate a booking is charged at. | | `priceNetCents` | `number` | No | ReservationOffering.priceCents without VAT, in cents. Equal to `priceGrossCents` when
no VAT applies. Show it when ReservationOffering.priceDisplayMode is `'exclusive'`. | | `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the
`locale` request option or the client's configured locale.
Absent when the request carried no locale. | --- ## `ReservationResource` *Interface* A resource the buyer can choose for a product (a stylist, a room), from ReservationsService.resources. With a locale, `name` is translated and the LocaleResolution fields say which locale was served. Extends: `LocaleResolution` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `id` | `string` | No | Resource id (`'bres_...'`). Pass it as BookingCreateData.resourceId to book this resource. | | `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.
Absent when the request carried no locale. Never `true` with `fallback: false`. | | `locale` | `string` | Yes | BCP 47 locale code of the record actually served (e.g. `'en'`, `'fr'`).
Equals `requestedLocale` unless `isFallback` is `true`. | | `name` | `string` | No | Display name set by the merchant (e.g. `'Marie'`, `'Room 1'`). Never empty. | | `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the
`locale` request option or the client's configured locale.
Absent when the request carried no locale. | --- # SDK Types: Json-ld **Published**: 2026-11-30 **Category**: Types ## `JsonLdGraphConfig` *Interface* The JSON-LD declared at one cascade level (site, category, page or article). To render a page, read its resolved `structuredData.graph` instead. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `exclusions` | `string[]` | No | `@id` values of parent-level nodes this level drops, including the reserved `auto:` ids of
the nodes Lynkow adds, such as `auto:article`. Empty array when none is dropped. | | `graph` | `JsonLdNode[]` | No | Nodes declared at this level, in output order. Empty array when none is declared. | --- ## `JsonLdNode` *Interface* A JSON-LD node as declared at one level of the structured data cascade (site, category, page or article). The public reads return the resolved nodes, with `@context` and `@id` added, under `structuredData.graph`. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `data` | `Record` | No | Node payload. For `preset`, the preset's fields, unknown keys ignored. For `custom`, the
full schema.org object without `@context` and `@id`, which the server adds. | | `id` | `string` | No | Node id, generated by the server when omitted. The resolved graph turns it into
`#` or `#` depending on JsonLdNode.scope. Never starts with `auto:`. | | `scope` | `"site" \| "page"` | Yes | Base of the resolved `@id`: `'site'` (`#`) or `'page'` (`#`).
When omitted, `site` at site or category level and `page` at page or article level. | | `source` | `JsonLdNodeSource` | No | Whether the node comes from a Lynkow preset or from raw JSON-LD. | | `type` | `string` | No | schema.org `@type`, such as `'Organization'` or `'Product'`. Any type is accepted; a type
with no Lynkow preset passes through with `source: 'custom'`. | --- ## `JsonLdNodeSource` *TypeAlias* Origin of a JSON-LD node: `preset` for a node built from a Lynkow preset (Organization, LocalBusiness, Product...), whose missing fields the server fills from the page; `custom` for a raw schema.org object passed through as written. ```typescript type JsonLdNodeSource = "preset" | "custom" ``` --- # SiteService **Published**: 2026-11-30 **Category**: Services Reads the public site configuration (name, domain, locales, branding, analytics consent mode), available as `lynkow.site`. The client does not cache it: use `fetchOptions` for your framework's cache. Access via: `lynkow.site` ## Methods **2** methods ### `clearCache` ```typescript clearCache(): void ``` Clears the cache entries of this service. `getConfig()` writes none, so this does nothing for a client that never cached a site configuration. Returns: `void` ```typescript lynkow.site.clearCache() ``` --- ### `getConfig` ```typescript getConfig(options?: BaseRequestOptions): Promise ``` Fetches the site's identity, locale settings, branding options and analytics consent mode. Not cached by the client, so a plan or branding change shows on the next call. Throws `LynkowError` `NOT_FOUND` for an unknown site, `FORBIDDEN` for an inactive site or a request origin that does not match the site's domain, and `PAYMENT_REQUIRED` when the subscription no longer covers public delivery. | Parameter | Type | Description | | --- | --- | --- | | `options` | `BaseRequestOptions` | Request options. `fetchOptions` carries framework cache directives, such as `{ next: { revalidate: 3600 } }`. | Returns: `Promise` ```typescript const config = await lynkow.site.getConfig() console.log(config.enabledLocales) // ['en', 'fr', 'de'] console.log(config.i18n.detection.enabled) // true console.log(config.analytics.consentMode) // 'opt-in' ``` --- # SearchService **Published**: 2026-11-30 **Category**: Services Full-text search with typo tolerance over the site's published articles and, when the site opts commerce into search, its products, product categories and product collections. Accessible as `lynkow.search`. Search must be enabled for the site: otherwise every method throws `LynkowError` `SERVICE_UNAVAILABLE`. Access via: `lynkow.search` ## Methods **4** methods ### `getConfig` ```typescript getConfig(options?: BaseRequestOptions): Promise ``` Fetches what a browser needs to query Lynkow search directly: the `host`, a tenant token (`apiKey`) valid for 1 hour and limited to this site's records, and the `indexName`. Fetch it again before the token expires. With `cache: true`, cached for 10 minutes. Throws `LynkowError` `SERVICE_UNAVAILABLE` when search is off for the site or browser search is unavailable. | Parameter | Type | Description | | --- | --- | --- | | `options` | `BaseRequestOptions` | Request options, such as `fetchOptions`. | Returns: `Promise` ```typescript const { host, apiKey, indexName } = await lynkow.search.getConfig() // indexName: 'site_550e8400_e29b_41d4_a716_446655440000' ``` --- ### `listProfiles` ```typescript listProfiles(options?: BaseRequestOptions): Promise ``` Lists the site's public search profiles, the default profile first, then by name. A profile is a search scope set up in the admin, with its own fields, facets, sort and limits: pass its `slug` to SearchService.searchByProfile. With `cache: true`, cached for 10 minutes. Throws `LynkowError` `SERVICE_UNAVAILABLE` when search is off for the site. | Parameter | Type | Description | | --- | --- | --- | | `options` | `BaseRequestOptions` | Request options, such as `fetchOptions`. | Returns: `Promise` ```typescript const profiles = await lynkow.search.listProfiles() for (const profile of profiles) { console.log(profile.slug, profile.name) } ``` --- ### `search` ```typescript search(query: string, options?: SearchOptions): Promise ``` Searches the site through its default search profile. Hits are articles plus, when commerce is opted into search, products, product categories and product collections: check each hit's `type`. Hits come ordered by relevance; treat every hit field as optional. With a locale, a hit untranslated in it is returned with `isFallback: true`. An empty query resolves to no hits. Throws `LynkowError` `SERVICE_UNAVAILABLE` (`apiCode` `INTERNAL_SERVICE_UNAVAILABLE`) when search is off for the site. | Parameter | Type | Description | | --- | --- | --- | | `query` | `string` | The search text. Typos are tolerated: `'pagniation'` finds pagination. | | `options` | `SearchOptions` | `locale`, `fallback: false`, `category`, `tag`, `page`, `limit` and `market`. See SearchOptions. | Returns: `Promise` ```typescript const { data, meta } = await lynkow.search.search('formulaire', { locale: 'fr', category: 'guides', limit: 5, }) for (const hit of data) { console.log(hit._formatted?.title ?? hit.title, hit.path, hit.isFallback) } ``` --- ### `searchByProfile` ```typescript searchByProfile(profileSlug: string, query: string, options?: SearchOptions): Promise ``` Searches through one public search profile, which applies its scope, fields, sort and limits. Options work as on SearchService.search and narrow the profile's scope. On page 1 the profile's featured hits come first, flagged `_isFeatured`, then its boosted hits, flagged `_isBoosted`. Throws `LynkowError` `NOT_FOUND` for an unknown profile or an empty, `'.'` or `'..'` slug, `FORBIDDEN` (`apiCode` `AUTHZ_PERMISSION_DENIED`) for a private one, and `SERVICE_UNAVAILABLE` when search is off. | Parameter | Type | Description | | --- | --- | --- | | `profileSlug` | `string` | The slug of a public profile, such as `'api-docs'`. | | `query` | `string` | The search text. Typos are tolerated. | | `options` | `SearchOptions` | `locale`, `fallback: false`, `category`, `tag`, `page`, `limit` and `market`. See SearchOptions. | Returns: `Promise` ```typescript const results = await lynkow.search.searchByProfile('api-docs', 'pagination', { limit: 10, }) ``` --- # SDK Types: Locale-resolution **Published**: 2026-11-30 **Category**: Types ## `LocaleResolution` *Interface* Locale signals of a read that carried a locale (the `locale` option or the client's locale). When a translation is missing, the API serves the closest one, such as the base language (`fr` for `fr-CA`) or the site default, instead of answering 404. These fields tell you which locale was served. Pass `fallback: false` to get a 404 on a detail read, or to drop the items from a list, instead. A read without a locale may omit these fields. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.
Absent when the request carried no locale. Never `true` with `fallback: false`. | | `locale` | `string` | Yes | BCP 47 locale code of the record actually served (e.g. `'en'`, `'fr'`).
Equals `requestedLocale` unless `isFallback` is `true`. | | `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the
`locale` request option or the client's configured locale.
Absent when the request carried no locale. | --- # SDK Types: Cookies **Published**: 2026-11-30 **Category**: Types ## `ConsentLogOptions` *Interface* Options of CookiesService.logConsent, on top of `locale` and `fetchOptions`. Extends: `BaseRequestOptions` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `action` | `ConsentAction` | Yes | Action to record. Inferred when omitted: `accept_all`, `reject_all` or `customize`, ignoring `necessary`. Pass `'withdraw'` explicitly when revoking a consent. | | `fallback` | `boolean` | Yes | Set `false` to refuse records served in another locale: a detail read then
throws `NOT_FOUND` and a list drops them. Fallback is on by default. Reads
without locale fallback ignore it. | | `fetchOptions` | `RequestInit` | Yes | `fetch()` options for this request, shallow-merged over the client's
`fetchOptions`, such as `{ next: { revalidate: 60 } }`. | | `locale` | `string` | Yes | Locale of this request (e.g. `'fr'`), overriding the client's `locale`.
Reads never reject a locale: a missing translation is served in another
locale and flagged `isFallback: true` (see LocaleResolution). Some
writes, such as `reviews.submit()`, refuse a locale the site does not enable. | | `pageUrl` | `string` | Yes | Absolute `http` or `https` URL of the page, max 2048 characters. Defaults in a browser to the page's origin and path. | | `visitorId` | `string` | Yes | Visitor id, 1 to 64 characters. Defaults in a browser to the id stored under `_lkw_vid` in `localStorage`. Required outside a browser. | --- # SDK Types: Enhancements **Published**: 2026-11-30 **Category**: Types ## `EnhancementsInitOptions` *Interface* Options accepted by EnhancementsService.init. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `activateScripts` | `boolean` | Yes | Runs the inline `` inside a value would end the tag. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `graph` | `object[]` | No | The schema.org nodes of the page's JSON-LD graph, as plain JSON objects, each a
complete node with its own `@context`, `@id` and `@type`. Empty when the page has
no structured data. | --- ## `Product` *Interface* A published product of the storefront catalogue, with buyer-facing fields only. Text, slugs and paths are per locale. A read with a `locale` is served in that locale, or in the closest available one when the product has no translation there: the LocaleResolution fields say which. A product hidden in a locale is not found in that locale. Extends: `LocaleResolution` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `alternates` | `{ current: boolean; locale: string; path: string }[]` | Yes | The product page's path in each locale it is published in, for hreflang links, sent
when the request has a locale. Empty on a fallback. Add `x-default` yourself. | | `availability` | `"out_of_stock" \| "in_stock" \| null` | No | Stock state, never a quantity, and `null` for a bookable product. With variants, it is
`'in_stock'` when any variant is. Untracked stock counts as in stock. | | `brand` | `string \| null` | No | Brand name, or `null` when none is set. | | `canonicalPath` | `string \| null` | Yes | Canonical path of the product page, sent when the request has a locale. Equals `path`,
except on a fallback, where it points at the default-locale URL when one exists. | | `canonicalUrl` | `string \| null` | No | Canonical URL override, or `null` to use Product.path. A fallback product with
no override carries the absolute `canonicalPath` here when the site has a domain. | | `compareAtPriceCents` | `number \| null` | No | Optional strikethrough "was" price in cents, VAT included like Product.priceCents:
equal to Product.compareAtPriceGrossCents. `null` when there is no comparison price. | | `compareAtPriceGrossCents` | `number \| null` | No | Product.compareAtPriceCents with VAT, in cents: equal to `compareAtPriceCents`, `null` when there is no comparison price. | | `compareAtPriceNetCents` | `number \| null` | No | Product.compareAtPriceCents without VAT, in cents, or `null` when there is no comparison price. | | `currency` | `string` | No | ISO 4217 currency code (e.g. `'EUR'`). | | `description` | `string \| null` | No | Long product description in the served locale, or `null` when the merchant left it empty. | | `gallery` | `ProductGalleryImage[]` | No | The images of Product.images, in the same order, with their alt text and caption. Empty when the product has no images. | | `gtin` | `string \| null` | No | Global Trade Item Number (8, 12, 13 or 14 digits with a valid check digit), or `null` when none is set. A variant may carry its own: see ProductVariant.gtin. | | `id` | `string` | No | The product id as a prefixed wire id (e.g. `'prod_...'`). Stable; safe to store and link. | | `images` | `string[]` | No | Ordered public image URLs, or an empty array when the product has no images. | | `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.
Absent when the request carried no locale. Never `true` with `fallback: false`. | | `keywords` | `string \| null` | No | Comma-separated SEO keywords (e.g. `'mug, ceramic, kitchen'`), or `null` when none are set. Suited to ``. | | `kind` | `"standard" \| "bookable"` | No | `'standard'` for a regular product, `'bookable'` for one booked by time slot through `lynkow.reservations`. | | `locale` | `string` | Yes | BCP 47 locale code of the record actually served (e.g. `'en'`, `'fr'`).
Equals `requestedLocale` unless `isFallback` is `true`. | | `mpn` | `string \| null` | No | Manufacturer Part Number, or `null` when none is set. A variant may carry its own: see ProductVariant.mpn. | | `noFollow` | `boolean` | No | When `true`, the merchant asked search engines not to follow the links of this product: render ``. Never `null`. | | `noIndex` | `boolean` | No | When `true`, the merchant asked search engines not to index this product: render ``. Never `null`. | | `ogDescription` | `string \| null` | No | Open Graph description used when the product is shared on social networks, or `null` when unset (fall back to `seoDescription`). | | `ogImage` | `string \| null` | No | Public Open Graph image URL, or `null` when none is set (fall back to Product.thumbnail). | | `ogImageAlt` | `string \| null` | No | Alternative text of the Open Graph image, suited to `og:image:alt`, or `null` when none is set. | | `ogTitle` | `string \| null` | No | Open Graph title used when the product is shared on social networks, or `null` when unset (fall back to `seoTitle`, then `title`). | | `path` | `string` | No | URL path of the product page in the requested locale (e.g. `'/fr/produits/mug-bleu'`),
built from the site's commerce URL settings. Link with it rather than building a URL
from the slug. | | `priceCents` | `number` | No | Price in cents, VAT included: equals `priceGrossCents`. With variants, it is the base
"from" price, and each ProductVariant.priceCents is the selling price. | | `priceDisplayMode` | `"inclusive" \| "exclusive"` | No | How the merchant wants prices shown, one value for the whole site: `'inclusive'` shows
`priceGrossCents`, `'exclusive'` shows `priceNetCents`. It never changes the amount charged. | | `priceGrossCents` | `number` | No | Product.priceCents with VAT, at the rate of the request's `country`, else the
merchant's country (always the merchant's for a bookable product). The cart applies
the delivery country's rate instead. | | `priceNetCents` | `number` | No | Product.priceCents without VAT, in cents. Show it when
Product.priceDisplayMode is `'exclusive'`. | | `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the
`locale` request option or the client's configured locale.
Absent when the request carried no locale. | | `seoDescription` | `string \| null` | No | SEO meta description, or `null` when unset. | | `seoTitle` | `string \| null` | No | SEO title override, or `null` when unset (fall back to `title`). | | `sku` | `string \| null` | No | Catalogue SKU, or `null` when unset. | | `slug` | `string` | No | Slug in the served locale: the translated slug when the product is translated, else
the source slug. Accepted by `products.getBySlug()`. | | `structuredData` | `CommerceStructuredData` | Yes | The product page's structured data (JSON-LD). Present on the single read
(`products.getBySlug()`) only, never on the rows of `products.list()`. | | `thumbnail` | `string \| null` | No | The primary image URL (mirror of `images[0]`), or `null` when there are no images. | | `title` | `string` | No | Product title in the served locale (see LocaleResolution.locale). Always non-empty for a published product. | | `twitterCard` | `"summary" \| "summary_large_image" \| "app" \| "player" \| null` | No | `` value used when the product is shared on social networks, or `null` when unset. | | `variants` | `ProductVariant[]` | No | Product variants, ordered by position. Empty when the product has none. | --- ## `ProductGalleryImage` *Interface* One product gallery image with its display metadata. The same image also appears, in the same order, as a bare URL in Product.images. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `alt` | `string \| null` | No | Merchant-provided alt text for the image, or `null` when unset. Use it for ``; fall back to the product `title` when null. Max 255 chars. | | `caption` | `string \| null` | No | Merchant-provided caption, or `null` when unset. Suited to a `
`. Max 500 chars. | | `url` | `string` | No | Public image URL, served from the Lynkow media library. Same value as the corresponding `images[n]` entry. | --- ## `ProductsFilters` *Interface* Filters for a storefront product listing. All optional. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `category` | `string` | Yes | Restrict to one category and its visible sub-categories: its `'pcat_...'` wire id or its slug. | | `collection` | `string` | Yes | Restrict to one collection: its `'col_...'` wire id or its slug. | | `kind` | `"standard" \| "bookable"` | Yes | Restrict to a product kind: `'standard'` or `'bookable'`. | | `limit` | `number` | Yes | Items per page. Defaults to 20, max 100. | | `page` | `number` | Yes | Page number (1-based). Defaults to 1. | | `search` | `string` | Yes | Case-insensitive text matched within the title or slug (the translated ones with a `locale`). Max 200 characters. | | `sortBy` | `"title" \| "price_cents" \| "created_at"` | Yes | Sort field: `'title'`, `'price_cents'`, or `'created_at'`. Defaults to `'created_at'`. | | `sortOrder` | `"asc" \| "desc"` | Yes | Sort direction: `'asc'` or `'desc'`. Defaults to `'desc'`. | --- ## `ProductsListResponse` *Interface* Paginated product list response: the products on the page plus pagination metadata. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `data` | `Product[]` | No | The published products on this page. | | `meta` | `PaginationMeta` | No | Pagination info: `total`, `currentPage`, `lastPage` and `perPage`. | --- ## `ProductVariant` *Interface* A purchasable variant of a product. Present only for published products on sites with variants enabled; a product without variants has an empty array. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `availability` | `"out_of_stock" \| "in_stock"` | Yes | Stock state of this variant, never a quantity. Untracked stock is in stock, zero or
less is out of stock even when overselling is allowed. Absent when the site does not
enforce stock: treat it as unknown. | | `compareAtPriceCents` | `number \| null` | No | Optional strikethrough "was" price in cents, VAT included like
ProductVariant.priceCents: equal to ProductVariant.compareAtPriceGrossCents.
`null` when there is no comparison price. | | `compareAtPriceGrossCents` | `number \| null` | No | ProductVariant.compareAtPriceCents with VAT, in cents: equal to `compareAtPriceCents`, `null` when there is no comparison price. | | `compareAtPriceNetCents` | `number \| null` | No | ProductVariant.compareAtPriceCents without VAT, in cents, or `null` when there is no comparison price. | | `gallery` | `ProductGalleryImage[]` | No | The images the variant selects, or the full product gallery when it selects none.
Prefer it over Product.gallery for the selected variant. | | `gtin` | `string \| null` | No | Global Trade Item Number of the variant (8, 12, 13 or 14 digits with a valid check digit), or `null` when the variant uses the product's Product.gtin. | | `id` | `string` | No | The variant id as a prefixed wire id (e.g. `'var_...'`). Stable; safe to store and link. | | `mpn` | `string \| null` | No | Manufacturer Part Number of the variant, or `null` when the variant uses the product's Product.mpn. | | `optionValues` | `ProductVariantOptionValue[]` | No | The option values this variant represents, ordered by option position. | | `position` | `number` | No | Display order within the product (ascending). | | `priceCents` | `number` | No | Selling price of the variant in cents, VAT included: equals `priceGrossCents`. | | `priceDisplayMode` | `"inclusive" \| "exclusive"` | No | Same value as Product.priceDisplayMode: which price to show. It never changes the amount charged. | | `priceGrossCents` | `number` | No | ProductVariant.priceCents with VAT, at the rate of the request's `country`, else
the merchant's country. The cart applies the delivery country's rate instead. | | `priceNetCents` | `number` | No | ProductVariant.priceCents without VAT, in cents. Show it when
ProductVariant.priceDisplayMode is `'exclusive'`. | | `sku` | `string \| null` | No | Variant SKU, or `null` when unset. | | `title` | `string` | No | Display title, e.g. `'M / Red'`. | --- ## `ProductVariantOptionValue` *Interface* One selected option value carried by a variant (e.g. Size: M). | Property | Type | Optional | Description | | --- | --- | --- | --- | | `option` | `string` | No | The option (axis) label, e.g. `'Size'`. | | `value` | `string` | No | The selected value label, e.g. `'M'`. | --- # SDK Types: Pickup-point **Published**: 2026-11-30 **Category**: Types ## `PickupPoint` *Interface* A pickup point returned by PickupPointsService.search. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `address` | `PickupPointAddress` | No | Public address of the point. | | `carrier` | `string` | No | Code of the carrier the point belongs to, a stable machine value. Compare it, never display it. | | `distanceMeters` | `number \| null` | No | Distance in meters from the searched postcode or coordinates, or `null` when unknown. | | `id` | `string` | No | Identifier of the point. Send it as `pickupPointId` to `lynkow.cart.update()` to store
the buyer's choice. Opaque: never parse it. | | `latitude` | `number \| null` | No | Latitude of the point, or `null` when unknown. | | `longitude` | `number \| null` | No | Longitude of the point, or `null` when unknown. | | `name` | `string` | No | Name of the point to show the buyer. | | `openingHours` | `PickupPointOpeningHours[] \| null` | No | Opening periods, or `null` when unknown. | --- ## `PickupPointAddress` *Interface* Public address of a PickupPoint. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `address1` | `string` | No | Primary street address. | | `address2` | `string \| null` | No | Additional street address details, or `null` when the point has none. | | `city` | `string` | No | City or locality. | | `countryCode` | `string` | No | Uppercase ISO 3166-1 alpha-2 country code (e.g. `'FR'`). | | `postalCode` | `string` | No | Postal or ZIP code. | --- ## `PickupPointList` *Interface* The points found by PickupPointsService.search, nearest first, not paginated. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `data` | `PickupPoint[]` | No | The points, nearest first. Empty when none was found near the searched place. | --- ## `PickupPointOpeningHours` *Interface* One opening period of a PickupPoint, in the point's local time. A day open twice, such as morning and afternoon, has two entries. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `closes` | `string` | No | Closing time, `'HH:MM'` (e.g. `'12:30'`). | | `day` | `number` | No | ISO weekday, from 1 for Monday to 7 for Sunday. | | `opens` | `string` | No | Opening time, `'HH:MM'` (e.g. `'09:00'`). | --- ## `PickupPointSearchBase` *Interface* Fields shared by both forms of PickupPointSearchOptions. Extends: `BaseRequestOptions` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `countryCode` | `string` | No | ISO 3166-1 alpha-2 country code to search in (e.g. `'FR'`). Required in both forms. | | `fallback` | `boolean` | Yes | Set `false` to refuse records served in another locale: a detail read then
throws `NOT_FOUND` and a list drops them. Fallback is on by default. Reads
without locale fallback ignore it. | | `fetchOptions` | `RequestInit` | Yes | `fetch()` options for this request, shallow-merged over the client's
`fetchOptions`, such as `{ next: { revalidate: 60 } }`. | | `limit` | `number` | Yes | Maximum number of points to return, from 1 to 30. The API returns 10 when omitted. | | `locale` | `string` | Yes | Locale of this request (e.g. `'fr'`), overriding the client's `locale`.
Reads never reject a locale: a missing translation is served in another
locale and flagged `isFallback: true` (see LocaleResolution). Some
writes, such as `reviews.submit()`, refuse a locale the site does not enable. | | `shippingOptionId` | `string` | No | The `shp_...` id of the shipping option the buyer chose. It must deliver to a pickup point. | --- ## `PickupPointSearchOptions` *TypeAlias* What PickupPointsService.search takes: the shipping option and country, then either a `postalCode` or a `latitude` with a `longitude`. TypeScript refuses a mix of the two forms. ```typescript type PickupPointSearchOptions = PickupPointSearchBase & { latitude?: never; longitude?: never; postalCode: string } | PickupPointSearchBase & { latitude: number; longitude: number; postalCode?: never } ``` --- ## `SelectedPickupPoint` *Interface* The pickup point the buyer chose, as stored on the order and on each of its shipments. It carries no distance and no opening hours: search again with PickupPointsService.search to show those. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `address` | `SelectedPickupPointAddress` | No | Public address of the point. | | `carrier` | `string` | No | Code of the carrier the point belongs to, a stable machine value. Compare it, never display it. | | `id` | `string` | No | Identifier of the point, the `id` of the PickupPoint the buyer chose. | | `lat` | `number` | No | Latitude of the point, in decimal degrees. | | `lng` | `number` | No | Longitude of the point, in decimal degrees. | | `name` | `string` | No | Name of the point to show the buyer. | --- ## `SelectedPickupPointAddress` *Interface* Public address of a SelectedPickupPoint. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `address1` | `string` | No | Primary street address. | | `address2` | `string` | Yes | Additional street address details. Absent when the point has none. | | `city` | `string` | No | City or locality. | | `countryCode` | `string` | No | Uppercase ISO 3166-1 alpha-2 country code (e.g. `'FR'`). | | `postalCode` | `string` | No | Postal or ZIP code. | --- # SDK Types: Market **Published**: 2026-11-30 **Category**: Types ## `Market` *Interface* One active market of the site, as `lynkow.markets.list()` returns it: a group of countries the merchant sells into, with the languages and the currency they share. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `countries` | `string[]` | No | ISO 3166-1 alpha-2 codes of the countries this market delivers to, upper case and
sorted (e.g. `['BE', 'FR', 'LU']`). A country belongs to at most one market of the
site. Empty when the merchant has not added a country to the market yet. | | `currency` | `string` | No | ISO 4217 currency code of the market (e.g. `'EUR'`), always the site's currency, so
every amount the site returns is in it. | | `defaultLocale` | `string` | No | The language to propose first in this market: a BCP 47 code, always one of `locales`. | | `id` | `string` | No | Opaque market id, prefixed `'mkt_'` (e.g. `'mkt_01j9z3k4m5n6p7q8r9s0t1v2w3'`). Stable;
safe to store. It is the value the storefront catalogue and search reads accept as
their `market` parameter. | | `locales` | `string[]` | No | BCP 47 language codes the market offers (e.g. `['fr', 'en']`), to propose to a buyer
in one of its countries. Never empty; chosen from the site's enabled languages when
the merchant saves the market. | | `name` | `string` | No | Market name as the merchant set it (e.g. `'Europe'`). Always non-empty, at most 120 characters. | --- ## `MarketList` *Interface* The response of `lynkow.markets.list()`: the site's active markets, oldest first, and in `meta` the delivery countries checkout accepts. Not paginated: `data` holds every active market. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `data` | `Market[]` | No | Every active market of the site, oldest first. Empty when the site has none active. | | `meta` | `{ checkoutCountries: string[] \| null }` | Yes | Sent on every response. Typed optional so that a `MarketList` you build yourself, in a
test for example, can leave it out. | --- # SDK Types: Filters & Options **Published**: 2026-11-30 **Category**: Types ## `BaseRequestOptions` *Interface* Per-request options accepted by every read, overriding the client's settings. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `fallback` | `boolean` | Yes | Set `false` to refuse records served in another locale: a detail read then
throws `NOT_FOUND` and a list drops them. Fallback is on by default. Reads
without locale fallback ignore it. | | `fetchOptions` | `RequestInit` | Yes | `fetch()` options for this request, shallow-merged over the client's
`fetchOptions`, such as `{ next: { revalidate: 60 } }`. | | `locale` | `string` | Yes | Locale of this request (e.g. `'fr'`), overriding the client's `locale`.
Reads never reject a locale: a missing translation is served in another
locale and flagged `isFallback: true` (see LocaleResolution). Some
writes, such as `reviews.submit()`, refuse a locale the site does not enable. | --- ## `CategoryOptions` *Interface* Options of `categories.getBySlug()`: the pagination of the category's articles, up to 500 per page. Extends: `PaginationOptions` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `limit` | `number` | Yes | Items per page. Defaults to `20`, at most `100`: a larger value throws
`VALIDATION_ERROR`. `categories.getBySlug()` defaults to and allows up to `500`. | | `locale` | `string` | Yes | Locale of this request, for the category and its articles. | | `page` | `number` | Yes | Page number, from 1. Defaults to `1`. A page past the last one returns an
empty `data` array. | | `perPage` | `number` | Yes | Alias of limit, which wins when both are set. | --- ## `ContentsFilters` *Interface* Filters of `contents.list()`, combined with AND. Extends: `PaginationOptions`, `SortOptions` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `category` | `string` | Yes | Keeps the articles of the category with this slug. | | `limit` | `number` | Yes | Items per page. Defaults to `20`, at most `100`: a larger value throws
`VALIDATION_ERROR`. `categories.getBySlug()` defaults to and allows up to `500`. | | `locale` | `string` | Yes | Locale of this request. `options.locale` takes precedence over it. | | `order` | `"asc" \| "desc"` | Yes | Sort direction, `'asc'` or `'desc'`. Defaults to `'desc'`. | | `page` | `number` | Yes | Page number, from 1. Defaults to `1`. A page past the last one returns an
empty `data` array. | | `perPage` | `number` | Yes | Alias of limit, which wins when both are set. | | `search` | `string` | Yes | Text matched against the title and the slug, case-insensitively and in
part. An empty string is ignored. | | `sort` | `string` | Yes | Column to sort by, in snake_case. Articles accept `'published_at'`
(default), `'created_at'`, `'updated_at'`, `'title'`, `'slug'` and
`'display_order'`. Reviews accept `'created_at'` (default), `'rating'`,
`'author_name'`, `'review_date'` and `'display_order'`. | | `tag` | `string` | Yes | Keeps the articles carrying the tag with this slug. | --- ## `PaginationOptions` *Interface* Pagination of a list. Pages start at 1. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `limit` | `number` | Yes | Items per page. Defaults to `20`, at most `100`: a larger value throws
`VALIDATION_ERROR`. `categories.getBySlug()` defaults to and allows up to `500`. | | `page` | `number` | Yes | Page number, from 1. Defaults to `1`. A page past the last one returns an
empty `data` array. | | `perPage` | `number` | Yes | Alias of limit, which wins when both are set. | --- ## `PathsListOptions` *Interface* Options for `paths.list()`: the base request options plus the commerce opt-in. Extends: `BaseRequestOptions` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `fallback` | `boolean` | Yes | Set `false` to refuse records served in another locale: a detail read then
throws `NOT_FOUND` and a list drops them. Fallback is on by default. Reads
without locale fallback ignore it. | | `fetchOptions` | `RequestInit` | Yes | `fetch()` options for this request, shallow-merged over the client's
`fetchOptions`, such as `{ next: { revalidate: 60 } }`. | | `include` | `"commerce"` | Yes | `'commerce'` adds the published product paths, and the visible product
category and collection paths when the site uses them, after the article
and category paths. | | `locale` | `string` | Yes | Locale of this request (e.g. `'fr'`), overriding the client's `locale`.
Reads never reject a locale: a missing translation is served in another
locale and flagged `isFallback: true` (see LocaleResolution). Some
writes, such as `reviews.submit()`, refuse a locale the site does not enable. | --- ## `ReviewsFilters` *Interface* Filters of `reviews.list()`, which returns approved reviews only. Extends: `PaginationOptions`, `SortOptions` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `language` | `string` | Yes | Keeps only the reviews served in this locale (e.g. `'fr'`), ignoring case,
after the request `locale` has chosen each review's translation. The `meta`
figures follow it. An unknown value matches no review. | | `limit` | `number` | Yes | Items per page. Defaults to `20`, at most `100`: a larger value throws
`VALIDATION_ERROR`. `categories.getBySlug()` defaults to and allows up to `500`. | | `maxRating` | `number` | Yes | Highest rating kept, from 1 to 5, inclusive. | | `minRating` | `number` | Yes | Lowest rating kept, from 1 to 5, inclusive. | | `order` | `"asc" \| "desc"` | Yes | Sort direction, `'asc'` or `'desc'`. Defaults to `'desc'`. | | `page` | `number` | Yes | Page number, from 1. Defaults to `1`. A page past the last one returns an
empty `data` array. | | `perPage` | `number` | Yes | Alias of limit, which wins when both are set. | | `product` | `string` | Yes | Keeps the reviews of one product, by its `prod_...` ID or its slug. An
unknown or unpublished product throws `NOT_FOUND`, never an empty list. | | `sort` | `string` | Yes | Column to sort by, in snake_case. Articles accept `'published_at'`
(default), `'created_at'`, `'updated_at'`, `'title'`, `'slug'` and
`'display_order'`. Reviews accept `'created_at'` (default), `'rating'`,
`'author_name'`, `'review_date'` and `'display_order'`. | --- ## `SortOptions` *Interface* Sort options of a list. A value the list does not accept throws `VALIDATION_ERROR`. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `order` | `"asc" \| "desc"` | Yes | Sort direction, `'asc'` or `'desc'`. Defaults to `'desc'`. | | `sort` | `string` | Yes | Column to sort by, in snake_case. Articles accept `'published_at'`
(default), `'created_at'`, `'updated_at'`, `'title'`, `'slug'` and
`'display_order'`. Reviews accept `'created_at'` (default), `'rating'`,
`'author_name'`, `'review_date'` and `'display_order'`. | --- ## `SubmitOptions` *Interface* Spam protection options of a submission. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `recaptchaToken` | `string` | Yes | reCAPTCHA token, required when the site or form uses reCAPTCHA. A v3
token must carry the method's action: `form_submit`, `review_submit`,
`booking_create`, `customer_register`, `password_reset_request` or
`checkout`. The SDK sends the token you create, it never creates one. | --- ## `TagsListFilters` *Interface* Filters of `tags.list()`: pagination and locale. Extends: `PaginationOptions` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `limit` | `number` | Yes | Items per page. Defaults to `20`, at most `100`: a larger value throws
`VALIDATION_ERROR`. `categories.getBySlug()` defaults to and allows up to `500`. | | `locale` | `string` | Yes | Locale of this request. `options.locale` takes precedence over it. | | `page` | `number` | Yes | Page number, from 1. Defaults to `1`. A page past the last one returns an
empty `data` array. | | `perPage` | `number` | Yes | Alias of limit, which wins when both are set. | --- ## `TimedSubmitOptions` *Interface* Options for submissions whose anti-spam check also measures how long the visitor took to fill the form: `forms.submit`, `reviews.submit`, `reservations.book` and `reservations.bookings.create`. Extends: `SubmitOptions` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `formStartedAt` | `number` | Yes | When the visitor started the form, in whole Unix milliseconds, sent as `_ts`.
Defaults to the client's creation time, capped at 55 minutes ago, so a client
built per request must pass it or is refused as too fast. | | `recaptchaToken` | `string` | Yes | reCAPTCHA token, required when the site or form uses reCAPTCHA. A v3
token must carry the method's action: `form_submit`, `review_submit`,
`booking_create`, `customer_register`, `password_reset_request` or
`checkout`. The SDK sends the token you create, it never creates one. | --- # SDK Types: Customer **Published**: 2026-11-30 **Category**: Types ## `Customer` *Interface* The signed-in buyer, as returned by `activation.confirm`, `login`, `me` and `updateMe`. The profile fields read `null` until `emailVerified` is `true`. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `companyName` | `string \| null` | No | Company name of a business buyer. `null` for a personal account or while the email is unverified. | | `createdAt` | `string` | No | ISO 8601 datetime the customer record was created, by a guest booking or by signup. | | `email` | `string` | No | Account email, trimmed and lower-cased. The login identifier. Max 320 characters. | | `emailVerified` | `boolean` | No | `true` once the buyer has proven they control `email`. | | `firstName` | `string \| null` | No | First name. `null` when never provided or while the email is unverified. | | `hasAccount` | `boolean` | No | `true` once the buyer has completed `activation.confirm`, verified their email or
reset their password. A guest record created by a booking reads `false`. | | `id` | `string` | No | Customer id (`'cust_...'`), stable across sessions. | | `lastName` | `string \| null` | No | Last name. `null` when never provided or while the email is unverified. | | `phone` | `string \| null` | No | Phone number in free form, 3 to 40 characters. `null` when never provided or while the email is unverified. | | `preferredLocale` | `string \| null` | No | Preferred language as a normalized BCP 47 tag (e.g. `'pt-BR'`), used for account
emails. `null` when unset (the site default applies) or while the email is unverified. | | `termsAcceptance` | `TermsAcceptance \| null` | Yes | The accepted terms version, its language, the mode and the date. `null` when no terms were accepted. | | `termsAcceptedAt` | `string \| null` | No | ISO 8601 datetime the buyer accepted the shop's terms at activation. `null` for a guest never activated. | --- ## `CustomerActivationConfirmInput` *Interface* Input for `activation.confirm`: the token from the activation link, the password, the terms acceptance, and the optional profile and marketing consent. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `acceptsTerms` | `true` | No | The buyer's acceptance of the shop's terms, ticked on the activation page. Only `true` is accepted. | | `consentVersion` | `string` | Yes | Optional label of the consent text shown (e.g. `'newsletter-2026-10'`), cut to 100
characters. Stored only when `marketingOptIn` is `true`. | | `firstName` | `string` | Yes | Optional first name, at most 100 characters. Applied only when the account has none on file. | | `lastName` | `string` | Yes | Optional last name, at most 100 characters. Applied only when the account has none on file. | | `locale` | `string` | Yes | Optional language tag of the activation page (e.g. `'pt-BR'`). Stored as the buyer's
preferred language. An unusable value is ignored, never an error. | | `marketingOptIn` | `boolean` | Yes | Optional marketing opt-in. When `true`, opts the buyer in on every channel that has
no recorded choice yet; an existing opt-in or opt-out is kept. | | `password` | `string` | No | Chosen password, 8 to 100 characters. | | `phone` | `string` | Yes | Optional phone number, 3 to 40 characters. Applied only when the account has none on file. | | `token` | `string` | No | The single-use activation token from the emailed link. | --- ## `CustomerAddress` *Interface* A saved postal address in the authenticated buyer's address book. Optional address fields are returned as `null`, never omitted. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `address1` | `string` | No | Street line 1 (number and street). Always set. Max 255 characters. | | `address2` | `string \| null` | No | Street line 2 (apartment, floor, building). `null` when not needed. Max 255 characters. | | `addressName` | `string \| null` | No | Buyer-chosen label such as `Home` or `Office`. `null` when the buyer did not name it. | | `city` | `string` | No | City or town. Always set. Max 120 characters. | | `company` | `string \| null` | No | Company name for a business delivery. `null` for a personal address. Max 180 characters. | | `countryCode` | `string` | No | ISO 3166-1 alpha-2 country code in uppercase (for example `FR`). | | `createdAt` | `string` | No | ISO 8601 creation datetime (for example `2026-07-20T10:30:00.000Z`). | | `firstName` | `string` | No | Recipient first name. Always set. Max 120 characters. | | `id` | `string` | No | Prefixed wire identifier (for example `addr_01h9kz...`). Stable for the life of the address. | | `isDefaultBilling` | `boolean` | No | `true` for the buyer's at-most-one default billing address. | | `isDefaultShipping` | `boolean` | No | `true` for the buyer's at-most-one default shipping address. | | `lastName` | `string` | No | Recipient last name. Always set. Max 120 characters. | | `phone` | `string \| null` | No | Contact phone for the delivery. `null` when not provided. Max 32 characters. | | `postalCode` | `string` | No | Postal or ZIP code as unvalidated free-form text. Always set. Max 32 characters. | | `province` | `string \| null` | No | Province, state, or region. `null` in countries that do not use one. Max 120 characters. | | `updatedAt` | `string` | No | ISO 8601 datetime of the last edit. Equal to `createdAt` until the address is edited. | --- ## `CustomerAddressInput` *Interface* Fields accepted when saving a new buyer address. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `address1` | `string` | No | Street line 1. Required. Max 255 characters. | | `address2` | `string \| null` | Yes | Street line 2 (apartment, floor). Pass `null` to clear it. Max 255 characters. | | `addressName` | `string \| null` | Yes | Optional label such as `Home`. Pass `null` to leave the address unlabeled. Max 120 characters. | | `city` | `string` | No | City or town. Required. Max 120 characters. | | `company` | `string \| null` | Yes | Company name for a business delivery. Pass `null` to clear it. Max 180 characters. | | `countryCode` | `string` | No | ISO 3166-1 alpha-2 country code. The API normalizes it to uppercase. | | `firstName` | `string` | No | Recipient first name. Required. Max 120 characters. | | `isDefaultBilling` | `boolean` | Yes | Mark this address as the default billing address, unsetting the previous one. | | `isDefaultShipping` | `boolean` | Yes | Mark this address as the default shipping address, unsetting the previous one. | | `lastName` | `string` | No | Recipient last name. Required. Max 120 characters. | | `metadata` | `Record` | Yes | Optional buyer-supplied extension data stored with the address but not returned by storefront reads. | | `phone` | `string \| null` | Yes | Contact phone for the delivery. Pass `null` to clear it. Max 32 characters. | | `postalCode` | `string` | No | Postal or ZIP code. Required. Max 32 characters. | | `province` | `string \| null` | Yes | Province, state, or region. Pass `null` to clear it. Max 120 characters. | --- ## `CustomerAddressUpdateInput` *TypeAlias* Partial address edit. At least one field must be present or the API returns HTTP 422. ```typescript type CustomerAddressUpdateInput = AtLeastOne ``` --- ## `CustomerAuthResult` *Interface* The result of `activation.confirm` or `login`. The SDK keeps `token` in client memory and sends it on account calls; store it yourself to keep the buyer signed in across reloads. `register` returns no session. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `customer` | `Customer` | No | The signed-in buyer. | | `token` | `string` | No | Session token. Pass it back with `createClient({ customerToken })` to restore the session. | --- ## `CustomerBooking` *TypeAlias* A booking in the `me` history: its reference, slot, party size and status. Contact details and the booked resource are not included. ```typescript type CustomerBooking = Pick & { status: CustomerBookingStatus } ``` --- ## `CustomerBookingStatus` *TypeAlias* Status of a booking in the `me` history. `'pending'` means a required deposit is not paid yet. ```typescript type CustomerBookingStatus = "pending" | "confirmed" | "cancelled" | "completed" | "no_show" ``` --- ## `CustomerEmailVerificationResult` *Interface* The result of `verifyEmail`. An invalid, expired or used token throws instead. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `emailVerified` | `boolean` | No | Always `true` on success. | --- ## `CustomerLoginInput` *Interface* Credentials for `login`. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `email` | `string` | No | Account email. | | `password` | `string` | No | Account password. | --- ## `CustomerLogoutOptions` *Interface* Options for `logout`. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `everywhere` | `boolean` | Yes | `true` revokes every session token of the buyer on the server, then clears the local
one. Omitted or `false`, only the local token is cleared, with no request. | --- ## `CustomerProfileUpdateInput` *Interface* Input for `customers.updateMe`. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `preferredLocale` | `string \| null` | No | Preferred language tag for account emails: letters, digits, `-` and `_`, 1 to 35
characters (e.g. `'pt-BR'`). `null` or `''` clears it. The key is required. | --- ## `CustomerRegisterInput` *Interface* Input for `register`: only the email to send the activation link to. The password, terms, profile and consent go to CustomerActivationConfirmInput. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `email` | `string` | No | Account email, trimmed and lower-cased by the server. The login identifier. | --- ## `CustomerSession` *Interface* The result of `me`: the signed-in buyer and their bookings. Until the email is verified, only bookings made while signed in are listed. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `bookings` | `CustomerBooking[]` | No | Up to 100 bookings, latest start first. | | `customer` | `Customer` | No | The signed-in buyer. | --- ## `CustomerSpamOptions` *Interface* Options for the anti-spam protected customer calls: `register`, `passwordReset.request` and the address-book writes. Extends: `SubmitOptions`, `BaseRequestOptions` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `fallback` | `boolean` | Yes | Set `false` to refuse records served in another locale: a detail read then
throws `NOT_FOUND` and a list drops them. Fallback is on by default. Reads
without locale fallback ignore it. | | `fetchOptions` | `RequestInit` | Yes | `fetch()` options for this request, shallow-merged over the client's
`fetchOptions`, such as `{ next: { revalidate: 60 } }`. | | `formStartedAt` | `number` | Yes | Epoch milliseconds when the buyer started the form. Defaults to client creation,
capped at 55 minutes ago. Pass it when the site uses custom anti-spam timing. | | `locale` | `string` | Yes | Locale of this request (e.g. `'fr'`), overriding the client's `locale`.
Reads never reject a locale: a missing translation is served in another
locale and flagged `isFallback: true` (see LocaleResolution). Some
writes, such as `reviews.submit()`, refuse a locale the site does not enable. | | `recaptchaToken` | `string` | Yes | reCAPTCHA token, required when the site or form uses reCAPTCHA. A v3
token must carry the method's action: `form_submit`, `review_submit`,
`booking_create`, `customer_register`, `password_reset_request` or
`checkout`. The SDK sends the token you create, it never creates one. | --- ## `MarketingChannel` *TypeAlias* A marketing channel the buyer can consent to. More channels may be added to this union. ```typescript type MarketingChannel = "whatsapp" | "email" ``` --- ## `MarketingConsentList` *Interface* The consent read/write response: one entry per channel in MarketingChannel. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `channels` | `MarketingConsentState[]` | No | Per-channel effective consent, one entry for every known channel. | --- ## `MarketingConsentState` *Interface* The consent state of one marketing channel. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `channel` | `MarketingChannel` | No | The channel this entry describes. | | `optedIn` | `boolean` | No | `true` when the buyer's latest choice on this channel is an opt-in. `false` when no choice is recorded. | --- ## `MarketingConsentUpdateInput` *Interface* Input for `marketingConsent.update`. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `channel` | `MarketingChannel \| "all"` | No | The channel to change, or the literal `'all'` to change every channel at once. | | `consentVersion` | `string` | Yes | Optional label of the consent text shown, cut to 100 characters. Stored with an
opt-in; an opt-out keeps the earlier value. | | `locale` | `string` | Yes | Optional language tag the consent was given in (e.g. `'pt-BR'`). Stored with an
opt-in; an unusable value is ignored, never an error. | | `optIn` | `boolean` | No | `true` opts the buyer in on the target channels, `false` opts them out. | --- ## `PasswordResetConfirmInput` *Interface* Input for `passwordReset.confirm`. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `password` | `string` | No | The new password, 8 to 100 characters. | | `token` | `string` | No | The single-use reset token from the emailed link. | --- ## `PasswordResetRequestInput` *Interface* Input for `passwordReset.request`. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `email` | `string` | No | The account email to send a reset link to. The call always resolves, whether or not it exists. | --- ## `TermsAcceptance` *Interface* The proof of the buyer's acceptance of the shop's terms: which frozen version of the terms page was accepted, in which language, how, and when. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `acceptedAt` | `string` | No | ISO 8601 datetime of the acceptance (e.g. `'2026-07-13T10:30:00.000Z'`). | | `locale` | `string \| null` | No | BCP 47 language of the accepted terms version (e.g. `'fr'`): the language the
buyer read the terms in. `null` when no version is on file. | | `mode` | `"checkbox" \| "notice"` | No | How the terms were accepted: `'checkbox'` (a ticked box, the storefront flows) or
`'notice'` (an approved notice in a messaging conversation). | | `versionId` | `string \| null` | No | Identifier of the frozen terms version the buyer accepted. `null` for an
acceptance recorded before terms versions existed. | --- # SDK Types: Categories **Published**: 2026-11-30 **Category**: Types > **Related services:** **CategoriesService**: `lynkow.categories.getBySlug()`, `lynkow.categories.list()`, `lynkow.categories.tree()` ## `Category` *Interface* A category as embedded in an article. Only `id`, `name` and `slug` are present on every endpoint. Its `contentMode` decides how articles are authored: `'standard'` with a rich text `body`, `'structured'` with `customData`. See CategoryDetail, CategoryWithCount and ResolvedCategory for the standalone responses. Extends: `LocaleResolution` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `contentMode` | `"standard" \| "structured"` | Yes | How articles are authored: a rich text `body` or `customData` fields. Absent from `paths.resolve()` on a category path. | | `displayOrder` | `number` | Yes | Sort position set in the admin, `0` by default, lower first. Present wherever `path` is. | | `id` | `string` | No | Category ID (UUID), stable across renames and slug changes. | | `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.
Absent when the request carried no locale. Never `true` with `fallback: false`. | | `locale` | `string` | Yes | BCP 47 locale of the category. Absent on categories embedded in `contents.getBySlug()`. | | `name` | `string` | No | Display name in the served locale, max 255 characters. | | `parent` | `Category \| null` | Yes | Parent as `{ id, name, slug }`, one level only, for breadcrumbs. `null` for a root category.
Sent only on categories embedded in `contents.getBySlug()`. | | `parentId` | `string \| null` | Yes | Parent category ID, or `null` for a root category. Sent only on categories embedded in `contents.getBySlug()`: use `categories.tree()` for the hierarchy. | | `path` | `string` | Yes | Site-relative URL path of the category page. Absent from categories embedded in `contents.getBySlug()`. | | `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the
`locale` request option or the client's configured locale.
Absent when the request carried no locale. | | `slug` | `string` | No | URL slug, unique per site and locale, max 255 characters. Pass it to `categories.getBySlug()`. | --- ## `CategoryDetail` *Interface* A category as returned by `categories.getBySlug()`. It has no `contentCount` (only the list and tree carry it) and no `parentId`. Extends: `Category` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `contentMode` | `"standard" \| "structured"` | No | How articles in this category are authored: a rich text `body` or `customData` fields. | | `description` | `string \| null` | No | Plain-text description, for example for a meta description. `null` when none is set. | | `displayOrder` | `number` | No | Sort position set in the admin, `0` by default, lower first. Lists and trees come sorted by name:
sort by this value to follow the admin order. | | `id` | `string` | No | Category ID (UUID), stable across renames and slug changes. | | `image` | `string \| null` | No | Absolute URL of the category image. `null` when none is set. Prefer `imageVariants`. | | `imageVariants` | `ImageVariants` | Yes | Resized versions of the image (`thumbnail`, `card`, `og`). Absent when no image is set. | | `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.
Absent when the request carried no locale. Never `true` with `fallback: false`. | | `locale` | `string` | No | BCP 47 locale of the category. | | `name` | `string` | No | Display name in the served locale, max 255 characters. | | `parent` | `Category \| null` | Yes | Parent as `{ id, name, slug }`, one level only, for breadcrumbs. `null` for a root category.
Sent only on categories embedded in `contents.getBySlug()`. | | `parentId` | `string \| null` | Yes | Parent category ID, or `null` for a root category. Sent only on categories embedded in `contents.getBySlug()`: use `categories.tree()` for the hierarchy. | | `path` | `string` | No | Site-relative URL path of the category page, such as `'/blog/parent/child'`. Prepend your base URL. | | `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the
`locale` request option or the client's configured locale.
Absent when the request carried no locale. | | `resolvedSchema` | `ContentSchema` | Yes | Field schema a structured category inherits from its ancestors. Sent only by `categories.getBySlug()`,
when `contentMode` is `'structured'` and `schemaSource` is `'inherit'`. | | `schema` | `ContentSchema \| null` | No | Field schema stored on the category, `{ fields: [] }` when none is set. When `schemaSource` is `'inherit'`, use `resolvedSchema`. | | `schemaSource` | `"own" \| "inherit" \| null` | No | `'own'` when the category defines `schema` (the default), `'inherit'` when it comes from an ancestor. | | `slug` | `string` | No | URL slug, unique per site and locale, max 255 characters. Pass it to `categories.getBySlug()`. | --- ## `CategoryTreeNode` *Interface* A node of the tree returned by `categories.tree()`: a CategoryWithCount plus its `children`. Extends: `CategoryWithCount` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `children` | `CategoryTreeNode[]` | No | Direct child categories, an empty array for a leaf. | | `contentCount` | `number` | No | Published articles in this category for the served locale. Child categories are not included. | | `contentMode` | `"standard" \| "structured"` | No | How articles in this category are authored: a rich text `body` or `customData` fields. | | `description` | `string \| null` | No | Plain-text description, for example for a meta description. `null` when none is set. | | `displayOrder` | `number` | No | Sort position set in the admin, `0` by default, lower first. Lists and trees come sorted by name:
sort by this value to follow the admin order. | | `id` | `string` | No | Category ID (UUID), stable across renames and slug changes. | | `image` | `string \| null` | No | Absolute URL of the category image. `null` when none is set. Prefer `imageVariants`. | | `imageVariants` | `ImageVariants` | Yes | Resized versions of the image (`thumbnail`, `card`, `og`). Absent when no image is set. | | `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.
Absent when the request carried no locale. Never `true` with `fallback: false`. | | `locale` | `string` | No | BCP 47 locale of the category. | | `name` | `string` | No | Display name in the served locale, max 255 characters. | | `parent` | `Category \| null` | Yes | Parent as `{ id, name, slug }`, one level only, for breadcrumbs. `null` for a root category.
Sent only on categories embedded in `contents.getBySlug()`. | | `parentId` | `string \| null` | Yes | Parent category ID, or `null` for a root category. Sent only on categories embedded in `contents.getBySlug()`: use `categories.tree()` for the hierarchy. | | `path` | `string` | No | Site-relative URL path of the category page, such as `'/blog/parent/child'`. Prepend your base URL. | | `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the
`locale` request option or the client's configured locale.
Absent when the request carried no locale. | | `resolvedSchema` | `ContentSchema` | Yes | Field schema a structured category inherits from its ancestors. Sent only by `categories.getBySlug()`,
when `contentMode` is `'structured'` and `schemaSource` is `'inherit'`. | | `schema` | `ContentSchema \| null` | No | Field schema stored on the category, `{ fields: [] }` when none is set. When `schemaSource` is `'inherit'`, use `resolvedSchema`. | | `schemaSource` | `"own" \| "inherit" \| null` | No | `'own'` when the category defines `schema` (the default), `'inherit'` when it comes from an ancestor. | | `slug` | `string` | No | URL slug, unique per site and locale, max 255 characters. Pass it to `categories.getBySlug()`. | --- ## `CategoryWithCount` *Interface* A CategoryDetail plus its published article count, returned by `categories.list()` and, with `children`, by `categories.tree()`. Extends: `CategoryDetail` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `contentCount` | `number` | No | Published articles in this category for the served locale. Child categories are not included. | | `contentMode` | `"standard" \| "structured"` | No | How articles in this category are authored: a rich text `body` or `customData` fields. | | `description` | `string \| null` | No | Plain-text description, for example for a meta description. `null` when none is set. | | `displayOrder` | `number` | No | Sort position set in the admin, `0` by default, lower first. Lists and trees come sorted by name:
sort by this value to follow the admin order. | | `id` | `string` | No | Category ID (UUID), stable across renames and slug changes. | | `image` | `string \| null` | No | Absolute URL of the category image. `null` when none is set. Prefer `imageVariants`. | | `imageVariants` | `ImageVariants` | Yes | Resized versions of the image (`thumbnail`, `card`, `og`). Absent when no image is set. | | `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.
Absent when the request carried no locale. Never `true` with `fallback: false`. | | `locale` | `string` | No | BCP 47 locale of the category. | | `name` | `string` | No | Display name in the served locale, max 255 characters. | | `parent` | `Category \| null` | Yes | Parent as `{ id, name, slug }`, one level only, for breadcrumbs. `null` for a root category.
Sent only on categories embedded in `contents.getBySlug()`. | | `parentId` | `string \| null` | Yes | Parent category ID, or `null` for a root category. Sent only on categories embedded in `contents.getBySlug()`: use `categories.tree()` for the hierarchy. | | `path` | `string` | No | Site-relative URL path of the category page, such as `'/blog/parent/child'`. Prepend your base URL. | | `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the
`locale` request option or the client's configured locale.
Absent when the request carried no locale. | | `resolvedSchema` | `ContentSchema` | Yes | Field schema a structured category inherits from its ancestors. Sent only by `categories.getBySlug()`,
when `contentMode` is `'structured'` and `schemaSource` is `'inherit'`. | | `schema` | `ContentSchema \| null` | No | Field schema stored on the category, `{ fields: [] }` when none is set. When `schemaSource` is `'inherit'`, use `resolvedSchema`. | | `schemaSource` | `"own" \| "inherit" \| null` | No | `'own'` when the category defines `schema` (the default), `'inherit'` when it comes from an ancestor. | | `slug` | `string` | No | URL slug, unique per site and locale, max 255 characters. Pass it to `categories.getBySlug()`. | --- ## `ResolvedCategory` *Interface* The category returned by `paths.resolve()` for a category path. Leaner than CategoryDetail: it has no `contentMode`, `schema` or `schemaSource`. Extends: `Category` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `alternates` | `ContentAlternate[]` | Yes | Language versions of the category, for `hreflang` tags. Present only when the request carried a locale,
and empty on a fallback. | | `canonicalPath` | `string` | Yes | Site-relative path search engines should index, such as `'/blog/tech'`. Present only when the request
carried a locale. Equals `path`, except on a fallback, where it is the default-locale version. | | `canonicalUrl` | `string` | Yes | Absolute form of `canonicalPath`. Present only on a fallback when the site has a domain. | | `contentMode` | `"standard" \| "structured"` | Yes | How articles are authored: a rich text `body` or `customData` fields. Absent from `paths.resolve()` on a category path. | | `description` | `string \| null` | No | Plain-text description, or `null` when none is set. | | `displayOrder` | `number` | No | Sort position set in the admin, `0` by default, lower first. | | `id` | `string` | No | Category ID (UUID), stable across renames and slug changes. | | `image` | `string \| null` | No | Absolute URL of the category image, or `null` when none is set. | | `imageVariants` | `ImageVariants` | Yes | Resized versions of the image. Absent when no image is set. | | `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.
Absent when the request carried no locale. Never `true` with `fallback: false`. | | `locale` | `string` | No | BCP 47 locale of the category. | | `name` | `string` | No | Display name in the served locale, max 255 characters. | | `parent` | `Category \| null` | Yes | Parent as `{ id, name, slug }`, one level only, for breadcrumbs. `null` for a root category.
Sent only on categories embedded in `contents.getBySlug()`. | | `parentId` | `string \| null` | Yes | Parent category ID, or `null` for a root category. Sent only on categories embedded in `contents.getBySlug()`: use `categories.tree()` for the hierarchy. | | `path` | `string` | No | Site-relative URL path of the category page. | | `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the
`locale` request option or the client's configured locale.
Absent when the request carried no locale. | | `slug` | `string` | No | URL slug, unique per site and locale, max 255 characters. Pass it to `categories.getBySlug()`. | --- # SDK Types: Cart **Published**: 2026-11-30 **Category**: Types ## `Cart` *Interface* A buyer's cart: its lines and the totals the server computed on this call. Read the totals as given rather than recomputing them. Count lines with `items.length` and units with `items.reduce((n, i) => n + i.quantity, 0)`. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `currency` | `string` | No | ISO 4217 currency code the totals are expressed in (e.g. `'EUR'`), fixed per site. | | `deliveryAddress` | `OrderAddress \| null` | No | The delivery address set with CartService.update, `countryCode` in upper case,
or `null`. Its country decides which market's shipping options apply. | | `id` | `string` | No | The cart's `cart_...` id, stable across adds, updates and removals. A
CartService.claim that merges into the buyer's existing cart returns that cart's id. | | `items` | `CartLineItem[]` | No | The cart lines, one per variant. Empty for a cart whose every line was removed. | | `locale` | `string \| null` | No | The cart's language tag (e.g. `'pt-BR'`), set by the creating `addLine` or by
CartService.setLocale. `null` when none was set: the site's default applies. | | `pickupPoint` | `SelectedPickupPoint \| null` | Yes | The pickup point set with CartService.update, or `null`. Checkout freezes it on
the order. Absent from an API that predates pickup points. | | `priceDisplayMode` | `"inclusive" \| "exclusive"` | No | `'inclusive'` shows prices with VAT; `'exclusive'` without (`subtotalNetCents`, each
line's `netCents`, `totalCents - taxTotalCents`). Display only. | | `removedLines` | `RemovedCartLine[]` | Yes | Lines removed by this call, already gone from `items` and the totals. Absent when
nothing was removed: a per-call report, never a standing list. | | `shippingOptionId` | `string \| null` | No | The chosen `shp_...` shipping option, or `null`. A choice that stops being an active
option of the delivery country's market is cleared on the next cart call. | | `shippingTotalCents` | `number` | No | Shipping of the chosen option in cents, VAT included when charged. 0 with no option,
no line, or a free option. Provisional: checkout recomputes it. | | `subtotalCents` | `number` | No | Sum of every line's CartLineItem.subtotalCents, in minor currency units (cents): the
amount charged for the goods, VAT included when VAT is charged. Computed server-side. | | `subtotalGrossCents` | `number` | No | Cart.subtotalCents with VAT, in cents: equal to `subtotalCents`. | | `subtotalNetCents` | `number` | No | Cart.subtotalCents without VAT, in cents: the sum of every line's `netCents`. | | `taxTotalCents` | `number` | No | The VAT contained in Cart.totalCents, in cents (do not add it), at the delivery
country's rate, else the merchant country's. 0 when no VAT is charged. | | `totalCents` | `number` | No | Amount payable in cents: Cart.subtotalCents plus Cart.shippingTotalCents.
Provisional: checkout recomputes it and can refuse with `TOTAL_CHANGED`. | --- ## `CartLineInput` *Interface* Which variant to add or update, and how many units. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `quantity` | `number` | No | Number of units, an integer from 1 to 999. CartService.addLine adds this many
to the line; CartService.updateLine sets the line to exactly this many. | | `variantId` | `string` | No | The variant's opaque wire id (prefixed `'var_...'`), taken from a product's `variants[].id`. | --- ## `CartLineItem` *Interface* One cart line: a product variant and its quantity, addressed by CartLineItem.variantId. The SKU, image and option values are copied when the item is added. The price follows the catalogue on every cart call, and checkout charges the current price. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `grossCents` | `number` | No | This line's amount with VAT, in cents, for all its units: equal to CartLineItem.subtotalCents. | | `netCents` | `number` | No | This line's amount without VAT, in cents, for all its units. Equal to `grossCents` when no VAT is charged. | | `optionValues` | `CartLineOptionValue[]` | No | Ordered option pairs identifying the chosen variant. Empty array for a product with no options. | | `quantity` | `number` | No | How many units of this variant are in the cart. Integer, 1 or more, capped at 999 per line. | | `subtotalCents` | `number` | No | The amount charged for this line in minor currency units (cents), VAT included when VAT is
charged. Computed server-side. Read it rather than multiplying `unitPriceCents` by
`quantity`. | | `thumbnail` | `string \| null` | No | Absolute URL of the product's primary image, copied when the item was added and shared by its lines. `null` when the product has no image. | | `title` | `string` | No | Product name in the cart's language when translated, else as stored when the item was added. Always non-empty. | | `unitPriceCents` | `number` | No | Price of one unit in minor currency units (cents), VAT included when VAT is charged:
the current catalogue price. When VAT is added to prices the
merchant entered without it, this can differ slightly from `subtotalCents / quantity`. | | `variantId` | `string \| null` | No | The variant's `var_...` id, to pass to CartService.updateLine or
CartService.removeLine. `null` only if the variant was deleted; such a line
is normally removed and reported in Cart.removedLines. | | `variantSku` | `string \| null` | No | Merchant stock-keeping unit snapshotted at add time. `null` when the merchant set none. | | `variantTitle` | `string \| null` | No | Variant name (e.g. `'Medium / Navy'`), translated like `title`, or `null` when the variant has none. | --- ## `CartLineOptionValue` *Interface* One resolved option pair on a cart line, snapshotted when the item was added (e.g. `{ option: 'Size', value: 'M' }`). Render these to tell two lines of the same product apart. Empty for a product with no options. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `option` | `string` | No | Option name as the merchant labelled it (e.g. `'Size'`, `'Colour'`). | | `value` | `string` | No | The chosen value for that option (e.g. `'M'`, `'Navy'`). | --- ## `CartUpdateInput` *Interface* The cart fields CartService.update sets. An absent key keeps the stored value, `null` clears it, and a value replaces it. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `deliveryAddress` | `OrderAddress \| null` | Yes | The delivery address, replacing the stored one whole, or `null` to clear it.
`countryCode` must be an ISO 3166-1 alpha-2 code; a new country can clear the shipping choice. | | `pickupPointId` | `string \| null` | Yes | The `id` of a point from `lynkow.pickupPoints.search()` for the cart's shipping option,
or `null` to clear it. A new shipping option clears the stored point unless the same
call sends one. The stored point is also dropped when the delivery country changes away
from the point's country, or when the option stops taking a point.

Refused, with nothing written, with `apiCode` `SHIPPING_OPTION_NO_PICKUP_POINTS` when
the cart has no shipping option or delivery country or its option takes no point,
`PICKUP_POINT_INVALID` for an unknown or closed point, and
`PICKUP_POINT_SEARCH_UNAVAILABLE` (retry) when the point cannot be checked right now. | | `shippingOptionId` | `string \| null` | Yes | A `shp_...` id from `lynkow.shippingOptions.list()`, or `null` to clear it. An id that
is not active in the delivery country's market is cleared, not refused. | --- ## `CartWithToken` *Interface* The Cart returned by CartService.addLine, which carries the guest cart token on the add that creates a guest cart. The service keeps the token; persist it only to survive a page reload. Extends: `Cart` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `cartToken` | `string` | Yes | The guest cart token, returned once and never again. Whoever holds it can read and
change the cart, so store it per visitor only. | | `currency` | `string` | No | ISO 4217 currency code the totals are expressed in (e.g. `'EUR'`), fixed per site. | | `deliveryAddress` | `OrderAddress \| null` | No | The delivery address set with CartService.update, `countryCode` in upper case,
or `null`. Its country decides which market's shipping options apply. | | `id` | `string` | No | The cart's `cart_...` id, stable across adds, updates and removals. A
CartService.claim that merges into the buyer's existing cart returns that cart's id. | | `items` | `CartLineItem[]` | No | The cart lines, one per variant. Empty for a cart whose every line was removed. | | `locale` | `string \| null` | No | The cart's language tag (e.g. `'pt-BR'`), set by the creating `addLine` or by
CartService.setLocale. `null` when none was set: the site's default applies. | | `pickupPoint` | `SelectedPickupPoint \| null` | Yes | The pickup point set with CartService.update, or `null`. Checkout freezes it on
the order. Absent from an API that predates pickup points. | | `priceDisplayMode` | `"inclusive" \| "exclusive"` | No | `'inclusive'` shows prices with VAT; `'exclusive'` without (`subtotalNetCents`, each
line's `netCents`, `totalCents - taxTotalCents`). Display only. | | `removedLines` | `RemovedCartLine[]` | Yes | Lines removed by this call, already gone from `items` and the totals. Absent when
nothing was removed: a per-call report, never a standing list. | | `shippingOptionId` | `string \| null` | No | The chosen `shp_...` shipping option, or `null`. A choice that stops being an active
option of the delivery country's market is cleared on the next cart call. | | `shippingTotalCents` | `number` | No | Shipping of the chosen option in cents, VAT included when charged. 0 with no option,
no line, or a free option. Provisional: checkout recomputes it. | | `subtotalCents` | `number` | No | Sum of every line's CartLineItem.subtotalCents, in minor currency units (cents): the
amount charged for the goods, VAT included when VAT is charged. Computed server-side. | | `subtotalGrossCents` | `number` | No | Cart.subtotalCents with VAT, in cents: equal to `subtotalCents`. | | `subtotalNetCents` | `number` | No | Cart.subtotalCents without VAT, in cents: the sum of every line's `netCents`. | | `taxTotalCents` | `number` | No | The VAT contained in Cart.totalCents, in cents (do not add it), at the delivery
country's rate, else the merchant country's. 0 when no VAT is charged. | | `totalCents` | `number` | No | Amount payable in cents: Cart.subtotalCents plus Cart.shippingTotalCents.
Provisional: checkout recomputes it and can refuse with `TOTAL_CHANGED`. | --- ## `RemovedCartLine` *Interface* One entry in Cart.removedLines: a line the server removed during the call that returned the cart, because its variant is no longer sellable or is out of stock on a site that refuses overselling. Use it to tell the buyer the item was dropped. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `reason` | `"unavailable" \| "out_of_stock"` | No | `'unavailable'`: the variant is no longer sellable. `'out_of_stock'`: its tracked stock
is at or below zero, and the buyer can add it again once restocked. | | `title` | `string` | No | Product name, translated like CartLineItem.title, for the "removed" message. Always non-empty. | | `variantId` | `string \| null` | No | The removed variant's `var_...` id, or `null` when the variant was deleted. The line is already gone. | | `variantTitle` | `string \| null` | No | Variant name (e.g. `'Medium / Navy'`), translated like `title`, or `null` when unset. | --- ## `ShippingOption` *Interface* One shipping option of a market, as `lynkow.shippingOptions.list()` returns it: a delivery method the merchant offers in that market, with its price. Only active options are listed. The `locale`, `requestedLocale` and `isFallback` signals of LocaleResolution are present when the request carried a locale, and describe the language `label` is served in. Extends: `LocaleResolution` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `deliveryLabelKey` | `"home_delivery" \| "pickup_point_delivery"` | Yes | A stable key for how the option delivers, `'home_delivery'` or `'pickup_point_delivery'`,
to map to your own translated text. Absent from an API that predates pickup points. | | `id` | `string` | No | Opaque option id, prefixed `'shp_'`. Stable; pass it as
CartUpdateInput.shippingOptionId or `PlaceOrderInput.shippingOptionId`. | | `isFallback` | `boolean` | Yes | `true` when the record is served in another locale because `requestedLocale` has no translation.
Absent when the request carried no locale. Never `true` with `fallback: false`. | | `label` | `string` | No | The option's name for the buyer (e.g. `'Standard delivery'`), in the requested locale
or its fallback. Always non-empty. | | `locale` | `string` | Yes | BCP 47 locale code of the record actually served (e.g. `'en'`, `'fr'`).
Equals `requestedLocale` unless `isFallback` is `true`. | | `position` | `number` | No | The merchant's sort order for the option within its market. The list is already
sorted by it, lowest first; use it only to re-sort a copy. | | `priceCents` | `number` | No | The option's price in minor currency units (cents) of the site's currency, VAT
included when the site charges VAT: equal to ShippingOption.priceGrossCents.
Integer, 0 or more; 0 is a free option. | | `priceDisplayMode` | `"inclusive" \| "exclusive"` | No | How the merchant wants prices shown: `'inclusive'` shows the prices with VAT
(`priceGrossCents`), `'exclusive'` without it (`priceNetCents`). `'inclusive'` unless the
merchant chose otherwise. Display only: it never changes the amount charged. | | `priceGrossCents` | `number` | No | ShippingOption.priceCents with VAT, at the rate of the `country` the list was
read with, else the merchant's. Pass the delivery country to show the amount charged. | | `priceNetCents` | `number` | No | ShippingOption.priceCents without VAT, in cents. Equal to `priceGrossCents` when no
VAT applies. Show it when ShippingOption.priceDisplayMode is `'exclusive'`. | | `requestedLocale` | `string` | Yes | BCP 47 locale code the request asked for (e.g. `'de'`), as sent in the
`locale` request option or the client's configured locale.
Absent when the request carried no locale. | | `requiresPickupPoint` | `boolean` | Yes | `true` when the buyer must choose a pickup point for this option
(`lynkow.pickupPoints.search()`) before placing the order. Absent from an API that
predates pickup points: read it as `option.requiresPickupPoint === true`. | --- ## `ShippingOptionList` *Interface* The response of `lynkow.shippingOptions.list()`: every active shipping option of one market, lowest `position` first. Not paginated. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `data` | `ShippingOption[]` | No | The market's active shipping options. Empty when it has none, when `market` is not an
active market of the site, or, with `fallback: false`, when none is translated. | --- ## `ShippingOptionsListOptions` *Interface* Request options of `lynkow.shippingOptions.list()`. `market` is required. Extends: `BaseRequestOptions` | Property | Type | Optional | Description | | --- | --- | --- | --- | | `country` | `string` | Yes | ISO 3166-1 alpha-2 code (e.g. `'DE'`) of the buyer's delivery country, whose VAT rate
prices the options. Sent only when set. An unusable value is ignored and the merchant's
country applies. | | `fallback` | `boolean` | Yes | Set `false` to refuse records served in another locale: a detail read then
throws `NOT_FOUND` and a list drops them. Fallback is on by default. Reads
without locale fallback ignore it. | | `fetchOptions` | `RequestInit` | Yes | `fetch()` options for this request, shallow-merged over the client's
`fetchOptions`, such as `{ next: { revalidate: 60 } }`. | | `locale` | `string` | Yes | Locale of this request (e.g. `'fr'`), overriding the client's `locale`.
Reads never reject a locale: a missing translation is served in another
locale and flagged `isFallback: true` (see LocaleResolution). Some
writes, such as `reviews.submit()`, refuse a locale the site does not enable. | | `market` | `string` | No | Id (`mkt_...`) of the market whose shipping options to list, as returned by
`lynkow.markets.list()`. The id of a market that is unknown, still a draft, or
another site's lists nothing. | --- # SDK Types: Analytics **Published**: 2026-11-30 **Category**: Types > **Related services:** **AnalyticsService**: `lynkow.analytics.destroy()`, `lynkow.analytics.disable()`, `lynkow.analytics.enable()`, `lynkow.analytics.getTracker()`, `lynkow.analytics.init()`, `lynkow.analytics.isEnabled()`, `lynkow.analytics.isInitialized()`, `lynkow.analytics.trackEvent()`, `lynkow.analytics.trackPageview()` ## `AnalyticsEventType` *TypeAlias* Event types Lynkow analytics records. The API silently drops an event with any other type. There is no free-form business event: record one as the event that carries it (`'form_submit'`, `'outbound_link'`, `'click'`) plus descriptive fields. ```typescript type AnalyticsEventType = "pageview" | "scroll" | "time_on_page" | "cwv" | "exit" | "heartbeat" | "click" | "outbound_link" | "file_download" | "email_click" | "phone_click" | "rage_click" | "dead_click" | "copy" | "form_start" | "form_submit" | "form_abandon" | "form_field" | "form_error" | "heatmap_click" ``` --- ## `EventData` *Interface* Event passed to AnalyticsService.trackEvent. Other keys are sent as is and must use the API's snake_case field names (`click_element`, `file_name`, `form_id`, `utm_source`). The API drops any key it does not know. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `type` | `AnalyticsEventType` | No | Event type, sent as `event_type`. | --- ## `EventEmitter` *TypeAlias* Type of the event emitter object returned by createEventEmitter. ```typescript type EventEmitter = ReturnType ``` --- ## `EventListener` *TypeAlias* Callback function type for event listeners. ```typescript type EventListener = (data: T) => void ``` --- ## `EventName` *TypeAlias* ```typescript type EventName = keyof LynkowEvents ``` --- ## `LynkowEvents` *Interface* Events of `lynkow.on()`, each mapped to its payload type. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `consent-changed` | `Record` | No | The visitor changed their cookie consent. The payload maps each category
to its choice, such as `{ necessary: true, analytics: false }`. | | `error` | `Error` | No | Browser only: the client's startup failed, for example when the site
config request failed. The payload is the error. | | `locale-changed` | `string` | No | `setLocale()` changed the locale. The payload is the new locale, such as
`'fr'`: re-fetch the localized data. | | `ready` | `void` | No | Browser only: the client loaded the site config and started its browser
services. Emitted once, never when that startup fails. | --- ## `PageviewData` *Interface* Pageview passed to AnalyticsService.trackPageview. Each omitted field is read from the browser at call time. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `path` | `string` | Yes | Page path starting with `/`, sent as is. Defaults to `window.location.pathname`. | | `referrer` | `string` | Yes | Referring URL. Defaults to `document.referrer`; pass `''` to record direct traffic. | | `title` | `string` | Yes | Page title, max 500 characters: a longer one makes the API drop the pageview. Defaults to `document.title`. | | `url` | `string` | Yes | Absolute page URL. Defaults to `window.location.href`. Pageviews on `localhost` or a private IP are not recorded. | --- # VariablesService **Published**: 2026-11-30 **Category**: Services Reads the site's variables, the named values (a phone number, an opening status) defined once in the admin, available as `lynkow.variables`. Read-only. With `cache: true`, responses are cached for 5 minutes. Access via: `lynkow.variables` ## Methods **1** method ### `list` ```typescript list(options?: BaseRequestOptions): Promise ``` Fetches every variable of the site, one per key, sorted by key and not paginated. Without a locale, each value is served in the site's default locale. With one, a key with no value in that locale is served from the fallback locale and flagged `isFallback: true`: pass `fallback: false` to drop those keys. With `cache: true`, cached for 5 minutes. Resolves to an empty `data` array when the site has no variables. Throws `LynkowError` `NOT_FOUND` for an unknown site, `FORBIDDEN` for an inactive site or a request origin that does not match the site's domain, and `PAYMENT_REQUIRED` when the subscription no longer covers public delivery. | Parameter | Type | Description | | --- | --- | --- | | `options` | `BaseRequestOptions` | Request options. `locale` selects the language, `fallback: false` refuses a fallback. | Returns: `Promise` ```typescript const { data: variables } = await lynkow.variables.list({ locale: 'fr' }) // A footer status indicator driven by a `status` variable. const status = variables.find((v) => v.key === 'status')?.value ?? 'ok' ``` --- # ShippingOptionsService **Published**: 2026-11-30 **Category**: Services Lists the shipping options of one market, for the buyer to pick at checkout. Accessible via `lynkow.shippingOptions`; store the choice with `lynkow.cart.update({ shippingOptionId })`. Requires a publishable key: pass `publishableKey` to `createClient()`, or every call throws `LynkowError` `UNAUTHORIZED`. With `cache: true`, responses are cached for 5 minutes. Access via: `lynkow.shippingOptions` ## Methods **1** method ### `list` ```typescript list(options: ShippingOptionsListOptions): Promise ``` Lists the active shipping options of one market, lowest `position` first, without pagination. `market` is required: an unknown, draft or other site's market returns an empty list. Prices use the VAT rate of `country`, else the merchant's country. With a `locale`, each `label` is translated when possible and the item carries the fallback fields; `fallback: false` leaves untranslated options out. Throws `LynkowError` `NOT_FOUND` when commerce, markets or shipping are off for the site. | Parameter | Type | Description | | --- | --- | --- | | `options` | `ShippingOptionsListOptions` | ShippingOptionsListOptions: the required `market` (a `mkt_...` id), `country`, `locale`, `fallback` and `fetchOptions`. | Returns: `Promise` ```typescript const { data: options } = await lynkow.shippingOptions.list({ market: 'mkt_01j9z3k4m5n6p7q8r9s0t1v2w3', country: 'BE', // prices at the VAT rate of the buyer's delivery country locale: 'fr', }) // Offer the options, then store the buyer's choice on the cart. const chosen = options[0] if (chosen) { const cart = await lynkow.cart.update({ shippingOptionId: chosen.id }) console.log(cart.shippingTotalCents, cart.totalCents) } ``` --- # SeoService **Published**: 2026-11-30 **Category**: Services Fetches the site's SEO files as raw text: the XML sitemap, robots.txt, llms.txt, llms-full.txt and the Markdown version of a page. Serve each from a route handler on your domain. Accessible as `lynkow.seo`. The SDK never caches these files. Access via: `lynkow.seo` ## Methods **6** methods ### `getMarkdown` ```typescript getMarkdown(contentPath: string, options?: BaseRequestOptions): Promise ``` Fetches one article, blog category or page as Markdown by its public URL path; the SDK appends `.md`. Pass `Content.path` for an article and `Page.publicPath` for a page. Throws `LynkowError` `NOT_FOUND` (`apiCode` `PATH_NOT_FOUND`) when the path matches nothing published, and `NOT_FOUND` when llms.txt is turned off in the SEO settings. | Parameter | Type | Description | | --- | --- | --- | | `contentPath` | `string` | The public URL path, such as `article.path`. A missing leading `/` is added. | | `options` | `BaseRequestOptions` | Request options, such as `fetchOptions`. | Returns: `Promise` ```typescript const article = await lynkow.contents.getBySlug('my-article') const md = await lynkow.seo.getMarkdown(article.path) // In a Next.js catch-all route handler export async function GET(req: Request) { const url = new URL(req.url) const path = url.pathname.replace(/\.md$/, '') const md = await lynkow.seo.getMarkdown(path) return new Response(md, { headers: { 'Content-Type': 'text/markdown; charset=utf-8' } }) } ``` --- ### `llmsFullTxt` ```typescript llmsFullTxt(options?: BaseRequestOptions): Promise ``` Fetches the site's `llms-full.txt`: its published articles and pages in full in one Markdown document, plus its catalogue pages. Can be large. Pass `locale` for that locale's file: the client locale is not applied. Throws `LynkowError` `NOT_FOUND` when llms.txt is turned off in the SEO settings, or for a locale a multi-language site does not enable. | Parameter | Type | Description | | --- | --- | --- | | `options` | `BaseRequestOptions` | `locale` selects the file of that locale, such as `'fr'`. | Returns: `Promise` ```typescript // In a Next.js route handler (app/llms-full.txt/route.ts) export async function GET() { const md = await lynkow.seo.llmsFullTxt() return new Response(md, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } }) } ``` --- ### `llmsTxt` ```typescript llmsTxt(options?: BaseRequestOptions): Promise ``` Fetches the site's `llms.txt`, a Markdown index of its articles, pages and catalogue pages for AI crawlers. Pass `locale` for that locale's file: the client locale is not applied, so without the option you get the default locale's file. Throws `LynkowError` `NOT_FOUND` when llms.txt is turned off in the SEO settings, or for a locale a multi-language site does not enable. | Parameter | Type | Description | | --- | --- | --- | | `options` | `BaseRequestOptions` | `locale` selects the file of that locale, such as `'fr'`. | Returns: `Promise` ```typescript // In a Next.js route handler (app/llms.txt/route.ts) export async function GET() { const md = await lynkow.seo.llmsTxt() return new Response(md, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } }) } ``` --- ### `robots` ```typescript robots(options?: BaseRequestOptions): Promise ``` Fetches the site's `robots.txt`, to serve with `Content-Type: text/plain`: the rules set in the SEO settings, or a default `User-agent: *` block when none are set, then a `Sitemap:` line for the site's domain unless that link is turned off. When llms.txt is enabled, it also keeps Googlebot and Bingbot off `/llms.txt` and `/llms-full.txt`. | Parameter | Type | Description | | --- | --- | --- | | `options` | `BaseRequestOptions` | Request options, such as `fetchOptions`. | Returns: `Promise` ```typescript // In a Next.js route handler (app/robots.txt/route.ts) export async function GET() { const txt = await lynkow.seo.robots() return new Response(txt, { headers: { 'Content-Type': 'text/plain' } }) } ``` --- ### `sitemap` ```typescript sitemap(options?: BaseRequestOptions): Promise ``` Fetches the site's `sitemap.xml`, to serve with `Content-Type: application/xml`. While the site's own URLs fit in one file (50,000 URLs, 50 MB) and no external sitemap source is enabled, it is a ``. Otherwise it is a `` of files on your domain: `sitemap-content.xml` when one file holds every URL, else `sitemap-1.xml` to `sitemap-N.xml`, then the external sources. Serve those files with SeoService.sitemapPart: `sitemapPart(1)` is `sitemap-content.xml`. | Parameter | Type | Description | | --- | --- | --- | | `options` | `BaseRequestOptions` | Request options, such as `fetchOptions`. | Returns: `Promise` ```typescript // In a Next.js route handler (app/sitemap.xml/route.ts) export async function GET() { const xml = await lynkow.seo.sitemap() return new Response(xml, { headers: { 'Content-Type': 'application/xml' } }) } ``` --- ### `sitemapPart` ```typescript sitemapPart(part: number, options?: BaseRequestOptions): Promise ``` Fetches `sitemap-{part}.xml`, one `` of the site's own URLs, without the external sitemap sources. SeoService.sitemap lists the parts when the URLs exceed one file. A site within the limits has one part, so `sitemapPart(1)` also serves `sitemap-content.xml`. Throws `LynkowError` `NOT_FOUND` for `0`, a part above the count of parts, or a number that is not a whole number. | Parameter | Type | Description | | --- | --- | --- | | `part` | `number` | The part number, counted from 1. | | `options` | `BaseRequestOptions` | Request options, such as `fetchOptions`. | Returns: `Promise` ```typescript // A Next.js folder named `sitemap-[part].xml` is not a dynamic segment: // only a segment wrapped whole in brackets is. Rewrite the public file // names to a route handler instead, in next.config.ts: // async rewrites() { // return [{ source: '/sitemap\\-:part(\\d+)\\.xml', destination: '/sitemap-part/:part' }] // } // app/sitemap-part/[part]/route.ts export async function GET( _request: Request, { params }: { params: Promise<{ part: string }> } ) { const { part } = await params const xml = await lynkow.seo.sitemapPart(Number(part)) return new Response(xml, { headers: { 'Content-Type': 'application/xml' } }) } ``` --- # SDK Types: Cookies & Consent **Published**: 2026-11-30 **Category**: Types > **Related services:** **CookiesService**: `lynkow.cookies.getConfig()`, `lynkow.cookies.logConsent()` | **ConsentService**: `lynkow.consent.acceptAll()`, `lynkow.consent.destroy()`, `lynkow.consent.getCategories()`, `lynkow.consent.getConfig()`, `lynkow.consent.hasConsented()`, `lynkow.consent.hide()`, `lynkow.consent.logConsent()`, `lynkow.consent.rejectAll()`, `lynkow.consent.reset()`, `lynkow.consent.setCategories()`, `lynkow.consent.show()`, `lynkow.consent.showPreferences()` ## `ConsentCategories` *Interface* The visitor's answer per cookie category: `true` allows the category's scripts, `false` blocks them. Returned by ConsentService.getCategories and sent with the `'consent-changed'` client event. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `analytics` | `boolean` | No | Analytics cookies and scripts. When `false` on an `'opt-in'` or `'opt-out'` site, the Lynkow tracker records nothing. | | `marketing` | `boolean` | No | Consent to marketing and advertising cookies (ad networks,
retargeting). Required before loading scripts classified as
`marketing` in the site's cookie config. | | `necessary` | `boolean` | No | Strictly necessary cookies. Always `true`: the visitor cannot refuse them. | | `preferences` | `boolean` | No | Consent to personalization and preference cookies (theme, language,
non-essential UI state). Required before loading scripts classified
as `preferences` in the site's cookie config. | --- ## `ConsentMode` *TypeAlias* How the site asks for cookie consent: `'opt-in'` blocks optional cookies until the visitor accepts, `'opt-out'` allows them until the visitor refuses, `'notice-only'` informs without offering a choice. ```typescript type ConsentMode = "opt-in" | "opt-out" | "notice-only" ``` --- ## `ConsentShowOptions` *Interface* Options for ConsentService.show. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `config` | `CookieConfig` | Yes | A CookieConfig you already fetched, for example on the server, used instead of a new request. | | `force` | `boolean` | Yes | Show the banner even when the site set `showOnFirstVisit: false`. Pass it from a control the visitor clicked. | --- ## `CookieCategory` *Interface* A cookie consent category grouping related cookies and scripts. Users accept or reject entire categories (not individual cookies). | Property | Type | Optional | Description | | --- | --- | --- | --- | | `description` | `string` | No | Description explaining what cookies in this category do.
Displayed in the consent banner's detailed/customize view. | | `id` | `string` | No | Machine-readable category identifier.
Standard values: `'necessary'`, `'analytics'`, `'marketing'`, `'preferences'`.
Used as the key in CookiePreferences when recording consent. | | `name` | `string` | No | Human-readable category name displayed in the consent banner. | | `required` | `boolean` | No | `true` when the visitor cannot refuse this category, as for `'necessary'`. Render its toggle checked and disabled. | --- ## `CookieConfig` *Interface* A site's cookie consent configuration: mode, banner texts and styling, categories and gated scripts. Returned by `cookies.getConfig()` and `consent.getConfig()`. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `borderRadius` | `number` | Yes | Corner radius of the banner and its buttons, in pixels, from 0 to 50. | | `buttonSize` | `"compact" \| "comfortable"` | Yes | Size of the banner and preferences buttons.
- `'compact'` (default): smaller buttons, about 34px tall.
- `'comfortable'`: every button at least 44px tall, the WCAG 2.2 AAA target size. | | `categories` | `CookieCategory[]` | No | The site's enabled categories, in display order, with texts in the requested locale. | | `consentMode` | `ConsentMode` | Yes | Consent mode, see ConsentMode. Under `'notice-only'`, render one acknowledge button and no category toggles. | | `cookiePolicyUrl` | `string \| null` | Yes | URL to a dedicated cookie policy page (separate from the privacy policy).
`null` when no cookie policy URL has been configured.
Some sites use a single privacy policy; others maintain a separate cookie policy. | | `enabled` | `boolean` | No | Whether the cookie consent banner is enabled for this site.
When `false`, no banner should be shown and no consent logic is needed. | | `fontSize` | `number` | Yes | Banner font size in pixels, from 11 to 17. | | `layout` | `"floating"` | No | Banner layout style. Currently only `'floating'` is supported
(a dismissable card overlay, not a full-width bar). | | `maxWidth` | `number` | Yes | Maximum banner width in pixels, from 280 to 1200 (default 580). Ignored below a 600px viewport. | | `orientation` | `"auto" \| "column"` | Yes | `'auto'` lays the banner out in a row from 600px wide and in a column below; `'column'` always uses a column. | | `position` | `"bottom-left" \| "bottom-right"` | No | Screen position of the floating consent banner.
- `'bottom-left'`: anchored to the bottom-left corner
- `'bottom-right'`: anchored to the bottom-right corner | | `primaryColor` | `string` | Yes | Accent color as `#rrggbb`. The built-in banner uses themeStyles first and falls back to this. | | `privacyPolicyUrl` | `string \| null` | Yes | URL to the site's privacy policy page.
`null` when no privacy policy URL has been configured.
Should be rendered as a clickable link in the banner. | | `showCustomizeButton` | `boolean` | Yes | Whether to show the "Customize" button that lets users pick categories individually.
When `false`, only "Accept All" and "Reject All" buttons are shown. | | `showOnFirstVisit` | `boolean` | Yes | Whether the banner shows by itself on a first visit. When `false`, open it from a control such as a footer link. | | `texts` | `CookieTexts` | No | Localized text strings for the banner UI.
All strings are ready for display without further formatting. | | `theme` | `"light" \| "dark" \| "auto"` | No | Color theme for the banner:
- `'light'`: white/light background with dark text
- `'dark'`: dark background with light text
- `'auto'`: follows the user's OS/browser color scheme preference

When `'auto'`, use themeStyles to get the exact colors for each scheme. | | `themeStyles` | `{ dark: { bgColor: string; primaryColor: string; textColor: string }; light: { bgColor: string; primaryColor: string; textColor: string } }` | Yes | Banner colors for the light and dark schemes. Use the one matching theme, or the site's current scheme under `'auto'`. | | `thirdPartyScripts` | `ThirdPartyScript[]` | Yes | Third-party scripts to inject based on the user's consent preferences.
Each script is tied to a category; only inject scripts whose category
the user has accepted. Empty array when no scripts are configured. | | `version` | `string` | Yes | Version of the banner text in this locale: a 64-character SHA-256 hex digest of the texts and category labels. Consent logs record the same value. | --- ## `CookiePreferences` *TypeAlias* Map of cookie category IDs to the user's consent decision. `true` means the user accepted that category; `false` means rejected. Used when calling `cookies.logConsent()` to record preferences. ```typescript type CookiePreferences = Record ``` --- ## `CookieTexts` *Interface* Banner texts in the requested locale: the site's own wording, or Lynkow's default wording for any text the site left unchanged. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `acceptAll` | `string` | No | Label for the "Accept All" button that grants consent for all categories. | | `customize` | `string` | No | Label for the "Customize" button that opens the detailed category preferences. | | `description` | `string` | No | Main description/message shown in the cookie banner.
Typically explains that the site uses cookies and links to the privacy policy. | | `privacyPolicy` | `string` | No | Link text pointing to the privacy/cookie policy page. | | `rejectAll` | `string` | No | Label for the "Reject All" button that only allows necessary cookies. | | `save` | `string` | No | Label for the "Save" button in the detailed preferences view.
Saves the user's per-category choices. | --- ## `ThirdPartyScript` *Interface* A third-party script that should be injected into the page based on the user's consent for its category. Only inject this script's HTML when the user has accepted the corresponding cookie category. | Property | Type | Optional | Description | | --- | --- | --- | --- | | `category` | `"necessary" \| "analytics" \| "marketing" \| "preferences" \| string & object` | No | Cookie consent category this script belongs to: the `id` of one of the
site's consent categories (CookieCategory), a custom one included.
Only inject this script when the user has accepted this category.
The four standard categories:
- `'necessary'`: always loaded (no consent required)
- `'analytics'`: tracking and analytics scripts
- `'marketing'`: advertising and remarketing scripts
- `'preferences'`: personalization and functional scripts | | `id` | `string` | No | Unique identifier for this script configuration.
Stable across requests; can be used as a React key or for deduplication. | | `name` | `string` | No | Human-readable name for this script.
For admin reference; not typically displayed to end users. | | `script` | `string` | No | Raw HTML content to inject into the page.
May contain `` in a value would reach the // HTML parser. ``` --- ### `list` ```typescript list(options?: PagesListOptions): Promise ``` Fetches the published pages as summaries, without their resolved data, optionally filtered by tag. Without a locale, only default-locale pages are listed. With one, each translation group appears once and a missing translation is served from the fallback locale (`fallback: false` drops those). Link to `publicPath`, not `path`. With `cache: true`, cached for 5 minutes. | Parameter | Type | Description | | --- | --- | --- | | `options` | `PagesListOptions` | `tag` to filter, plus request options (`locale`, `fallback`). | Returns: `Promise` ```typescript // List all pages const { data } = await lynkow.pages.list() // List only legal documents const { data } = await lynkow.pages.list({ tag: 'legal' }) ``` --- # MediaHelperService **Published**: 2026-11-30 **Category**: Services Builds resized image URLs on the Lynkow image transformation service, accessible via `lynkow.media`. It makes no request and works on the server and in the browser. It accepts original Lynkow media URLs and URLs it already transformed. Access via: `lynkow.media` ## Methods **2** methods ### `srcset` ```typescript srcset(imageUrl: string | null | undefined, options: SrcsetOptions): string ``` Builds a `srcset` attribute value from a Lynkow image URL, with one transformed URL per width. Returns an empty string for `null`, `undefined` or a URL that is not a Lynkow media URL. | Parameter | Type | Description | | --- | --- | --- | | `imageUrl` | `string \| null \| undefined` | Image URL from the API, such as `content.featuredImage` | | `options` | `SrcsetOptions` | `widths`, `fit`, `quality` and `gravity`, see SrcsetOptions | Returns: `string` ```typescript const srcset = lynkow.media.srcset(article.featuredImage, { widths: [480, 960], fit: 'cover' }) const img = `` ``` --- ### `transform` ```typescript transform(imageUrl: string | null | undefined, options: TransformOptions): string ``` Builds one transformed URL from a Lynkow image URL, for a thumbnail or any fixed size. Returns a URL that is not a Lynkow media URL unchanged, and an empty string for `null` or `undefined`. | Parameter | Type | Description | | --- | --- | --- | | `imageUrl` | `string \| null \| undefined` | Image URL from the API, such as `content.featuredImage` | | `options` | `TransformOptions` | Size, `fit`, `format`, `quality`, `gravity` and `dpr`, see TransformOptions | Returns: `string` ```typescript const thumb = lynkow.media.transform(content.featuredImage, { w: 400, h: 300, fit: 'cover' }) ``` --- # FormsService **Published**: 2026-11-30 **Category**: Services Reads form schemas and submits form data, via `lynkow.forms`. Fetch a form's schema to render it, then submit the visitor's answers keyed by field id. Submissions carry the honeypot and timestamp spam fields automatically. Access via: `lynkow.forms` ## Methods **3** methods ### `clearCache` ```typescript clearCache(): void ``` Clears every cached form schema, so the next `getBySlug()` fetches the current fields and settings. Call it after a form changes, for example on a `form.*` webhook. Has no effect without `cache: true`. Returns: `void` ```typescript lynkow.forms.clearCache() ``` --- ### `getBySlug` ```typescript getBySlug(slug: string, options?: BaseRequestOptions): Promise
``` Fetches an active form by its slug: its field schema, settings and verification policy. With `cache: true`, cached for 10 minutes per locale. With a locale, a form not translated in it is served from the site's next locale and carries `isFallback: true`. On a multi-language site, `fallback: false` turns that case into a 404. Throws `LynkowError` `NOT_FOUND` with `apiCode` `RESOURCE_NOT_FOUND` when no active form has this slug, and without a request for an empty, `.` or `..` slug. | Parameter | Type | Description | | --- | --- | --- | | `slug` | `string` | The form's slug, e.g. `'contact'`. | | `options` | `BaseRequestOptions` | Request options: `locale`, `fallback` and `fetchOptions`. | Returns: `Promise` ```typescript const form = await lynkow.forms.getBySlug('contact') // Each field's `id` is the key you submit its value under. form.schema.fields.forEach(field => { console.log(field.id, field.type, field.label, field.required) }) ``` --- ### `submit` ```typescript submit(slug: string, data: FormSubmitData, options?: TimedSubmitOptions & BaseRequestOptions): Promise ``` Submits a visitor's answers to a form, keyed by `FormField.id`. Adds the spam fields `_hp` and `_ts` (the client's creation time, capped at 55 minutes ago, unless you pass `formStartedAt`) and the signed-in customer's session, which a `requireAuth` form needs. When the site or form uses reCAPTCHA, pass a v2 token or a v3 token with action `form_submit`. The locale selects the translation, as in `getBySlug()`. Sent once, never retried. Throws `LynkowError` `VALIDATION_ERROR` per failing field, `NOT_FOUND` for an unknown slug, `BAD_REQUEST` with `apiCode` `RESOURCE_LOCKED` (form closed), `RATE_SUBMISSION_EXPIRED`, `SPAM_RECAPTCHA_REQUIRED` or `SPAM_RECAPTCHA_FAILED`, `UNAUTHORIZED` with `CUSTOMER_AUTH_REQUIRED`, and `TOO_MANY_REQUESTS` with `RATE_SUBMISSION_TOO_FAST` when sent too soon after `_ts`. | Parameter | Type | Description | | --- | --- | --- | | `slug` | `string` | The form's slug, e.g. `'contact'`. | | `data` | `FormSubmitData` | Values keyed by `FormField.id` from `getBySlug()`. Upload a file first and send its reference. | | `options` | `TimedSubmitOptions & BaseRequestOptions` | `recaptchaToken`, `formStartedAt` (see TimedSubmitOptions), `locale` and `fetchOptions`. | Returns: `Promise` ```typescript const form = await lynkow.forms.getBySlug('contact') // Build the payload with field.id as key. The SDK does not transform // semantic names into ids; you must do that yourself based on the schema. const data: Record = {} for (const field of form.schema.fields) { data[field.id] = readValueForField(field) // your UI binding } const result = await lynkow.forms.submit('contact', data) // Never hand `redirectUrl` to `window.location` as it comes: parse it, and // follow it only when it resolves to http or https. function redirectTarget(redirectUrl?: string): string | null { if (!redirectUrl) return null try { const url = new URL(redirectUrl, window.location.href) return url.protocol === 'http:' || url.protocol === 'https:' ? url.href : null } catch { return null } } const target = redirectTarget(result.redirectUrl) if (target) { // The form is configured to send the visitor to a thank-you page window.location.assign(target) } else { // Show the success message console.log(result.message) } ``` --- # EnhancementsService **Published**: 2026-11-30 **Category**: Services Adds browser behavior to HTML rendered from Lynkow content, accessible via `lynkow.enhancements`: copy buttons on code blocks, inline script execution, height sync for embedded Lynkow widgets, and CSS that keeps inline text alignment. The client starts it in the browser, and it also enhances content added later. Every method is a no-op on the server. Restyle code blocks by overriding the `--lynkow-code-*` CSS custom properties. A `light` class or `data-theme="light"` on `` selects the light variant. Access via: `lynkow.enhancements` ## Methods **3** methods ### `destroy` ```typescript destroy(): void ``` Stops every enhancement and removes the styles and script copies the service added to ``. Safe to call repeatedly, and `init()` starts the enhancements again. Returns: `void` ```typescript useEffect(() => { lynkow.enhancements.init() return () => lynkow.enhancements.destroy() }, []) ``` --- ### `init` ```typescript init(options: EnhancementsInitOptions): void ``` Starts the enhancements on the page and on content added later. The client calls it in the browser just after `createClient()` returns. Later calls do nothing until `destroy()`, so to change the options after startup call `destroy()`, then `init(options)`. | Parameter | Type | Description | | --- | --- | --- | | `options` | `EnhancementsInitOptions` | `codeBlocks` and `activateScripts` toggles, see EnhancementsInitOptions | Returns: `void` ```typescript // Your own highlighter renders code blocks. lynkow.enhancements.destroy() lynkow.enhancements.init({ codeBlocks: false }) ``` --- ### `isInitialized` ```typescript isInitialized(): boolean ``` Returns `true` once `init()` has run, until `destroy()`. Always `false` on the server. Returns: `boolean` ```typescript if (!lynkow.enhancements.isInitialized()) { lynkow.enhancements.init() } ``` --- # CustomersService **Published**: 2026-11-30 **Category**: Services Buyer accounts: two-step signup (`register`, then `activation.confirm`), login, profile, bookings and order history, plus the `activation`, `passwordReset`, `addresses` and `marketingConsent` sub-objects. Requires `publishableKey`. `login` and `activation.confirm` keep the session token in client memory and send it as a Bearer header on account and booking calls; `logout` clears it. The SDK never persists it: save it yourself and pass it back with `createClient({ customerToken })`. Throws `NOT_FOUND` when customer accounts are not enabled on the site. Access via: `lynkow.customers` ## Methods **18** methods ### `activation.confirm` ```typescript activation.confirm(input: CustomerActivationConfirmInput): Promise ``` Step 2 of signing up: completes the account with the single-use token from the activation email, keeps the session token on the client and signs the buyer in. | Parameter | Type | Description | | --- | --- | --- | | `input` | `CustomerActivationConfirmInput` | The `token` from the link, the `password`, `acceptsTerms: true`, and the optional profile and consent fields. | Returns: `Promise` ```typescript // On the page the activation link opens, e.g. /account/activate/[token] const { customer } = await lynkow.customers.activation.confirm({ token: params.token, password: form.password, acceptsTerms: true, firstName: 'Alice', }) ``` --- ### `addresses.create` ```typescript addresses.create(input: CustomerAddressInput, options?: CustomerSpamOptions): Promise ``` Saves an address for the signed-in buyer. Setting a default unsets the previous one. | Parameter | Type | Description | | --- | --- | --- | | `input` | `CustomerAddressInput` | Recipient and postal fields, plus the optional label, contact, default flags and metadata. | | `options` | `CustomerSpamOptions` | Optional anti-spam values (`formStartedAt`, `recaptchaToken`) and request options. | Returns: `Promise` ```typescript const address = await lynkow.customers.addresses.create({ firstName: 'Alice', lastName: 'Martin', address1: '12 rue de la Paix', city: 'Paris', postalCode: '75002', countryCode: 'FR', isDefaultShipping: true, }) ``` --- ### `addresses.list` ```typescript addresses.list(): Promise ``` Lists every saved address of the signed-in buyer, following all pages. Never cached. Returns: `Promise` ```typescript const addresses = await lynkow.customers.addresses.list() const shipping = addresses.find((a) => a.isDefaultShipping) ``` --- ### `addresses.remove` ```typescript addresses.remove(id: string, options?: CustomerSpamOptions): Promise ``` Deletes one address of the signed-in buyer. | Parameter | Type | Description | | --- | --- | --- | | `id` | `string` | The `addr_...` id of the address. | | `options` | `CustomerSpamOptions` | Optional anti-spam values (`formStartedAt`, `recaptchaToken`) and request options. | Returns: `Promise` ```typescript await lynkow.customers.addresses.remove('addr_123') ``` --- ### `addresses.update` ```typescript addresses.update(id: string, input: CustomerAddressUpdateInput, options?: CustomerSpamOptions): Promise ``` Partially edits one address of the signed-in buyer. Re-read `list()` after setting a default, since the previous default is unset. | Parameter | Type | Description | | --- | --- | --- | | `id` | `string` | The `addr_...` id of the address. | | `input` | `CustomerAddressUpdateInput` | The address fields to change. | | `options` | `CustomerSpamOptions` | Optional anti-spam values (`formStartedAt`, `recaptchaToken`) and request options. | Returns: `Promise` ```typescript await lynkow.customers.addresses.update('addr_123', { isDefaultBilling: true }) const addresses = await lynkow.customers.addresses.list() // the previous default is unset ``` --- ### `marketingConsent.list` ```typescript marketingConsent.list(): Promise ``` Lists the buyer's marketing consent, one entry per channel; a channel with no record reads `false`. Requires a stored session token. Returns: `Promise` ```typescript const { channels } = await lynkow.customers.marketingConsent.list() const emailOptIn = channels.find((c) => c.channel === 'email')?.optedIn ?? false ``` --- ### `marketingConsent.update` ```typescript marketingConsent.update(input: MarketingConsentUpdateInput): Promise ``` Updates the buyer's marketing consent for one channel, or every channel with `channel: 'all'`. Requires a stored session token. | Parameter | Type | Description | | --- | --- | --- | | `input` | `MarketingConsentUpdateInput` | `channel` (a channel or `'all'`) and `optIn`. | Returns: `Promise` ```typescript await lynkow.customers.marketingConsent.update({ channel: 'email', optIn: false }) ``` --- ### `passwordReset.confirm` ```typescript passwordReset.confirm(input: PasswordResetConfirmInput): Promise ``` Sets a new password with the single-use token from the reset email. Earlier session tokens stop working, and the buyer then logs in with the new password. | Parameter | Type | Description | | --- | --- | --- | | `input` | `PasswordResetConfirmInput` | The `token` and the new `password`. | Returns: `Promise` ```typescript // On the page the reset link opens await lynkow.customers.passwordReset.confirm({ token: params.token, password: form.password }) await lynkow.customers.login({ email: form.email, password: form.password }) ``` --- ### `passwordReset.request` ```typescript passwordReset.request(input: PasswordResetRequestInput, options?: CustomerSpamOptions): Promise ``` Requests a password-reset link for an account email. Resolves the same way whether or not the email is registered. Adds the anti-spam fields; no session token is required. | Parameter | Type | Description | | --- | --- | --- | | `input` | `PasswordResetRequestInput` | The `email` to send a reset link to. | | `options` | `CustomerSpamOptions` | `formStartedAt`, `recaptchaToken` (v3 action `password_reset_request`), `locale` and `fetchOptions`. | Returns: `Promise` ```typescript await lynkow.customers.passwordReset.request({ email: 'alice@example.com' }) // Same message on every outcome: never branch on whether the email is known. show('If this address has an account, a reset link is on its way.') ``` --- ### `login` ```typescript login(input: CustomerLoginInput): Promise ``` Signs a buyer in with email and password, keeps the session token on the client and resolves to `{ customer, token }`. Save `token` yourself to keep the buyer signed in across reloads. Throws `LynkowError` `UNAUTHORIZED` with `apiCode` `CUSTOMER_AUTH_REQUIRED` for every failed sign-in (unknown email, wrong password, account not activated), and `TOO_MANY_REQUESTS` with `RATE_LIMIT_EXCEEDED` after five failed attempts for one email. | Parameter | Type | Description | | --- | --- | --- | | `input` | `CustomerLoginInput` | CustomerLoginInput: `email` and `password`. | Returns: `Promise` ```typescript const { customer, token } = await lynkow.customers.login({ email: 'alice@example.com', password: 'a-strong-passphrase', }) saveToken(token) ``` --- ### `logout` ```typescript logout(options?: CustomerLogoutOptions): Promise ``` Signs the buyer out on this client by clearing the stored session token, with no request. With `{ everywhere: true }` it first revokes every session token of the buyer on the server, and clears the local token even when that call fails. Throws `LynkowError` `UNAUTHORIZED` with `everywhere` when no token is stored or the server rejects it (`apiCode` `CUSTOMER_AUTH_REQUIRED`). | Parameter | Type | Description | | --- | --- | --- | | `options` | `CustomerLogoutOptions` | Optional CustomerLogoutOptions: `everywhere` to revoke every session on the server. | Returns: `Promise` ```typescript await lynkow.customers.logout() // discard the token on this client only await lynkow.customers.logout({ everywhere: true }) // also revoke all sessions server-side ``` --- ### `me` ```typescript me(): Promise ``` Fetches the signed-in buyer and up to 100 of their bookings, latest start first. Until the email is verified, only bookings made while signed in are listed. Requires a stored session token. Throws `LynkowError` `UNAUTHORIZED`, before any request when no token is stored, or with `apiCode` `CUSTOMER_AUTH_REQUIRED` when the server rejects the session. Returns: `Promise` ```typescript const { customer, bookings } = await lynkow.customers.me() for (const booking of bookings) { console.log(`${booking.reference}: ${booking.status} at ${booking.startsAt}`) } ``` --- ### `order` ```typescript order(id: string): Promise ``` Fetches one of the signed-in buyer's orders by its `ord_...` id. Requires a stored session token. Throws `LynkowError` `NOT_FOUND` with `apiCode` `ORDER_NOT_FOUND` when no such order belongs to the buyer on this site or the site does not offer order history, `VALIDATION_ERROR` when `id` is not an order id, and `UNAUTHORIZED` (`CUSTOMER_AUTH_REQUIRED`) without a valid session. | Parameter | Type | Description | | --- | --- | --- | | `id` | `string` | The order's `ord_...` id (Order.id). | Returns: `Promise` ```typescript try { const order = await lynkow.customers.order('ord_...') console.log(order.orderNumber, order.status, order.items.length) } catch (err) { if (isLynkowError(err) && err.apiCode === 'ORDER_NOT_FOUND') { // Not this buyer's order, or it no longer exists. } } ``` --- ### `orders` ```typescript orders(params?: CustomerOrderListParams): Promise ``` Lists the signed-in buyer's orders on this site, newest first, one page at a time. Cancelled orders are included. Requires a stored session token. Throws `LynkowError` `UNAUTHORIZED` (`apiCode` `CUSTOMER_AUTH_REQUIRED`) without a valid session, `VALIDATION_ERROR` for an out-of-range `page` or `limit`, and `NOT_FOUND` with `ORDER_NOT_FOUND` when the site does not offer order history. | Parameter | Type | Description | | --- | --- | --- | | `params` | `CustomerOrderListParams` | Optional CustomerOrderListParams: `page` (from 1) and `limit` (1 to 100, default 20). | Returns: `Promise` ```typescript const { data: orders, meta } = await lynkow.customers.orders({ page: 1, limit: 10 }) for (const order of orders) { console.log(`#${order.orderNumber}: ${order.status}, ${order.totalCents} ${order.currency}`) } const hasMore = meta.currentPage < meta.lastPage ``` --- ### `register` ```typescript register(input: CustomerRegisterInput, options?: CustomerSpamOptions): Promise ``` Starts signup by emailing an activation link to `email`. It creates no session: the buyer finishes with `activation.confirm` on the page the link opens, where the password, terms and profile are collected. Resolves the same way whether or not the address has an account, so show one message either way. Anti-spam fields are added for you; on a reCAPTCHA-protected site pass `options.recaptchaToken` (action `customer_register`). Throws `LynkowError` `VALIDATION_ERROR` for a malformed email, `TOO_MANY_REQUESTS` with `apiCode` `RATE_SUBMISSION_TOO_FAST`, and `BAD_REQUEST` with `RATE_SUBMISSION_EXPIRED`, `SPAM_RECAPTCHA_REQUIRED` or `SPAM_RECAPTCHA_FAILED`. | Parameter | Type | Description | | --- | --- | --- | | `input` | `CustomerRegisterInput` | CustomerRegisterInput: the `email` to send the link to. Only `email` is sent. | | `options` | `CustomerSpamOptions` | Optional CustomerSpamOptions: `recaptchaToken`, `formStartedAt`, and a `locale` hint for the email language. | Returns: `Promise` ```typescript await lynkow.customers.register({ email: 'alice@example.com' }) // Same message on every outcome: never branch on whether the email is known. show('Check your inbox. If this address can be registered, a link is on its way.') ``` --- ### `resendVerification` ```typescript resendVerification(options?: BaseRequestOptions): Promise ``` Kept for compatibility: resolves without sending an email, because every signed-in buyer already has a verified address. Requires a stored session token. Throws `LynkowError` `UNAUTHORIZED`, before any request when no token is stored, or with `apiCode` `CUSTOMER_AUTH_REQUIRED` when the server rejects the session. | Parameter | Type | Description | | --- | --- | --- | | `options` | `BaseRequestOptions` | Optional request options. `locale` is sent but has no effect. | Returns: `Promise` ```typescript await lynkow.customers.resendVerification({ locale: 'fr' }) ``` --- ### `updateMe` ```typescript updateMe(input: CustomerProfileUpdateInput): Promise ``` Sets the signed-in buyer's preferred language, used for account emails, and resolves to the updated Customer. Any language tag is accepted and stored normalized (`'pt_br'` becomes `'pt-BR'`). `null` or `''` clears it, and the site's default language then applies. Throws `LynkowError` `UNAUTHORIZED` (`apiCode` `CUSTOMER_AUTH_REQUIRED`) without a valid session, `FORBIDDEN` with `CUSTOMER_EMAIL_NOT_VERIFIED` before the email is verified, and `VALIDATION_ERROR` for a missing key or an invalid tag. | Parameter | Type | Description | | --- | --- | --- | | `input` | `CustomerProfileUpdateInput` | CustomerProfileUpdateInput: `preferredLocale`, a language tag or `null`. The key is required. | Returns: `Promise` ```typescript const profile = await lynkow.customers.updateMe({ preferredLocale: 'pt' }) console.log(profile.preferredLocale) // 'pt' // Back to the site's default language. await lynkow.customers.updateMe({ preferredLocale: null }) ``` --- ### `verifyEmail` ```typescript verifyEmail(token: string): Promise ``` Confirms a buyer's email address with the single-use token from a verification email. `activation.confirm` already verifies the address, so accounts created through signup do not need this call. It does not sign the buyer in. Throws `LynkowError` `BAD_REQUEST` with `apiCode` `VERIFICATION_LINK_INVALID` for an invalid, expired or used token. | Parameter | Type | Description | | --- | --- | --- | | `token` | `string` | The token from the verification link. | Returns: `Promise` ```typescript await lynkow.customers.verifyEmail(tokenFromEmailLink) ``` --- # CookiesService **Published**: 2026-11-30 **Category**: Services Reads the cookie consent configuration and records consent choices, for a consent UI you build yourself. Available as `lynkow.cookies` on the server and in the browser. For the built-in banner, use `lynkow.consent`. Access via: `lynkow.cookies` ## Methods **3** methods ### `clearCache` ```typescript clearCache(): void ``` Clears this service's cached consent configuration for every locale, so the next `getConfig()` fetches it again. Only useful with `cache: true`. Returns: `void` ```typescript lynkow.cookies.clearCache() ``` --- ### `getConfig` ```typescript getConfig(options?: BaseRequestOptions): Promise ``` Fetches the site's cookie consent configuration: mode, banner texts and styling, categories and the third-party scripts gated on each category. Texts and category labels come in the request locale, falling back to the site's default locale. A site with no consent settings returns a default configuration with `enabled: false`. With `cache: true`, cached for 10 minutes per locale. | Parameter | Type | Description | | --- | --- | --- | | `options` | `BaseRequestOptions` | `locale` overrides the client locale; `fetchOptions` passes a framework cache directive, useful since the banner usually renders on every page. | Returns: `Promise` ```typescript const config = await lynkow.cookies.getConfig({ fetchOptions: { next: { revalidate: 3600, tags: ['lynkow:consent'] } }, }) if (config.enabled) { console.log(config.categories) // [{id: 'necessary', ...}, {id: 'analytics', ...}] console.log(config.texts.acceptAll) // "Accept all" } ``` --- ### `logConsent` ```typescript logConsent(preferences: CookiePreferences, options?: ConsentLogOptions): Promise ``` Records a visitor's consent choice in the site's consent log. In a browser, `visitorId`, `action` and `pageUrl` are filled in for you. Outside a browser, pass `visitorId`. The API records the banner locale it serves for `locale` and the matching text `version` of CookiesService.getConfig. Resolves to a confirmation `message`. Throws `LynkowError` `BAD_REQUEST` (status `0`, nothing sent) outside a browser without `visitorId`, and `VALIDATION_ERROR` for an invalid field such as a relative `pageUrl` or more than 100 categories. | Parameter | Type | Description | | --- | --- | --- | | `preferences` | `CookiePreferences` | Category id to accepted flag, sent as `consentGiven`. At most 100 keys of 1 to 50 characters. | | `options` | `ConsentLogOptions` | `action`, `visitorId`, `pageUrl` (see ConsentLogOptions); `locale` is the banner language, defaulting to the client locale. | Returns: `Promise` ```typescript // Revoking a granted consent: 'withdraw' is never inferred. await lynkow.cookies.logConsent( { necessary: true, analytics: false, marketing: false }, { action: 'withdraw' } ) ``` --- # Submit a form **Published**: 2026-11-30 **Category**: Forms & Reviews ## `POST /forms/:slug/submissions` **Submit a form** Submits to the form translation that `GET /forms/{slug}` serves for the same `locale` and `fallback`. Send values in `data`, keyed by field id. A `checkbox` or `select` field also takes an array, and a `tel` field a `{ countryCode, number }` object. With honeypot on, also send an empty `_hp` and `_ts`, the display time in Unix milliseconds. With reCAPTCHA, send `recaptchaToken`. A failed field returns 422 with `field`, a `VALIDATION_FIELD_*` code and `params`. A closed form returns 400 `RESOURCE_LOCKED`, a failed verification 400 `SPAM_RECAPTCHA_FAILED`, a `requireAuth` form without a customer `Authorization: Bearer` token 401 `CUSTOMER_AUTH_REQUIRED`, and an unknown slug 404. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | object | Yes | Required. Resource data object | | `locale` | string | No | Form translation to submit, such as `en` or `pt-BR`. Served through the locale chain unless `fallback=false`. | | `honeypot` | string | No | Spam-trap field that must remain empty; a filled value causes silent rejection | | `recaptchaToken` | string | No | Token for the site or form verification. v3 needs action `form_submit`. Each token works once. | | `session_id` | string | No | Analytics session UUID. UUID format | | `visitor_id` | string | No | 8-64 characters | | `_hp` | string | No | Spam-trap field that must remain empty when the site uses honeypot protection. | | `_ts` | integer | No | Form-load Unix timestamp in milliseconds when the site uses honeypot protection. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | Spam protection failed: the `_ts` timestamp is too old, or the verification token is missing or invalid. | | `401` | The resource requires a customer session token and none valid was sent | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | | `422` | Validation error | | `429` | Rate limit exceeded, or the `_ts` timestamp is missing, malformed or too recent. | > **Notes:** Limit: 10 per 15 minutes per site and client. A bad `_ts` returns 429 > `RATE_SUBMISSION_TOO_FAST`, or 400 `RATE_SUBMISSION_EXPIRED` if expired. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const form = await lynkow.forms.getBySlug('contact') // Build the payload with field.id as key. The SDK does not transform // semantic names into ids; you must do that yourself based on the schema. const data: Record = {} for (const field of form.schema.fields) { data[field.id] = readValueForField(field) // your UI binding } const result = await lynkow.forms.submit('contact', data) // Never hand `redirectUrl` to `window.location` as it comes: parse it, and // follow it only when it resolves to http or https. function redirectTarget(redirectUrl?: string): string | null { if (!redirectUrl) return null try { const url = new URL(redirectUrl, window.location.href) return url.protocol === 'http:' || url.protocol === 'https:' ? url.href : null } catch { return null } } const target = redirectTarget(result.redirectUrl) if (target) { // The form is configured to send the visitor to a thank-you page window.location.assign(target) } else { // Show the success message console.log(result.message) } ``` ### Examples ```curl # Replace the example _ts with the time in milliseconds when the form was displayed. curl -X POST "https://api.lynkow.com/storefront/{siteId}/forms/contact/submissions" \ -H "Content-Type: application/json" \ -d '{ "data": { "email": "anna.cooper@example.com", "message": "Hi" }, "locale": "en", "_hp": "", "_ts": 1788955200000 }' ``` ```javascript // formStartedAt is Date.now() captured when the form was displayed. await fetch(`https://api.lynkow.com/storefront/${siteId}/forms/contact/submissions`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ data: { email: 'anna.cooper@example.com', message: 'Hi' }, locale: 'en', _hp: '', _ts: formStartedAt, }), }) ``` ### Response Example ```json { "data": { "success": true, "message": "Thanks, we got your message and will reply within 24 hours.", "redirectUrl": "https://acme.io/thank-you" } } ``` --- --- # Update the current customer's address **Published**: 2026-11-30 **Category**: Commerce ## `PATCH /customers/me/addresses/:id` **Update the current customer's address** Updates the fields you send on one of the signed-in customer's addresses; send at least one. An address the customer does not own returns 404 `CUSTOMER_ADDRESS_NOT_FOUND`. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `addressName` | string \| null | No | Label of the address, such as Home or Office | | `firstName` | string | No | Given name; on an address, the recipient's. 1-120 characters | | `lastName` | string | No | Family name; on an address, the recipient's. 1-120 characters | | `company` | string \| null | No | Company name on the address | | `address1` | string | No | 1-255 characters | | `address2` | string \| null | No | Second address line, such as an apartment or suite | | `city` | string | No | 1-120 characters | | `postalCode` | string | No | 1-32 characters | | `province` | string \| null | No | State, province or region of the address | | `countryCode` | string | No | ISO 3166-1 alpha-2 country code | | `phone` | string \| null | No | Phone number, stored as entered: no format is checked | | `isDefaultShipping` | boolean | No | Whether this is the customer's default shipping address. `true` removes that default from their other addresses | | `isDefaultBilling` | boolean | No | Whether this is the customer's default billing address. `true` removes that default from their other addresses | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | | `422` | Validation error | > **Notes:** Returns 401 `CUSTOMER_AUTH_REQUIRED` without a valid session token, and > 409 `RESOURCE_CONFLICT` when another address became the default concurrently. > Limit: 10 per 15 minutes per site and client. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) await lynkow.customers.addresses.update('addr_123', { isDefaultBilling: true }) const addresses = await lynkow.customers.addresses.list() // the previous default is unset ``` ### Examples ```curl curl -X PATCH "https://api.lynkow.com/storefront/{siteId}/customers/me/addresses/addr_..." \ -H "X-Lynkow-Pk: lkw_pk_..." \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "city": "Barcelona" }' ``` --- --- # Create an address for the current customer **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/me/addresses` **Create an address for the current customer** Saves a new address for the signed-in customer. `isDefaultShipping: true` or `isDefaultBilling: true` makes it the default in place of the current one. A customer who already has 20 addresses gets 422 `CUSTOMER_ADDRESSES_LIMIT_REACHED`. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `addressName` | string \| null | No | Label of the address, such as Home or Office | | `firstName` | string | Yes | Required. Given name; on an address, the recipient's. 1-120 characters | | `lastName` | string | Yes | Required. Family name; on an address, the recipient's. 1-120 characters | | `company` | string \| null | No | Company name on the address | | `address1` | string | Yes | Required. 1-255 characters | | `address2` | string \| null | No | Second address line, such as an apartment or suite | | `city` | string | Yes | Required. 1-120 characters | | `postalCode` | string | Yes | Required. 1-32 characters | | `province` | string \| null | No | State, province or region of the address | | `countryCode` | string | Yes | Required. ISO 3166-1 alpha-2 country code | | `phone` | string \| null | No | Phone number, stored as entered: no format is checked | | `isDefaultShipping` | boolean | No | Whether this is the customer's default shipping address. `true` removes that default from their other addresses | | `isDefaultBilling` | boolean | No | Whether this is the customer's default billing address. `true` removes that default from their other addresses | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | > **Notes:** Returns 401 `CUSTOMER_AUTH_REQUIRED` without a valid session token, and > 409 `RESOURCE_CONFLICT` when another address became the default concurrently. > Limit: 10 per 15 minutes per site and client. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const address = await lynkow.customers.addresses.create({ firstName: 'Alice', lastName: 'Martin', address1: '12 rue de la Paix', city: 'Paris', postalCode: '75002', countryCode: 'FR', isDefaultShipping: true, }) ``` ### Examples ```curl curl -X POST "https://api.lynkow.com/storefront/{siteId}/customers/me/addresses" \ -H "X-Lynkow-Pk: lkw_pk_..." \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "firstName": "Anna", "lastName": "Cooper", "address1": "1 Main Street", "city": "Madrid", "postalCode": "28001", "countryCode": "ES" }' ``` --- --- # Book a product reservation slot **Published**: 2026-11-30 **Category**: Commerce ## `POST /products/:idOrSlug/bookings` **Book a product reservation slot** Creates a booking for a published bookable product. Send `startsAt`, `partySize`, the guest contact and `acceptsTerms: true`, plus `offeringId` when the product lists offerings. The server computes the end time and the price. A signed-in customer books with their account details. With a deposit paid online, the booking is `pending` and `deposit` carries the checkout URL. Otherwise it is `confirmed`. Fires the `reservation.booked` webhook and sends the booking emails the site has enabled. Errors (422): `TERMS_PAGE_NOT_CONFIGURED`, `TERMS_NOT_ACCEPTED`, `OFFERING_NOT_FOUND`, `OFFERING_REQUIRED`, `PARTY_SIZE_OUT_OF_RANGE`, `RESOURCE_NOT_IN_POOL`, `SLOT_UNAVAILABLE`, `CAPACITY_EXCEEDED`, `BOOKING_TAX_DISABLED`, `TAX_RATE_UNAVAILABLE`. 403 `ACCOUNT_REQUIRED` for a guest when accounts are required. 404 for an unknown product. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `idOrSlug` | path | string | Yes | Product identifier (prod_ prefixed id) or product slug. Only a product published on the site resolves | | `locale` | query | string | No | Buyer language, as the body `locale`. When both are sent, this one wins. | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `startsAt` | string | Yes | Required. Start datetime (ISO 8601) | | `partySize` | integer (1 to 50) | Yes | Required. Number of guests included in the reservation | | `guestName` | string | Yes | Required. Guest name captured for the reservation. 1-200 characters | | `guestEmail` | string | Yes | Required. Guest email captured for the reservation. Valid email address. Max 320 characters | | `guestPhone` | string | No | Optional guest phone captured for the reservation. 3-40 characters | | `resourceId` | string | No | Reservation calendar identifier (bres_ prefixed id); omit it to let the server assign a free calendar. 1-200 characters | | `offeringId` | string | No | Reservation offering identifier (roff_ prefixed id). 1-200 characters | | `acceptsTerms` | boolean | No | Must be `true`, else 422 `TERMS_NOT_ACCEPTED`. A site without a terms page refuses every request with 422 `TERMS_PAGE_NOT_CONFIGURED` | | `locale` | any | No | Buyer language, never rejected, for the booking emails, terms and deposit payment page. Default: the site's default locale. Unsupported email languages fall back to the base language (`pt-BR` to `pt`), then English. | | `recaptchaToken` | string | No | Verification token, required when the site uses CAPTCHA. A v3 token needs this operation's action. | | `_hp` | string | No | Spam-trap field that must remain empty when the site uses honeypot protection. | | `_ts` | integer | No | Form-load Unix timestamp in milliseconds when the site uses honeypot protection. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | Spam protection failed: the `_ts` timestamp is too old, or the verification token is missing or invalid. | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | | `422` | Validation error | | `429` | Rate limit exceeded, or the `_ts` timestamp is missing, malformed or too recent. | > **Notes:** In honeypot mode, send an empty `_hp` and `_ts` (form display time, Unix > milliseconds). reCAPTCHA v3 needs action `booking_create`. Limit: 10 per > 15 minutes per site and client. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const result = await lynkow.reservations.book('chef-table', { startsAt: '2026-07-10T18:00:00.000Z', partySize: 2, guestName: 'Alice Martin', guestEmail: 'alice@example.com', acceptsTerms: true, // ticked on this page, by this buyer }) if (result.deposit) { window.location.assign(result.deposit.checkoutUrl) } ``` ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const booking = await lynkow.reservations.bookings.create('haircut', { startsAt: '2026-07-10T09:00:00.000Z', partySize: 1, guestName: 'Alice Martin', guestEmail: 'alice@example.com', acceptsTerms: true, }) // booking.status === 'confirmed' ``` --- --- # Get a review by slug or ID **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /reviews/:slugOrId` **Get a review by slug or ID** Fetches one approved review by slug or id. A pending, rejected or unknown review returns 404. The site's review settings decide which author fields are shown. `productId` is null unless the linked product is published. Without `locale`, a multi-language site serves its default-locale review. With `locale`, the review is served through the locale chain. On a multi-language site, `fallback=false` serves the requested locale only and returns 404 when it holds no match. A `fallback` that is not a boolean returns 422. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slugOrId` | path | string | Yes | Review slug or UUID identifier | | `locale` | query | string | No | Language of the review. Without a match, the locale chain serves another one (`isFallback` true) unless `fallback=false`. | | `fallback` | query | boolean (default true) | No | With `locale`, `false` returns 404 when the item is not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=60`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const review = await lynkow.reviews.getBySlug('excellent-service') console.log(review.rating) // 5 console.log(review.content) // "Best experience ever!" ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/reviews/excellent-service?locale=fr" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/reviews/excellent-service?locale=fr`) const { data: review } = await res.json() ``` ### Response Example ```json { "data": { "id": "01J9R5Z3KE7Q1XB4T6F8H2D9P0", "slug": "excellent-service", "authorName": "Anna Cooper", "rating": 5, "title": "Outstanding support.", "content": "The team replied within an hour and the fix shipped the next day.", "productName": "Pro plan", "productId": "prod_01j9zq7m4k2x8v3n6p5r0t1w2w", "isFeatured": true, "reviewDate": "2026-04-22T00:00:00.000Z", "createdAt": "2026-04-22T11:14:30.000Z", "authorCity": "Lyon" } } ``` --- --- # Get public spam settings **Published**: 2026-11-30 **Category**: Analytics & Tracking ## `GET /spam-settings` **Get public spam settings** Returns the site's public spam-protection settings: which method, honeypot or reCAPTCHA, to apply on form submissions, reviews, bookings, customer registration, password-reset requests and checkout. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. `recaptchaSiteKey` is the public key for the > reCAPTCHA script. ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/spam-settings" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/spam-settings`) const { data: spamConfig } = await res.json() ``` ### Response Example ```json { "data": { "protectionMethod": "honeypot", "recaptchaEnabled": false, "recaptchaSiteKey": null, "recaptchaVersion": "v3" } } ``` --- --- # Get cookie consent config **Published**: 2026-11-30 **Category**: Analytics & Tracking ## `GET /cookie-consent/config` **Get cookie consent config** Returns the cookie-consent banner configuration for the site: layout, theme, primary color, texts, declared categories, and the third-party scripts gated on consent. A site with no consent settings gets a default configuration with `enabled` false. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | query | string | No | Language of the banner, matched by exact tag, then base language. An unsupported value uses the site default, then English. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const config = await lynkow.cookies.getConfig({ fetchOptions: { next: { revalidate: 3600, tags: ['lynkow:consent'] } }, }) if (config.enabled) { console.log(config.categories) // [{id: 'necessary', ...}, {id: 'analytics', ...}] console.log(config.texts.acceptAll) // "Accept all" } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/cookie-consent/config" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/cookie-consent/config`) const { data } = await res.json() ``` ### Response Example ```json { "data": { "enabled": true, "consentMode": "opt-in", "showOnFirstVisit": true, "position": "bottom-right", "layout": "floating", "theme": "light", "primaryColor": "#1E40AF", "borderRadius": 12, "fontSize": 14, "showCustomizeButton": true, "orientation": "auto", "maxWidth": 480, "buttonSize": "compact", "themeStyles": { "light": { "primaryColor": "#1E40AF", "bgColor": "#FFFFFF", "textColor": "#0F172A" }, "dark": { "primaryColor": "#60A5FA", "bgColor": "#0F172A", "textColor": "#F8FAFC" } }, "texts": { "description": "We use cookies to improve your experience.", "acceptAll": "Accept all", "rejectAll": "Reject all", "customize": "Customize", "save": "Save preferences", "privacyPolicy": "Privacy policy", "required": "(required)" }, "categories": [ { "id": "necessary", "name": "Necessary", "description": "Required for the site to function.", "required": true, "enabled": true }, { "id": "analytics", "name": "Analytics", "description": "Helps us understand usage.", "required": false, "enabled": true } ], "privacyPolicyUrl": "https://acme.io/privacy", "cookiePolicyUrl": "https://acme.io/cookies", "thirdPartyScripts": [] } } ``` --- --- # List the current customer's addresses **Published**: 2026-11-30 **Category**: Commerce ## `GET /customers/me/addresses` **List the current customer's addresses** Lists the signed-in customer's saved addresses, newest first unless `sortBy` says otherwise. A `limit` above 100 returns 422. The email does not need to be verified. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100, default 20) | No | Number of items per page | | `sortBy` | query | "address_name" \| "created_at" (default "created_at") | No | One of: address_name, created_at | | `sortOrder` | query | "asc" \| "desc" (default "desc") | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | > **Notes:** Without a valid session token, returns 401 `CUSTOMER_AUTH_REQUIRED`. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const addresses = await lynkow.customers.addresses.list() const shipping = addresses.find((a) => a.isDefaultShipping) ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/customers/me/addresses?page=1&limit=20" \ -H "X-Lynkow-Pk: lkw_pk_..." \ -H "Authorization: Bearer " ``` --- --- # Withdraw analytics consent **Published**: 2026-11-30 **Category**: Analytics & Tracking ## `DELETE /analytics/consent` **Withdraw analytics consent** Withdraw analytics consent for the current visitor. Clears the visitor cookies and returns 204 No Content. No request body is required; only the visitor cookies and the site context are read. ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `402` | The site subscription does not currently permit this operation | > **Notes:** Returns 204 with an empty body. Rate-limit bucket: analytics, 600 > requests per minute per site and client. ### Examples ```curl curl -X DELETE --cookie "__Host-lkw_vid=3f8a1c92-..." "https://api.lynkow.com/storefront/{siteId}/analytics/consent" ``` ```javascript await fetch(`https://api.lynkow.com/storefront/${siteId}/analytics/consent`, { method: 'DELETE', credentials: 'include', }) ``` --- --- # Update the current customer's preferred language **Published**: 2026-11-30 **Category**: Commerce ## `PATCH /customers/me` **Update the current customer's preferred language** Sets, replaces or clears the signed-in customer's preferred language, used for the emails sent to them. Any tag is accepted, even one the site does not offer; a malformed one returns 422. Returns 200 with `{ customer }`, shaped like `GET /customers/me` without the bookings. A customer whose email is not verified gets 403 `CUSTOMER_EMAIL_NOT_VERIFIED`. Without a valid session token, returns 401 `CUSTOMER_AUTH_REQUIRED`. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `preferredLocale` | string \| null | Yes | Required. Language tag of letters, digits, `-` and `_`, up to 35 characters, stored normalized (`pt_br` becomes `pt-BR`). `null` or `""` clears it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const profile = await lynkow.customers.updateMe({ preferredLocale: 'pt' }) console.log(profile.preferredLocale) // 'pt' // Back to the site's default language. await lynkow.customers.updateMe({ preferredLocale: null }) ``` --- --- # Delete the current customer's address **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /customers/me/addresses/:id` **Delete the current customer's address** Deletes one of the signed-in customer's addresses and returns 204. Deleting a default address leaves no default of that kind. An address the customer does not own returns 404 `CUSTOMER_ADDRESS_NOT_FOUND`. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | > **Notes:** Without a valid session token, returns 401 `CUSTOMER_AUTH_REQUIRED`. > Limit: 10 per 15 minutes per site and client. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) await lynkow.customers.addresses.remove('addr_123') ``` ### Examples ```curl curl -X DELETE "https://api.lynkow.com/storefront/{siteId}/customers/me/addresses/addr_..." \ -H "X-Lynkow-Pk: lkw_pk_..." \ -H "Authorization: Bearer " ``` --- --- # List the customer's marketing consent **Published**: 2026-11-30 **Category**: Commerce ## `GET /customers/me/marketing-consent` **List the customer's marketing consent** Returns the signed-in customer's marketing consent: one entry per channel with its current opted-in state. A channel with no recorded choice reads as opted out, and every channel reads as opted out until the email is verified. Returns 200 with `{ channels }`. Without a valid session token, returns 401 `CUSTOMER_AUTH_REQUIRED`. > **Note:** Available only on sites with e-commerce enabled. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const { channels } = await lynkow.customers.marketingConsent.list() const emailOptIn = channels.find((c) => c.channel === 'email')?.optedIn ?? false ``` --- --- # Add an item to the cart **Published**: 2026-11-30 **Category**: Commerce ## `POST /cart/lines` **Add an item to the cart** Adds `quantity` of a product variant to the caller's cart. The first add creates the cart, with `locale` as its language; later adds ignore `locale`. A variant already in the cart has its quantity increased, up to 999. A guest's first add returns `cartToken` once: send it in `X-Lynkow-Cart-Token` on later guest calls. The add also removes the lines that can no longer be sold and reports them in `removedLines`. Errors: 422 `OUT_OF_STOCK` past the stock on a site that refuses overselling, 422 `CART_LINES_LIMIT_REACHED` on a full cart, 404 `CART_NOT_FOUND` for a variant not for sale. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `variantId` | string | Yes | Required. Product variant identifier (var_ prefixed id) | | `quantity` | integer (1 to 999) | Yes | Required | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const cart = await lynkow.cart.addLine({ variantId: 'var_9f2c...', quantity: 2 }) if (cart.cartToken) sessionStorage.setItem('lynkow_cart', cart.cartToken) ``` --- --- # Get one of the current customer's orders **Published**: 2026-11-30 **Category**: Commerce ## `GET /customers/me/orders/:id` **Get one of the current customer's orders** Returns one of the signed-in buyer's orders by its `ord_` identifier. Send `X-Lynkow-Pk` and `Authorization: Bearer `. The visibility rule of the order list applies: until the buyer's email is verified, only the orders placed while signed in can be opened. Its `shipments` lists the parcels sent, each with its carrier and tracking link, cancelled parcels left out. The site must have order history and customer accounts turned on. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | | `422` | The `{id}` is not an order identifier. | > **Notes:** 401 without a valid customer session, 422 for a malformed `{id}`, > 404 `ORDER_NOT_FOUND` for an order this buyer cannot see. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) try { const order = await lynkow.customers.order('ord_...') console.log(order.orderNumber, order.status, order.items.length) } catch (err) { if (isLynkowError(err) && err.apiCode === 'ORDER_NOT_FOUND') { // Not this buyer's order, or it no longer exists. } } ``` ### Examples ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/customers/me/orders/${orderId}`, { headers: { 'X-Lynkow-Pk': 'lkw_pk_...', Authorization: `Bearer ${customerSessionToken}`, }, }) const { data } = await res.json() ``` --- --- # List the current customer's orders **Published**: 2026-11-30 **Category**: Commerce ## `GET /customers/me/orders` **List the current customer's orders** Lists the signed-in buyer's orders on this site, newest first, in every status including `cancelled`. Send `X-Lynkow-Pk` and `Authorization: Bearer `. A buyer with a verified email sees every order linked to their account. Until the email is verified, the list holds only the orders placed while signed in: a guest order linked to the account by its email appears once the address is confirmed. Each order's `shipments` lists the parcels sent, each with its carrier and tracking link, cancelled parcels left out. The site must have order history and customer accounts turned on. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | integer (min 1) | No | Page to return. | | `limit` | query | integer (1 to 100) | No | Orders per page, 20 when omitted. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | `page` is below 1, or `limit` is below 1 or above 100. | > **Notes:** Returns 401 without a valid customer session, and 422 for a `limit` > above 100. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const { data: orders, meta } = await lynkow.customers.orders({ page: 1, limit: 10 }) for (const order of orders) { console.log(`#${order.orderNumber}: ${order.status}, ${order.totalCents} ${order.currency}`) } const hasMore = meta.currentPage < meta.lastPage ``` ### Examples ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/customers/me/orders?page=1&limit=20`, { headers: { 'X-Lynkow-Pk': 'lkw_pk_...', Authorization: `Bearer ${customerSessionToken}`, }, }) const { data, meta } = await res.json() ``` --- --- # Serve the IndexNow key file **Published**: 2026-11-30 **Category**: SEO & LLMs ## `GET /:key` **Serve the IndexNow key file** Returns the site's IndexNow key as plain text, so search engines that support IndexNow can verify that you own the site. The key must be the IndexNow key of this site, with IndexNow enabled: any other key, another site's included, returns 404. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `key` | path | string | Yes | The site's IndexNow key (32 hexadecimal characters) followed by `.txt` | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | > **Notes:** Content type: `text/plain`. Never cached (`no-store`). Rate-limit > bucket: general. ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/0123456789abcdef0123456789abcdef.txt" ``` ### Response Example ``` 0123456789abcdef0123456789abcdef ``` --- --- # Get the current customer and bookings **Published**: 2026-11-30 **Category**: Commerce ## `GET /customers/me` **Get the current customer and bookings** Returns the signed-in customer's profile and their bookings, latest start time first, up to 100. Until the email is verified, the stored profile fields are null and the list holds only the bookings made while signed in. Guest bookings made with the same email appear once it is verified. Returns 200 with `{ customer, bookings }`. Without a valid session token, returns 401 `CUSTOMER_AUTH_REQUIRED`. > **Note:** Available only on sites with e-commerce enabled. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const { customer, bookings } = await lynkow.customers.me() for (const booking of bookings) { console.log(`${booking.reference}: ${booking.status} at ${booking.startsAt}`) } ``` --- --- # Preserve resend-verification compatibility **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/resend-verification` **Preserve resend-verification compatibility** Returns 204 and sends no email: activation already verifies the email, so a signed-in customer has nothing to resend. The optional `locale` is accepted and ignored. Without a valid session token, returns 401 `CUSTOMER_AUTH_REQUIRED`. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `locale` | string | No | Accepted for wire compatibility but has no effect on this authenticated 204 no-op | ### Responses | Status | Description | | --- | --- | | `204` | No content | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | > **Notes:** Can return 429 `RATE_LIMIT_EXCEEDED`. No spam fields are needed: the > call is authenticated. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) await lynkow.customers.resendVerification({ locale: 'fr' }) ``` ### Examples ```curl curl -X POST "https://api.lynkow.com/storefront/{siteId}/customers/resend-verification" \ -H "X-Lynkow-Pk: lkw_pk_..." \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "locale": "en" }' ``` --- --- # Get a product collection by slug **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-collections/:slug` **Get a product collection by slug** Returns one product collection by its slug, with `structuredData.graph`, the page's JSON-LD graph. Its `ItemList` holds the collection's first 20 published products, newest first, without those hidden in the served language or in `market`. With `locale`, the slug can also be the translated slug, and the collection is served in the requested locale or its fallback chain: base language, site default locale, then its own language. Errors: 404 `PRODUCT_COLLECTION_NOT_FOUND` for an unknown slug. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | Product collection slug, unique per site | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` returns 404 when the item is not translated into the requested locale. Single-language sites ignore it | | `market` | query | string | No | Market `mkt_` id: products hidden in that market are left out of `structuredData`. Unknown, draft or malformed values are ignored | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) import { renderJsonLdGraph } from 'lynkow' const collection = await lynkow.productCollections.getBySlug('summer', { locale: 'fr' }) //
``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/product-collections/summer-2026" \ -H "X-Lynkow-Pk: lkw_pk_..." ``` ```javascript const res = await fetch( `https://api.lynkow.com/storefront/${siteId}/product-collections/summer-2026`, { headers: { 'X-Lynkow-Pk': publishableKey } } ) const { data } = await res.json() // data.structuredData.graph is ready for an application/ld+json script ``` ### Response Example ```json { "data": { "id": "col_01j9pa0nzk7bx4hq7m2dc9v5t8", "slug": "summer-2026", "path": "/collections/summer-2026", "title": "Summer 2026", "description": "Light pieces for the warm season.", "image": "https://cdn.lynkow.com/sites/acme/collections/summer-2026.jpg", "imageAlt": "Linen shirts on a beach towel", "seoTitle": null, "seoDescription": null, "keywords": "summer, linen", "canonicalUrl": null, "ogTitle": null, "ogDescription": null, "ogImage": null, "ogImageAlt": null, "twitterCard": "summary_large_image", "noIndex": false, "noFollow": false, "structuredData": { "graph": [ { "@context": "https://schema.org", "@id": "https://www.acme.io/collections/summer-2026#auto:collectionpage", "@type": "CollectionPage", "name": "Summer 2026", "inLanguage": "en", "description": "Light pieces for the warm season.", "url": "https://www.acme.io/collections/summer-2026", "mainEntity": { "@type": "ItemList", "itemListElement": [ { "@type": "ListItem", "position": 1, "url": "https://www.acme.io/products/linen-shirt", "name": "Linen shirt" } ] } } ] } } } ``` --- --- # Log a storefront customer out **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/logout` **Log a storefront customer out** Signs the customer out. A plain logout only acknowledges the call: discard the session token on the client. Send `everywhere: true` to revoke every session token issued to this customer so far, the current one included. Returns 204. Without a valid session token, returns 401 `CUSTOMER_AUTH_REQUIRED`. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `everywhere` | boolean | No | When true, invalidates every prior session for this customer ("log out everywhere"); otherwise the logout is a client-side token discard. | ### Responses | Status | Description | | --- | --- | | `204` | No content | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) await lynkow.customers.logout() // discard the token on this client only await lynkow.customers.logout({ everywhere: true }) // also revoke all sessions server-side ``` --- --- # List product collections **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-collections` **List product collections** Lists the site's product collections, paginated, sorted by their source title in every language. Items carry no `structuredData`: the single read does. With `locale`, each collection is served in the requested locale or its fallback chain: base language (`fr-CA` to `fr`), site default locale, then its own language. A locale the site does not enable counts as a missing translation. `Content-Language` lists the languages served, the requested one first. Errors: 422 for a non-boolean `fallback`. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100, default 20) | No | Number of items per page | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const { data, meta } = await lynkow.productCollections.list({ page: 1, limit: 20 }, { locale: 'fr' }) ``` --- --- # Confirm a storefront customer password reset **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/password-reset/confirm` **Confirm a storefront customer password reset** Sets a new `password` with the `token` from a password reset email. The email is marked verified and every earlier session token stops working, so the customer signs in again with `POST /customers/login`. Returns 200 `{ ok: true }`. An invalid, expired or used link returns 400 `VERIFICATION_LINK_INVALID`. After ten failed attempts from one client, sign-ins included, further attempts return 429 `RATE_LIMIT_EXCEEDED` with a `Retry-After` header for up to 15 minutes. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | Yes | Required. Min 1 character | | `password` | string | Yes | Required. 8-100 characters | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) // On the page the reset link opens await lynkow.customers.passwordReset.confirm({ token: params.token, password: form.password }) await lynkow.customers.login({ email: form.email, password: form.password }) ``` --- --- # Render llms.txt **Published**: 2026-11-30 **Category**: SEO & LLMs ## `GET /llms.txt` **Render llms.txt** Returns the site's `llms.txt`, a Markdown index with one link per line under `##` section headings. Article and page links point at their Markdown rendering (the `.md` suffix). A site with a product catalog also gets `## Products`, `## Product categories` and `## Collections` sections, linking to the pages themselves with no price or stock. Empty sections and items marked noindex are left out. On a multi-language site, `locale` selects the language, as `/{locale}/llms.txt` does. Returns 404 when llms.txt is disabled for the site. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Content type: `text/markdown; charset=utf-8`. Cache: > `Cache-Control: public, max-age=0, s-maxage=3600`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // In a Next.js route handler (app/llms.txt/route.ts) export async function GET() { const md = await lynkow.seo.llmsTxt() return new Response(md, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } }) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/llms.txt" ``` ### Response Example ``` # Acme > Linen clothing, cut and sewn in Portugal. ## Sitemap - [Sitemap XML](https://www.acme.io/sitemap.xml) ## Blog - [How we pick our linen](https://www.acme.io/blog/how-we-pick-our-linen.md): Where our fabric comes from. ## Products - [Linen Shirt](https://www.acme.io/products/linen-shirt) - [Wool Scarf](https://www.acme.io/products/wool-scarf) ## Product categories - [Shirts](https://www.acme.io/product-categories/shirts) ## Collections - [Summer](https://www.acme.io/collections/summer) ## Pages - [Pricing](https://www.acme.io/pricing.md): Simple pricing. Start free, scale when you grow. ``` --- --- # Update the current customer's marketing consent **Published**: 2026-11-30 **Category**: Commerce ## `PATCH /customers/me/marketing-consent` **Update the current customer's marketing consent** Opts the signed-in customer in or out of marketing on one channel, or on every channel with `channel: "all"`. Send `optIn: true` to opt in and `optIn: false` to opt out. On an opt-in, the optional `locale` and `consentVersion` record the language and version of the consent text the buyer saw. An opt-out ignores them and keeps the record of the earlier opt-in. Returns 200 with the updated `{ channels }`. A customer whose email is not verified gets 403 `CUSTOMER_EMAIL_NOT_VERIFIED`. Without a valid session token, returns 401 `CUSTOMER_AUTH_REQUIRED`. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `channel` | "whatsapp" \| "email" \| "all" | Yes | Required. One of: whatsapp, email, all | | `optIn` | boolean | Yes | Required. Opt-in verb: true re-opts the channel in, false opts it out (opt-out always wins). | | `locale` | string | No | Language of the consent text, recorded with an opt-in. An opt-out or an unusable value is ignored | | `consentVersion` | string | No | Label of the consent text shown, recorded with an opt-in. Cut to 100 characters; an unusable value is ignored. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) await lynkow.customers.marketingConsent.update({ channel: 'email', optIn: false }) ``` --- --- # Confirm a storefront customer's email address **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/verify-email` **Confirm a storefront customer's email address** Confirms a customer's email address with the `token` from a verification email. Once verified, bookings made as a guest with that email appear in `GET /customers/me`. Activation already verifies the email, so accounts created through `POST /customers/activation/confirm` do not need this call. Returns 200 with `{ emailVerified: true }`. An invalid, expired or used link returns 400 `VERIFICATION_LINK_INVALID`. After ten failed attempts from one client, sign-ins included, further attempts return 429 `RATE_LIMIT_EXCEEDED` with a `Retry-After` header for up to 15 minutes. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | Yes | Required. Min 1 character | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) await lynkow.customers.verifyEmail(tokenFromEmailLink) ``` --- --- # Activate a storefront customer account **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/activation/confirm` **Activate a storefront customer account** Completes an account from its activation link and signs the buyer in. Send the link's `token`, a `password` and `acceptsTerms: true`. `firstName`, `lastName` and `phone` fill only empty profile fields. With `marketingOptIn: true`, the buyer opts in on every marketing channel without an earlier choice. The email is marked verified and earlier session tokens stop working. The buyer may also receive a one-time welcome email. Returns 200 with `{ customer, token }`. An invalid, expired or used link, or an account that already has a password, returns 400 `VERIFICATION_LINK_INVALID`. After ten failed attempts from one client, sign-ins included, further attempts return 429 `RATE_LIMIT_EXCEEDED` with a `Retry-After` header for up to 15 minutes. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `token` | string | Yes | Required. Min 1 character | | `password` | string | Yes | Required. 8-100 characters | | `firstName` | string | No | Given name; on an address, the recipient's. 1-100 characters | | `lastName` | string | No | Family name; on an address, the recipient's. 1-100 characters | | `phone` | string | No | Phone number, stored as entered: no format is checked. 3-40 characters | | `locale` | string | No | The buyer's preferred language, stored normalized; an unusable value is ignored. The accepted terms and any marketing opt-in are recorded in it | | `acceptsTerms` | "true" | Yes | Required. Terms-of-service acceptance. Any other value returns 422 and the account is not activated. One of: true | | `marketingOptIn` | boolean | No | Optional marketing opt-in. When true, opts the customer in on every supported marketing channel. | | `consentVersion` | string | No | Label of the consent text shown, recorded with an opt-in. Cut to 100 characters; an unusable value is ignored. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) // On the page the activation link opens, e.g. /account/activate/[token] const { customer } = await lynkow.customers.activation.confirm({ token: params.token, password: form.password, acceptsTerms: true, firstName: 'Alice', }) ``` --- --- # Log a cookie consent action **Published**: 2026-11-30 **Category**: Analytics & Tracking ## `POST /cookie-consent/logs` **Log a cookie consent action** Records one consent action from the site's consent banner. Send `visitorId`, `action` and `consentGiven`, plus the optional `sessionId`, `pageUrl` and `locale`. Pass the `locale` you sent to `GET /cookie-consent/config`: the log then records the banner language served and its `version`. It also stores the `User-Agent` and a site-scoped hash of the client IP, never the raw IP. The route takes no credential and no spam fields, so a logged row does not prove that a real visitor made the choice. Returns 200. An invalid field returns 422 and nothing is recorded. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `visitorId` | string | Yes | Required. The visitor's stable identifier, 1 to 64 characters after surrounding whitespace is trimmed. | | `sessionId` | string | No | Analytics session ID. UUID format | | `action` | "accept_all" \| "reject_all" \| "customize" \| "withdraw" | Yes | Required. The consent action: `accept_all`, `reject_all`, `customize` or `withdraw`. | | `consentGiven` | object | Yes | Required. Maps each category id to `true` (accepted) or `false`. At most 100 keys, each 1 to 50 characters. | | `pageUrl` | string | No | Absolute `http` or `https` URL of the page, up to 2048 characters. Any other scheme, or none, returns 422. | | `locale` | string | No | Banner language requested, as sent to `GET /cookie-consent/config`. An unmatched value uses the site default, then English. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Rate-limit bucket: analytics, 600 requests per minute per site and > client. Exceeding it returns 429 `RATE_LIMIT_EXCEEDED`. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // Revoking a granted consent: 'withdraw' is never inferred. await lynkow.cookies.logConsent( { necessary: true, analytics: false, marketing: false }, { action: 'withdraw' } ) ``` ### Examples ```curl curl -X POST "https://api.lynkow.com/storefront/{siteId}/cookie-consent/logs" \ -H "Content-Type: application/json" \ -d '{ "visitorId": "v_8f3a2c91d4e7", "sessionId": "3f2b8c1e-7a4d-4e9b-9c2a-5d6e7f8a9b0c", "action": "customize", "consentGiven": { "necessary": true, "analytics": true, "marketing": false, "preferences": true }, "pageUrl": "https://www.example.com/pricing" }' ``` ```javascript await fetch(`https://api.lynkow.com/storefront/${siteId}/cookie-consent/logs`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ visitorId, action: 'customize', consentGiven: { necessary: true, analytics: true, marketing: false, preferences: true }, pageUrl: `${location.origin}${location.pathname}`, }), }) ``` ### Response Example ```json { "data": { "message": "Consent logged successfully" } } ``` --- --- # Log a storefront customer in **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/login` **Log a storefront customer in** Signs a customer in with `email` and `password` and returns a session token, valid for 30 days. Send it as `Authorization: Bearer ` on the signed-in customer routes. Every failure returns the same 401 `CUSTOMER_AUTH_REQUIRED`: an unknown email, a wrong password, or an account that is not activated. After five failed attempts for one email, or ten from one client, further attempts return 429 `RATE_LIMIT_EXCEEDED` with a `Retry-After` header for up to 15 minutes. Returns 200 with `{ customer, token }`. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | Yes | Required. Valid email address | | `password` | string | Yes | Required. 1-100 characters | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const { customer, token } = await lynkow.customers.login({ email: 'alice@example.com', password: 'a-strong-passphrase', }) saveToken(token) ``` --- --- # Get a global block by slug **Published**: 2026-11-30 **Category**: Pages & Site Blocks ## `GET /global/:slug` **Get a global block by slug** Fetch a single global Site Builder block by slug (header, footer, nav, CTA banner). Globals are reused across pages and resolved once per locale. Sets `ETag` and `Cache-Control`. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` returns 404 when the item is not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | | `422` | Validation error | > **Notes:** Sets `ETag` and `Cache-Control: public, max-age=0, s-maxage=300`. > Rate-limit bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const result = await lynkow.blocks.getBySlug(slug) ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/global/main-nav?locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/global/main-nav?locale=en`) const { data } = await res.json() ``` ### Response Example ```json { "data": { "slug": "main-nav", "name": "Main navigation", "data": { "items": [ { "label": "Pricing", "href": "/pricing" }, { "label": "Docs", "href": "/docs" } ] } } } ``` --- --- # Register a storefront customer account **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/register` **Register a storefront customer account** Starts account creation for an email address. Send `email` and an optional `locale` for the activation email. Returns 200 `{ ok: true }` whether or not the address is registered, and 422 for an invalid `email`. An address with no account yet receives an activation link, valid for 24 hours, unless the store changed that customer's email in the last 72 hours. A repeat call sends no new link while the previous one is still valid. The buyer completes the account with `POST /customers/activation/confirm`, which collects the password, terms acceptance, profile and marketing consent. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | Yes | Required. Valid email address | | `locale` | string | No | Language of the activation email, never rejected; the site default when omitted. Not stored: send `locale` again at activation. Unsupported email languages fall back to the base language (`pt-BR` to `pt`), then English. | | `recaptchaToken` | string | No | Verification token, required when the site uses CAPTCHA. A v3 token needs this operation's action. | | `_hp` | string | No | Spam-trap field that must remain empty when the site uses honeypot protection. | | `_ts` | integer | No | Form-load Unix timestamp in milliseconds when the site uses honeypot protection. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | Spam protection failed: the `_ts` timestamp is too old, or the verification token is missing or invalid. | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | | `429` | Rate limit exceeded, or the `_ts` timestamp is missing, malformed or too recent. | > **Notes:** A v3 token uses the action `customer_register`. With honeypot protection, > `_ts` is required even when the `_hp` check is off. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) await lynkow.customers.register({ email: 'alice@example.com' }) // Same message on every outcome: never branch on whether the email is known. show('Check your inbox. If this address can be registered, a link is on its way.') ``` --- --- # Get a page's JSON-LD **Published**: 2026-11-30 **Category**: Pages & Site Blocks ## `GET /pages/:slug/json-ld` **Get a page's JSON-LD** Returns the JSON-LD graph of a published page as a JSON array of schema.org nodes under `data`, the same graph as `structuredData.graph` on `GET /pages/{slug}`. To publish it, wrap the array in a `` in a value would reach the // HTML parser. ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/pages/pricing/json-ld?locale=en" ``` ### Response Example ```json { "data": [ { "@context": "https://schema.org", "@id": "https://acme.io/#organization", "@type": "Organization", "name": "Acme Inc.", "url": "https://acme.io" }, { "@context": "https://schema.org", "@id": "https://acme.io/pricing#webpage", "@type": "WebPage", "name": "Pricing", "url": "https://acme.io/pricing", "inLanguage": "en" } ] } ``` --- --- # Remove an item from the cart **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /cart/lines/:variantId` **Remove an item from the cart** Removes the line of the `{variantId}` variant (a `var_` id) from the caller's cart and returns the cart. The other lines that can no longer be sold are removed too and reported in `removedLines`. A malformed id, a variant not in the cart, or no cart returns 404 `CART_NOT_FOUND`. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `variantId` | path | string | Yes | Product variant identifier (var_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Success | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const line = cart.items[0] if (line.variantId) { const updated = await lynkow.cart.removeLine(line.variantId) render(updated.items) } ``` --- --- # List pages **Published**: 2026-11-30 **Category**: Pages & Site Blocks ## `GET /pages` **List pages** Lists the site's published Site Builder pages with their metadata, for indexes and sitemaps. Build links from `publicPath`, which is always set; `path` is the stored value and can be null. The list is not paginated. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // List all pages const { data } = await lynkow.pages.list() // List only legal documents const { data } = await lynkow.pages.list({ tag: 'legal' }) ``` ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const result = await lynkow.legal.list() ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/pages?locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/pages?locale=en`) const { data } = await res.json() ``` ### Response Example ```json { "data": [ { "id": "01J9R4QV6ZK7T0W1FH3DXB6P2Y", "slug": "pricing", "name": "Pricing", "path": "/pricing", "publicPath": "/en/pricing", "locale": "en", "tags": [ "public", "conversion" ], "updatedAt": "2026-05-10T09:14:22.000Z" }, { "id": "01J9R5A2NZ9TBX8K4Q3D6H2V1L", "slug": "about", "name": "About", "path": "/about", "publicPath": "/en/about", "locale": "en", "tags": [ "public" ], "updatedAt": "2026-05-03T14:02:08.000Z" } ] } ``` --- --- # Set an item quantity **Published**: 2026-11-30 **Category**: Commerce ## `PATCH /cart/lines` **Set an item quantity** Sets the quantity of one variant's line in the caller's cart and returns the cart. To remove a line, call `DELETE /cart/lines/{variantId}`. The line takes the current catalogue price. The call first removes the lines that can no longer be sold, the requested one included, and reports them in `removedLines`. Errors: 422 `OUT_OF_STOCK` above the variant's stock on a site that refuses overselling, with nothing changed, and 404 `CART_NOT_FOUND` when there is no cart or the variant is not in it. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `variantId` | string | Yes | Required. Product variant identifier (var_ prefixed id) | | `quantity` | integer (1 to 999) | Yes | Required | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) // The buyer typed 3 into the quantity box: set the line to exactly 3. const cart = await lynkow.cart.updateLine({ variantId: 'var_9f2c...', quantity: 3 }) console.log(cart.subtotalCents) ``` --- --- # Claim a guest cart after signing in **Published**: 2026-11-30 **Category**: Commerce ## `POST /cart/claim` **Claim a guest cart after signing in** Moves the guest cart of `cartToken` to the signed-in customer. Requires a customer session, else 401. A customer without a cart takes the guest cart whole. Otherwise the guest lines merge into the customer's cart, summing a shared variant's quantities up to 999, and the guest cart is closed. Unsellable lines are removed and reported in `removedLines`. Always returns the customer's cart, created empty if needed. A wrong, used or other-site token claims nothing. Errors: 422 `OUT_OF_STOCK` when a sum exceeds the stock where overselling is refused, 422 `CART_LINES_LIMIT_REACHED` past the line limit. Both keep the token valid. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `cartToken` | string | Yes | Required. 43-43 characters | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key or customer session token | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) await lynkow.cart.addLine({ variantId: 'var_9f2c...', quantity: 2 }) await lynkow.customers.login({ email, password }) const cart = await lynkow.cart.claim() ``` --- --- # Get a published product **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:idOrSlug` **Get a published product** Returns one published product by its `prod_` id or its slug, with `structuredData.graph`, the page's JSON-LD graph. With `locale`, the slug can also be the translated slug, and the product is served in the requested locale or its fallback chain: base language, site default locale, then its own language. Prices include VAT where it applies, for a delivery to `country`, else to the merchant's country, which bookable products always use. Errors: 404 `PRODUCT_NOT_FOUND` for an unknown or unpublished product, or one hidden in the language read (the default locale without `locale`) or in `market`. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `idOrSlug` | path | string | Yes | Product identifier (prod_ prefixed id) or product slug. Only a product published on the site resolves | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` returns 404 when the item is not translated into the requested locale. Single-language sites ignore it | | `market` | query | string | No | Market `mkt_` id: a product hidden in that market returns 404. An unknown, draft or malformed value is ignored | | `country` | query | string | No | Delivery country (ISO 3166-1 alpha-2) the prices include VAT for. An unusable value falls back to the merchant's country | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const product = await lynkow.products.getBySlug('classic-tee', { locale: 'fr', country: 'FR' }) for (const variant of product.variants) { const label = variant.optionValues.map((ov) => ov.value).join(' / ') console.log(label, variant.priceGrossCents, variant.availability) } ``` --- --- # Update the cart **Published**: 2026-11-30 **Category**: Commerce ## `PATCH /cart` **Update the cart** Sets the language, delivery address, shipping option and pickup point of the caller's cart. An absent field keeps its value. The cart keeps its shipping option only while it is active in the market of the delivery country, else the option is cleared. A cart without a delivery country has no shipping. A new address can change the VAT and the amounts charged. `pickupPointId` takes an `id` from `GET /pickup-points` for the cart's option; `null` clears it. Changing the option clears the point unless a new one is sent. Prices and unsellable lines are updated as on `GET /cart`. Errors: 422 `SHIPPING_OPTION_NO_PICKUP_POINTS` or `PICKUP_POINT_INVALID`, 503 `PICKUP_POINT_SEARCH_UNAVAILABLE`, 422 for a malformed `shippingOptionId` or an unknown `countryCode`. No cart, or a wrong token, returns 404 `CART_NOT_FOUND`. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr") | | `deliveryAddress` | object \| null | No | Replaces the delivery address whole; its country sets the market and VAT. Omit it to keep it, null clears it. | | `shippingOptionId` | string \| null | No | A shipping option (prefixed `shp_`) active in the delivery country's market. Omit it to keep the choice, null clears it. | | `pickupPointId` | string \| null | No | The `id` of a point from `GET /pickup-points` for the cart's shipping option. Omit it to keep the point, null clears it. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | | `503` | `PICKUP_POINT_SEARCH_UNAVAILABLE`: the pickup point cannot be checked right now. Nothing is changed. | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const cart = await lynkow.cart.setLocale('it') console.log(cart.locale) // 'it' ``` ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const { data: options } = await lynkow.shippingOptions.list({ market: 'mkt_...' }) const cart = await lynkow.cart.update({ deliveryAddress: { firstName: 'Alice', address1: '12 rue de la Paix', city: 'Paris', postalCode: '75002', countryCode: 'FR' }, shippingOptionId: options[0]?.id ?? null, }) if (cart.shippingOptionId === null) { // The choice was not kept: ask the buyer to pick again. } // For an option with `requiresPickupPoint`, store the point chosen from `lynkow.pickupPoints.search()`: // await lynkow.cart.update({ pickupPointId: point.id }) ``` --- --- # Get the current cart **Published**: 2026-11-30 **Category**: Commerce ## `GET /cart` **Get the current cart** Returns the caller's active cart with its lines and totals. A signed-in customer gets their own cart. A guest sends the `X-Lynkow-Cart-Token` header. No cart, or a wrong token, returns 404 `CART_NOT_FOUND`. Totals include provisional VAT for the delivery country, else the `country` query parameter, else the merchant's country. Checkout recomputes every figure. Reading the cart applies the current catalogue prices. It removes the lines that can no longer be sold and reports them in `removedLines`. It also clears a shipping option no longer offered for the delivery country. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `country` | query | string | No | Country (ISO 3166-1 alpha-2) for this response's VAT while the cart has no delivery country. An invalid code returns 422 | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) try { const cart = await lynkow.cart.retrieve() render(cart.items, cart.totalCents) } catch (error) { if (isLynkowError(error) && error.code === 'NOT_FOUND') renderEmptyCart() else throw error } ``` --- --- # List a bookable product's reservation offerings **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:idOrSlug/offerings` **List a bookable product's reservation offerings** Lists the offerings of a published bookable product, in the merchant's order. Send an offering's `id` as `offeringId` to read availability and to book. `priceCents` is the price the buyer pays, VAT included at the merchant country's rate. Offerings with a minimum party size above 50 are left out. With `locale`, each label follows the site fallback chain, ending with the product's language. `fallback=false` leaves out the offerings whose label is not written in the requested locale. 404 `PRODUCT_NOT_FOUND` for an unknown, unpublished or non-bookable product, or one without resources, and when offering selection is not enabled on the site. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `idOrSlug` | path | string | Yes | Product identifier (prod_ prefixed id) or product slug. Only a product published on the site resolves | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const offerings = await lynkow.reservations.offerings('haircut', { locale: 'es' }) for (const offering of offerings) { console.log(`${offering.label}: ${offering.priceCents} cents, ${offering.durationMin} min`) } ``` --- --- # List a bookable product's selectable resources **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:idOrSlug/resources` **List a bookable product's selectable resources** Lists the resources a buyer can choose among to book a published bookable product, such as stylists or rooms. Send a resource's `id` as `resourceId` when booking to request it. The list is empty when the product assigns the resource itself. With `locale`, each name follows the site fallback chain, ending with the resource's own language. `fallback=false` leaves out the resources whose name is not written in the requested locale. 404 `PRODUCT_NOT_FOUND` for an unknown, unpublished or non-bookable product, or one without resources. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `idOrSlug` | path | string | Yes | Product identifier (prod_ prefixed id) or product slug. Only a product published on the site resolves | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const resources = await lynkow.reservations.resources('haircut', { locale: 'es' }) const booking = await lynkow.reservations.book('haircut', { startsAt: '2026-07-10T09:00:00.000Z', partySize: 1, guestName: 'Alice Martin', guestEmail: 'alice@example.com', resourceId: resources[0]?.id, // undefined assigns one automatically acceptsTerms: true, }) ``` --- --- # Refresh a storefront payment **Published**: 2026-11-30 **Category**: Commerce ## `POST /payments/:id/refresh` **Refresh a storefront payment** Refreshes one booking deposit or order payment from the payment provider's current state, for example when the buyer returns from checkout. Returns the payment `status`, with `bookingStatus` for a deposit or `orderStatus` for an order. The caller must be the signed-in customer who owns the booking or order, or send the payment capability issued with checkout in the `X-Lynkow-Payment-Capability` header. A payment id alone is not enough. An unknown id or a missing or invalid capability returns 403 `PAYMENT_CAPABILITY_REQUIRED`. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | `STOREFRONT_KEY_ORIGIN_NOT_ALLOWED`: the storefront key origin is not allowed. `PAYMENT_CAPABILITY_REQUIRED`: no owning customer session or valid payment capability, or an unknown payment id | | `404` | Not found | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const order = await lynkow.checkout.placeOrder({ email, paymentMethod: 'card', acceptsTerms: true }) // Keep paymentId and captureToken privately for the hosted-checkout return page. if (order.payment) { const result = await lynkow.checkout.refreshPayment( order.payment.paymentId, order.payment.captureToken, ) if (result.status === 'captured') showConfirmation(order.id) } ``` ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const result = await lynkow.reservations.book('chef-table', { startsAt: '2026-07-10T18:00:00.000Z', partySize: 2, guestName: 'Alice Martin', guestEmail: 'alice@example.com', acceptsTerms: true, }) if (!result.deposit) return const refreshed = await lynkow.reservations.refreshPayment( result.deposit.paymentId, result.deposit.captureToken, ) if (refreshed.bookingStatus === 'confirmed') { showConfirmation() } ``` --- --- # List accepted payment methods **Published**: 2026-11-30 **Category**: Commerce ## `GET /payment-methods` **List accepted payment methods** Lists the payment methods the site accepts for online payment at checkout, each with a display name and a logo URL, card brands first. Not paginated. The list is the same for every visitor. The list is empty when the site does not take online payment, so render nothing then. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Every visitor reads the same response. Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const { data: methods } = await lynkow.paymentMethods.list() if (methods.length > 0) { // Render one logo per method, its name as the alt text. for (const method of methods) console.log(method.name, method.logoUrl) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/payment-methods" \ -H "X-Lynkow-Pk: lkw_pk_..." ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/payment-methods`, { headers: { 'X-Lynkow-Pk': publishableKey }, }) const { data } = await res.json() // One logo per accepted method, for the footer const logos = data.map((method) => ({ src: method.logoUrl, alt: method.name })) ``` ### Response Example ```json { "data": [ { "type": "visa", "name": "Visa", "kind": "card_brand", "logoUrl": "https://api.lynkow.com/payment-logos/visa.svg" }, { "type": "mastercard", "name": "Mastercard", "kind": "card_brand", "logoUrl": "https://api.lynkow.com/payment-logos/mastercard.svg" }, { "type": "paypal", "name": "PayPal", "kind": "method", "logoUrl": "https://api.lynkow.com/payment-logos/paypal.svg" } ] } ``` --- --- # Read an order through a guest link **Published**: 2026-11-30 **Category**: Commerce ## `GET /orders/guest` **Read an order through a guest link** Returns one order to a buyer who checked out as a guest. Send `X-Lynkow-Pk` and the access token from the buyer's order email in the `X-Lynkow-Order-Token` header. No customer session is needed, and customer accounts can be off. The site must have order history turned on. Its `shipments` lists the parcels sent, each with its carrier and tracking link, cancelled parcels left out. The response carries `Cache-Control: no-store`: do not cache it. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | The `X-Lynkow-Order-Token` header is missing or empty. | > **Notes:** A missing token returns 422. An unknown or revoked token returns 404 > `ORDER_NOT_FOUND`, also with `Cache-Control: no-store`. Limit: 10 per 15 > minutes per site and client. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) try { const order = await lynkow.orders.getGuest(tokenFromTheUrl) renderOrder(order) } catch (err) { if (isLynkowError(err) && err.status === 404) { // The link is no longer valid: show a "link expired" page. } } ``` ### Examples ```javascript // `orderToken` is the access token from the buyer's order email const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/orders/guest`, { headers: { 'X-Lynkow-Pk': 'lkw_pk_...', 'X-Lynkow-Order-Token': orderToken, }, cache: 'no-store', }) const { data } = await res.json() ``` --- --- # Place an order **Published**: 2026-11-30 **Category**: Commerce ## `POST /checkout` **Place an order** Places an order from the caller's active cart and closes the cart. A guest sends `X-Lynkow-Cart-Token` and an `email`. When the site requires accounts, a guest gets 403 `ACCOUNT_REQUIRED`. A card payment returns `payment.checkoutUrl`. With `paymentFlow: 'embedded'` it returns what mounts the payment form in your page instead. A retry with the same `paymentFlow` while the payment is open returns the same response. Fires the `order.placed` webhook and sends a confirmation email. Errors (422): `TERMS_PAGE_NOT_CONFIGURED`, `TERMS_NOT_ACCEPTED`, `CART_EMPTY`, `OUT_OF_STOCK`, `DELIVERY_COUNTRY_REQUIRED`, `MARKET_COUNTRY_NOT_SERVED`, `PRODUCT_NOT_SOLD_IN_MARKET`, `SHIPPING_OPTION_INVALID`, `SHIPPING_UNAVAILABLE`, `PICKUP_POINT_REQUIRED`, `PICKUP_POINT_INVALID`, `TOTAL_CHANGED`, `DESTINATION_NOT_TAXABLE`, `TAX_RATE_UNAVAILABLE`, `CHECKOUT_TAX_DISABLED`, `PAYMENT_METHOD_UNAVAILABLE`, `PAYMENT_FLOW_UNAVAILABLE`. A refused checkout leaves the cart open. No cart returns 404 `CART_NOT_FOUND`, a completed cart 409 `CART_ALREADY_COMPLETED`, and a payment page that cannot open 503 `PAYMENT_CHECKOUT_UNAVAILABLE`. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `X-Lynkow-Cart-Token` | header | string | No | Guest cart secret returned when the cart was created. Omit for an authenticated customer checkout. | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | No | Guest receipt email. Optional for an authenticated customer. | | `contact` | object | No | Optional buyer contact snapshot for this order. | | `address` | object | No | Optional delivery or collection address snapshot. | | `paymentMethod` | "on_site" \| "cash_on_delivery" \| "click_and_collect" \| "card" | No | Payment method selected by the buyer. One of: on_site, cash_on_delivery, click_and_collect, card. Card requires online payment availability. | | `paymentFlow` | "hosted" \| "embedded" | No | How a card order is paid: `hosted`, the default, returns `payment.checkoutUrl`; `embedded` returns what the in-page payment form needs. Ignored for other methods. | | `fulfillmentMode` | "delivery" \| "pickup" | No | How the order is fulfilled: `delivery`, the default, or `pickup`, collected at the merchant's premises with no shipping charge. | | `shippingOptionId` | string | No | A shipping option (prefixed `shp_`) from `GET /shipping-options` for the delivery country. Omit it to use the cart option. | | `expectedTotalCents` | integer (0 to 9007199254740991) | No | The total shown to the buyer, in minor units. Any other total returns 422 `TOTAL_CHANGED`. Optional. | | `acceptsTerms` | boolean | No | Must be `true`, else 422 `TERMS_NOT_ACCEPTED`. A site without a terms page refuses every request with 422 `TERMS_PAGE_NOT_CONFIGURED` | | `locale` | string | No | Buyer language, never rejected. It becomes the order language when the cart has none, which sets the emails, terms and payment page. Unsupported email languages fall back to the base language (`pt-BR` to `pt`), then English. | | `recaptchaToken` | string | No | Verification token when the site uses reCAPTCHA spam protection. For v3 checkout, mint it with the `checkout` action. | | `_hp` | string | No | Spam-trap field that must remain empty when the site uses honeypot protection. | | `_ts` | integer | No | Form-load Unix timestamp in milliseconds when the site uses honeypot protection. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | Spam protection failed: the `_ts` timestamp is too old, or the verification token is missing or invalid. | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed, or a customer account is required by this storefront | | `404` | Site, resource, or commerce feature not found | | `409` | The cart has already been completed | | `422` | Validation error | | `429` | Rate limit exceeded, or the `_ts` timestamp is missing, malformed or too recent. | | `503` | Hosted checkout initialization failed; the order is not paid, and a site that tracks stock cancels it | > **Notes:** Limit: 10 per 15 minutes per site and client. A server placing orders > for its buyers sends the server key and buyer IP to count each buyer. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const result = await lynkow.checkout.placeOrder(input) ``` --- --- # List a market's shipping options **Published**: 2026-11-30 **Category**: Commerce ## `GET /shipping-options` **List a market's shipping options** Lists the active shipping options of one market, lowest `position` first, not paginated. Without `market`, or for an unknown or draft market, the list is empty. Prices include VAT where it applies, for a delivery to `country`, else to the merchant's country. `requiresPickupPoint` is true when the buyer must choose a relay point, and `deliveryLabelKey` is a stable key to show your own translated delivery label. With `locale`, each label is served in the requested locale, else its base language, else the site's default locale. Errors: 404 when shipping or markets are not enabled on the site, 422 for a non-boolean `fallback`. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `market` | query | string | No | Identifier of the market to list (prefixed `mkt_`), as the markets read returns it. Without it the list is empty. | | `country` | query | string | No | Delivery country (ISO 3166-1 alpha-2) the prices include VAT for. An unusable value falls back to the merchant's country. | | `locale` | query | string | No | Language to serve the labels in. A locale with no translation is served through the locale chain, flagged by `isFallback`. | | `fallback` | query | boolean | No | With `false`, a multi-language site leaves out the options not translated in the requested `locale`. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | `fallback` is not a boolean. | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const { data: options } = await lynkow.shippingOptions.list({ market: 'mkt_01j9z3k4m5n6p7q8r9s0t1v2w3', country: 'BE', // prices at the VAT rate of the buyer's delivery country locale: 'fr', }) // Offer the options, then store the buyer's choice on the cart. const chosen = options[0] if (chosen) { const cart = await lynkow.cart.update({ shippingOptionId: chosen.id }) console.log(cart.shippingTotalCents, cart.totalCents) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/shipping-options?market=mkt_7wnrr7kd997qq6he3herwzvaj0&locale=fr" \ -H "X-Lynkow-Pk: lkw_pk_..." ``` ```javascript const params = new URLSearchParams({ market: marketId, locale: 'fr' }) const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/shipping-options?${params}`, { headers: { 'X-Lynkow-Pk': publishableKey }, }) const { data } = await res.json() // Send the chosen `id` as `shippingOptionId` on PATCH /cart ``` ### Response Example ```json { "data": [ { "id": "shp_01j9pd2k7m5r0wzatqv8n2x6f3", "label": "Livraison standard", "priceCents": 490, "priceNetCents": 409, "priceGrossCents": 490, "priceDisplayMode": "inclusive", "position": 0, "requiresPickupPoint": false, "deliveryLabelKey": "home_delivery", "locale": "fr", "requestedLocale": "fr", "isFallback": false }, { "id": "shp_01j9pd3b4c5d6e7f8g9h0jkmna", "label": "Pickup point delivery", "priceCents": 390, "priceNetCents": 325, "priceGrossCents": 390, "priceDisplayMode": "inclusive", "position": 1, "requiresPickupPoint": true, "deliveryLabelKey": "pickup_point_delivery", "locale": "en", "requestedLocale": "fr", "isFallback": true } ] } ``` --- --- # Render page markdown **Published**: 2026-11-30 **Category**: SEO & LLMs ## `GET /:path` **Render page markdown** Returns the Markdown of a published article, category index or page: append `.md` to its storefront URL. Pages accept a locale prefix (`/fr/about.md`). Returns 404 when the path does not end in `.md` or matches no published resource, and when llms.txt is disabled for the site. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `path` | path | string | Yes | Storefront URL path with a `.md` suffix. Any path that resolves to a published content or page can be appended with `.md` to receive the Markdown rendering. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | > **Notes:** Content type: `text/markdown; charset=utf-8`. Sets > `X-Robots-Tag: noindex, nofollow`. Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit bucket: general. ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/blog/launch-recap.md" ``` ### Response Example ``` # Launch recap Published on 2026-05-01 by the Lynkow team. ## Highlights - Storefront API now exposes 45 documented operations. - Markdown rendering available for every published content and page. - Locale-prefixed pages (e.g. `/fr/blog/...`) resolve transparently. ## Full body Lynkow shipped its public docs refresh this week... ``` --- --- # Render sitemap.xml **Published**: 2026-11-30 **Category**: SEO & LLMs ## `GET /sitemap.xml` **Render sitemap.xml** Returns the site's sitemap as XML. It lists the manual sitemap entries, then each type the SEO settings turn on: article categories, articles, pages, products, product categories and collections. Items marked noindex are left out. On a multi-language site, each URL carries its hreflang alternates and an `x-default`. When the URLs fit in one file (50,000 URLs and 50 MB) and no external sitemap source is enabled, the response is a ``. Otherwise it is a `` of `/sitemap-content.xml` or the `/sitemap-{n}.xml` parts, then the external sources. Serve those files on your domain. Changes appear within 5 minutes. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Content type: `application/xml`. Cache: > `Cache-Control: no-cache, no-store, must-revalidate`. The sitemap is > never edge-cached. Rate-limit bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // In a Next.js route handler (app/sitemap.xml/route.ts) export async function GET() { const xml = await lynkow.seo.sitemap() return new Response(xml, { headers: { 'Content-Type': 'application/xml' } }) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/sitemap.xml" ``` ### Response Example ``` https://docs.acme.io/ 2026-05-12 weekly 1.0 https://docs.acme.io/pricing 2026-05-10 monthly 0.8 ``` --- --- # List a bookable product's available slots **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:idOrSlug/availability` **List a bookable product's available slots** Returns every slot of a published bookable product's opening hours between `from` and `to`. Book only a slot whose `available` is true. With several resources, a slot is available while any has room. A span longer than 62 days, or than the product's advance booking limit, is shortened: `window.to` is the last day covered. `offeringId` applies that offering's duration and buffers. It is ignored when offering selection is not enabled on the site. Errors (422): `OFFERING_NOT_FOUND` for an unknown `offeringId`, `VALIDATION_FIELD_INVALID` when `to` is before `from`. 404 `PRODUCT_NOT_FOUND` for an unknown, unpublished or non-bookable product, or one without resources. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `idOrSlug` | path | string | Yes | Product identifier (prod_ prefixed id) or product slug. Only a product published on the site resolves | | `from` | query | string | Yes | Required. First day of the window (`YYYY-MM-DD`), included | | `to` | query | string | Yes | Required. Last day of the window (`YYYY-MM-DD`), included. A span too long is shortened: see `window.to` | | `partySize` | query | integer (1 to 50) | No | Number of guests, 1 to 50. It does not filter the slots: compare it with `seatsRemaining` | | `offeringId` | query | string | No | Reservation offering identifier (roff_ prefixed id). 1-200 characters | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean | No | Has no effect here: a missing translation never empties this response | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const { slots, timezone } = await lynkow.reservations.availability('sunset-dinner-cruise', { from: '2026-07-10', to: '2026-07-17', partySize: 2, }) ``` --- --- # List active markets **Published**: 2026-11-30 **Category**: Commerce ## `GET /markets` **List active markets** Lists the site's active markets, oldest first, not paginated, to build a country selector. Draft markets are left out. `meta.checkoutCountries` lists the delivery countries checkout accepts: the active markets' countries, else the EU member states when the site charges VAT, else `null` for any country. Errors: 404 when markets are not enabled on the site. > **Note:** Available only on sites with e-commerce enabled. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | > **Notes:** Every visitor reads the same response. Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const { data: markets } = await lynkow.markets.list() // The market a buyer's country belongs to, if any. const market = markets.find((m) => m.countries.includes('BE')) if (market) { console.log(market.name, market.currency, market.defaultLocale) } else { // The site does not deliver to that country. } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/markets" \ -H "X-Lynkow-Pk: lkw_pk_..." ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/markets`, { headers: { 'X-Lynkow-Pk': publishableKey }, }) const { data } = await res.json() // One country selector entry per code of every market const countries = data.flatMap((market) => market.countries) ``` ### Response Example ```json { "data": [ { "id": "mkt_7wnrr7kd997qq6he3herwzvaj0", "name": "France", "countries": [ "FR" ], "locales": [ "fr" ], "defaultLocale": "fr", "currency": "EUR" }, { "id": "mkt_01j9pc5a2b3c4d5e6f7g8h9jka", "name": "Germany and Austria", "countries": [ "AT", "DE" ], "locales": [ "de", "en" ], "defaultLocale": "de", "currency": "EUR" } ], "meta": { "checkoutCountries": [ "AT", "DE", "FR" ] } } ``` --- --- # List tags **Published**: 2026-11-30 **Category**: Content ## `GET /tags` **List tags** List published content tags for the site. Tags are a non-hierarchical taxonomy. Supports `locale` and `search` filters. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100, default 20) | No | Number of items per page | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "created_at" \| "updated_at" \| "name" \| "slug" (default "name") | No | One of: created_at, updated_at, name, slug | | `sortOrder` | query | "asc" \| "desc" (default "asc") | No | One of: asc, desc | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | | `slug` | query | string | No | URL-friendly identifier, unique per site and locale | | `slugs` | query | string[] | No | Keeps only the items whose slug is one of these | | `ids` | query | string[] | No | Keeps only the items with these UUIDs | | `excludeIds` | query | string[] | No | Leaves out the items with these UUIDs | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // Default: first 20 tags. const { data, meta } = await lynkow.tags.list() // Page through everything. for (let page = 1; page <= meta.lastPage; page++) { const { data } = await lynkow.tags.list({ page, limit: 50 }) data.forEach(t => console.log(t.name)) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/tags?locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/tags?locale=en`) const { data, meta } = await res.json() ``` ### Response Example ```json { "data": [ { "id": "3f2a8c1e-5b7d-4e9a-8c6f-1d2e3a4b5c6d", "name": "pricing", "slug": "pricing", "locale": "en", "translationGroupId": "7a1b2c3d-4e5f-4a6b-9c8d-0e1f2a3b4c5d", "requestedLocale": "en", "isFallback": false }, { "id": "9c4d6e8f-1a2b-4c3d-8e5f-6a7b8c9d0e1f", "name": "company", "slug": "company", "locale": "en", "translationGroupId": "b2c3d4e5-f6a7-4b8c-9d0e-1f2a3b4c5d6e", "requestedLocale": "en", "isFallback": false } ], "meta": { "total": 2, "perPage": 20, "currentPage": 1, "lastPage": 1, "firstPage": 1, "firstPageUrl": "/?page=1", "lastPageUrl": "/?page=1", "nextPageUrl": null, "previousPageUrl": null } } ``` --- --- # Get search client config **Published**: 2026-11-30 **Category**: Search ## `GET /search/config` **Get search client config** Returns the host, a short-lived read-only key and the index name a client needs to query Lynkow Search directly from the browser, instead of sending every keystroke through `/search`. Returns 503 `INTERNAL_SERVICE_UNAVAILABLE` when search or client-side search is not available for the site. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Never cached (`no-store`). Rate-limit bucket: general. Fetch again > when `apiKey` expires. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const { host, apiKey, indexName } = await lynkow.search.getConfig() // indexName: 'site_550e8400_e29b_41d4_a716_446655440000' ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/search/config" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/search/config`) const { data } = await res.json() // data.host + data.apiKey + data.indexName feed a Lynkow Search client. ``` ### Response Example ```json { "data": { "host": "https://search.lynkow.com", "apiKey": "lks_pk_short_lived_token_abcdef0123456789", "indexName": "site_c3bc8a0a_7820_4945_b174_5c9328b98719" } } ``` --- --- # Get the site configuration **Published**: 2026-11-30 **Category**: Pages & Site Blocks ## `GET /site-config` **Get the site configuration** Returns what a front end needs at boot to render its header, footer and navigation: a `site` subset of `GET /site`, the resolved `locale`, and every published global block keyed by slug under `globals`. `site.showBranding` is the effective badge visibility. With `locale`, a missing translation is served from the next locale of the site's chain. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the global blocks not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Sets `ETag` and `Cache-Control: public, max-age=0`, `s-maxage` 300 at > most. A block may carry `_warnings` after a partial data-source > failure. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const result = await lynkow.blocks.siteConfig() ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/site-config?locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/site-config?locale=en`) const { data } = await res.json() ``` ### Response Example ```json { "data": { "site": { "name": "Acme Documentation", "domain": "docs.acme.io", "logo": "https://cdn.lynkow.com/sites/acme/logo.svg", "favicon": "https://cdn.lynkow.com/sites/acme/favicon.ico", "showBranding": true, "defaultLocale": "en", "enabledLocales": [ "en", "fr", "de" ], "analytics": { "consentMode": "opt-in" } }, "locale": "en", "globals": { "main-nav": { "slug": "main-nav", "name": "Main navigation", "data": { "items": [ { "label": "Pricing", "href": "/pricing" } ] } }, "footer": { "slug": "footer", "name": "Footer", "data": { "copyright": "(c) 2026 Acme Inc.", "social": { "twitter": "@acme" } } } } } } ``` --- --- # Get a product category by slug **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-categories/:slug` **Get a product category by slug** Returns one visible product category by its slug, with `structuredData.graph`, the page's JSON-LD graph. Its `ItemList` holds the first 20 published products of the category and its visible subcategories, newest first, without those hidden in the served language or in `market`. A subcategory also gets a `BreadcrumbList`. With `locale`, the slug can also be the translated slug, and the category is served in the requested locale or its fallback chain: base language, site default locale, then its own language. Errors: 404 `PRODUCT_CATEGORY_NOT_FOUND` for an unknown or hidden category. The slug `tree` reaches the tree read instead. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | Product category slug, unique per site | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` returns 404 when the item is not translated into the requested locale. Single-language sites ignore it | | `market` | query | string | No | Market `mkt_` id: products hidden in that market are left out of `structuredData`. Unknown, draft or malformed values are ignored | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) import { renderJsonLdGraph } from 'lynkow' const category = await lynkow.productCategories.getBySlug('kitchen', { locale: 'fr' }) //
``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/product-categories/shirts" \ -H "X-Lynkow-Pk: lkw_pk_..." ``` ```javascript const res = await fetch( `https://api.lynkow.com/storefront/${siteId}/product-categories/shirts`, { headers: { 'X-Lynkow-Pk': publishableKey } } ) const { data } = await res.json() // data.structuredData.graph is ready for an application/ld+json script ``` ### Response Example ```json { "data": { "id": "pcat_01j9pb3kq8w2x7h4m5n6c7d8e8", "slug": "shirts", "path": "/product-categories/shirts", "name": "Shirts", "description": "Every shirt of the catalogue.", "image": "https://cdn.lynkow.com/sites/acme/categories/shirts.jpg", "imageAlt": "Folded shirts", "position": 0, "seoTitle": null, "seoDescription": null, "keywords": null, "canonicalUrl": null, "ogTitle": null, "ogDescription": null, "ogImage": null, "ogImageAlt": null, "twitterCard": null, "noIndex": false, "noFollow": false, "structuredData": { "graph": [ { "@context": "https://schema.org", "@id": "https://www.acme.io/product-categories/shirts#auto:collectionpage", "@type": "CollectionPage", "name": "Shirts", "inLanguage": "en", "description": "Every shirt of the catalogue.", "url": "https://www.acme.io/product-categories/shirts", "mainEntity": { "@type": "ItemList", "itemListElement": [ { "@type": "ListItem", "position": 1, "url": "https://www.acme.io/products/linen-shirt", "name": "Linen shirt" } ] } } ] } } } ``` --- --- # Get the product category tree **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-categories/tree` **Get the product category tree** Returns the visible product categories as a list of root categories, each nesting its `children`, siblings in `position` order. An inactive or internal category is left out with its whole branch. With `locale`, each category is served in the requested locale or its fallback chain: base language (`fr-CA` to `fr`), site default locale, then its own language. A locale the site does not enable counts as a missing translation. Errors: 404 `PRODUCT_CATEGORY_NOT_FOUND` when the site does not use product categories, 422 for a non-boolean `fallback`. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` drops each category not translated into the requested locale, with its branch. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const roots = await lynkow.productCategories.tree({ locale: 'fr' }) for (const root of roots) { console.log(root.name, root.path, root.children.map((child) => child.name)) } ``` --- --- # Request a storefront customer password reset **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/password-reset/request` **Request a storefront customer password reset** Sends a password reset link to a customer's email address. Send `email` and an optional `locale`. Returns 200 `{ ok: true }` whether or not the address has an account, and 422 for an invalid `email`. Only an account with a password receives the email, with a link valid for 60 minutes, unless the store changed that customer's email in the last 72 hours. A repeat request within five minutes sends no new one. The email uses the customer's stored preferred language when there is one, otherwise `locale`. Complete the reset with `POST /customers/password-reset/confirm`. > **Note:** Available only on sites with e-commerce enabled. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | Yes | Required. Valid email address | | `locale` | string | No | Language of the reset email when the customer has no stored preferred language, never rejected; the site default when omitted. Unsupported email languages fall back to the base language (`pt-BR` to `pt`), then English. | | `recaptchaToken` | string | No | Verification token, required when the site uses CAPTCHA. A v3 token needs this operation's action. | | `_hp` | string | No | Spam-trap field that must remain empty when the site uses honeypot protection. | | `_ts` | integer | No | Form-load Unix timestamp in milliseconds when the site uses honeypot protection. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | Spam protection failed: the `_ts` timestamp is too old, or the verification token is missing or invalid. | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | | `429` | Rate limit exceeded, or the `_ts` timestamp is missing, malformed or too recent. | > **Notes:** A v3 token uses the action `password_reset_request`. With honeypot > protection, `_ts` is required even when the `_hp` check is off. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) await lynkow.customers.passwordReset.request({ email: 'alice@example.com' }) // Same message on every outcome: never branch on whether the email is known. show('If this address has an account, a reset link is on its way.') ``` --- --- # Search pickup points **Published**: 2026-11-30 **Category**: Commerce ## `GET /pickup-points` **Search pickup points** Lists the pickup points of the carrier behind a shipping option, nearest first, not paginated. Send the `shippingOptionId` of an option the buyer can pick, a `countryCode`, and either a `postalCode` or a `latitude` with a `longitude`. Send the chosen point's `id` as `pickupPointId` on the cart. Errors: 422 `SHIPPING_OPTION_INVALID` for an unknown or inactive option, 422 `SHIPPING_OPTION_NO_PICKUP_POINTS` for an option that does not deliver to a pickup point, 503 `PICKUP_POINT_SEARCH_UNAVAILABLE` when the carrier cannot answer (the buyer can pick another option), 404 when shipping is not enabled on the site, and 422 for an invalid query. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `shippingOptionId` | query | string | Yes | Shipping option to search for (prefixed `shp_`), as the shipping options read returns it. | | `countryCode` | query | string | Yes | Country to search in (ISO 3166-1 alpha-2). | | `postalCode` | query | string | No | Postal code to search near. Send it, or `latitude` with `longitude`. | | `latitude` | query | number (-90 to 90) | No | Latitude to search near, sent with `longitude`. | | `longitude` | query | number (-180 to 180) | No | Longitude to search near, sent with `latitude`. | | `limit` | query | integer (1 to 30, default 10) | No | Maximum number of points to return. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | `SHIPPING_OPTION_INVALID` or `SHIPPING_OPTION_NO_PICKUP_POINTS` on `shippingOptionId`, or an invalid query. | | `503` | `PICKUP_POINT_SEARCH_UNAVAILABLE`: the carrier cannot answer right now. The buyer can pick another option. | > **Notes:** Every buyer asking the same search reads the same response. Cache: > `Cache-Control: public, max-age=0, s-maxage=60`. Rate-limit bucket: > pickup points (60 requests per minute), plus general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const { data: points } = await lynkow.pickupPoints.search({ shippingOptionId: option.id, countryCode: 'FR', latitude: 48.8566, longitude: 2.3522, limit: 5, }) // Show the points, then store the buyer's choice on the cart. const chosen = points[0] if (chosen) { await lynkow.cart.update({ pickupPointId: chosen.id }) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/pickup-points?shippingOptionId=shp_7yd2r7kv9n78n71fbmf0ptkwgg&countryCode=FR&postalCode=75010" \ -H "X-Lynkow-Pk: lkw_pk_..." ``` ```javascript const params = new URLSearchParams({ shippingOptionId, countryCode: 'FR', postalCode: '75010', }) const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/pickup-points?${params}`, { headers: { 'X-Lynkow-Pk': publishableKey }, }) const { data } = await res.json() // Send the chosen point's `id` as `pickupPointId` on the cart ``` ### Response Example ```json { "data": [ { "id": "40125", "carrier": "example_carrier", "name": "Papeterie du Canal", "address": { "address1": "12 Rue de l'Exemple", "address2": null, "postalCode": "75010", "city": "Paris", "countryCode": "FR" }, "latitude": 48.8752, "longitude": 2.3601, "distanceMeters": 240, "openingHours": [ { "day": 1, "opens": "09:00", "closes": "12:30" }, { "day": 1, "opens": "14:00", "closes": "19:00" }, { "day": 6, "opens": "10:00", "closes": "13:00" } ] } ] } ``` --- --- # List published products **Published**: 2026-11-30 **Category**: Commerce ## `GET /products` **List published products** Lists the site's published products, paginated. Filter with `search` (title, slug), `kind`, `market`, `collection` or `category`, the last two by wire id or slug. A category includes its visible subcategories. With `locale`, each product is served in the requested locale or its fallback chain: base language, site default locale, then its own language. A product hidden in a language is left out of reads in that language (the default locale without `locale`). Prices include VAT where it applies, for a delivery to `country`, else to the merchant's country, which bookable products always use. Errors: 404 `PRODUCT_COLLECTION_NOT_FOUND`, `PRODUCT_CATEGORY_NOT_FOUND`. > **Note:** Available only on sites with e-commerce enabled. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100, default 20) | No | Number of items per page | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name. Max 200 characters | | `kind` | query | "standard" \| "bookable" | No | Product kind: standard or bookable. One of: standard, bookable | | `collection` | query | string | No | 1-200 characters | | `category` | query | string | No | 1-200 characters | | `sortBy` | query | "title" \| "price_cents" \| "created_at" (default "created_at") | No | One of: title, price_cents, created_at | | `sortOrder` | query | "asc" \| "desc" (default "desc") | No | One of: asc, desc | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | | `market` | query | string | No | Market `mkt_` id: products hidden in that market are left out. An unknown, draft or malformed value is ignored | | `country` | query | string | No | Delivery country (ISO 3166-1 alpha-2) the prices include VAT for. An unusable value falls back to the merchant's country | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Site, resource, or commerce feature not found | | `422` | Validation error | ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID!, publishableKey: process.env.LYNKOW_PK, }) const { data, meta } = await lynkow.products.list( { category: 'kitchen', limit: 12 }, { locale: 'de', country: 'DE' } ) ``` --- --- # Get the Lynkow branding badge **Published**: 2026-11-30 **Category**: Content ## `GET /branding/badge` **Get the Lynkow branding badge** Returns the "Made with Lynkow" badge as JSON: `html`, an anchor tag with the SVG logo embedded, and `css`, the matching scoped stylesheet. Insert both into the host page. The response is JSON, not SVG. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Cache: `Cache-Control: public, max-age=86400`. Rate-limit bucket: > general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) await lynkow.branding.inject() ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/branding/badge" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/branding/badge`) const { data } = await res.json() document.getElementById('lynkow-badge-slot').outerHTML = data.html const style = document.createElement('style'); style.textContent = data.css; document.head.appendChild(style) ``` ### Response Example ```json { "data": { "html": "...", "css": "#lynkow-badge{position:fixed;bottom:16px;right:16px;...}" } } ``` --- --- # Search with a named profile **Published**: 2026-11-30 **Category**: Search ## `GET /search/:profileSlug` **Search with a named profile** Searches the site with a named search profile. The payload is that of `/search`, with ranking, fields and facets scoped to `:profileSlug`. Use `/search/profiles` to list the public profiles. Every hit field, `id` and `path` included, can be absent. With `market` (a `mkt_` id), the products hidden in that market are left out. `locale` and `fallback` work as on `/search`, and `fallback` defaults to `true`. A `fallback` that is not a boolean returns 422. Returns 403 `AUTHZ_PERMISSION_DENIED` for a profile that is not public, 404 `RESOURCE_NOT_FOUND` for an unknown slug, and 503 `INTERNAL_SERVICE_UNAVAILABLE` when search is not available. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `profileSlug` | path | string | Yes | Slug of the named search profile | | `q` | query | string | No | Full-text search query string. Min 1 character | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | | `market` | query | string | No | Market `mkt_` id: products hidden in that market are left out. An unknown, draft or malformed value is ignored | | `category` | query | string | No | Keeps only the contents in the category with this slug | | `tag` | query | string | No | Keeps only the contents carrying the tag with this slug | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (min 1) | No | Hits per page. Defaults to the search profile's `defaultLimit`. A value above its `maxLimit` is lowered to it, and a non-numeric one uses the default | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | | `422` | Validation error | > **Notes:** Never cached (`no-store`). Rate-limit bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const results = await lynkow.search.searchByProfile('api-docs', 'pagination', { limit: 10, }) ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/search/docs?q=consent" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/search/docs?q=consent`) const { data, meta } = await res.json() ``` ### Response Example ```json { "data": [ { "id": "01J9YPWQ3KTNB4F8C7H6D2R5XA", "title": "Cookie consent", "slug": "cookie-consent", "excerpt": "How to wire the cookie-consent widget in your app.", "locale": "en", "type": "content", "_formatted": { "title": "Cookie consent" } } ], "meta": { "total": 1, "page": 1, "totalPages": 1, "perPage": 20, "query": "consent", "processingTimeMs": 4, "profile": "docs", "facetDistribution": { "type": { "content": 1 } } } } ``` --- --- # List search profiles **Published**: 2026-11-30 **Category**: Search ## `GET /search/profiles` **List search profiles** Lists the site's public search profiles. Each profile describes a curated search: a subset of content types, ranking rules and fields. Use `slug` to search with a profile via `/search/{profileSlug}`. Returns 503 `INTERNAL_SERVICE_UNAVAILABLE` when search is not available for the site. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Never cached (`no-store`). Rate-limit bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const profiles = await lynkow.search.listProfiles() for (const profile of profiles) { console.log(profile.slug, profile.name) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/search/profiles" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/search/profiles`) const { data } = await res.json() ``` ### Response Example ```json { "data": [ { "slug": "default", "name": "Default", "description": "Site-wide search", "fields": [ "title", "excerpt", "body" ] }, { "slug": "docs", "name": "Docs", "description": "Documentation only", "fields": [ "title", "body", "headings" ] } ] } ``` --- --- # Search with the default profile **Published**: 2026-11-30 **Category**: Search ## `GET /search` **Search with the default profile** Searches the site's content with the default profile. Send the query in `q`, and narrow it with `category` or `tag`. Every hit field can be absent, `id` and `path` included: the site's indexed fields and the profile decide the shape. With `market` (a `mkt_` id), the products hidden in that market are left out. With `locale`, each hit is the best translation the locale chain finds. `fallback` defaults to `true` here, and `fallback=false` keeps only the hits written in the requested locale. A `fallback` that is not a boolean returns 422. Returns 503 `INTERNAL_SERVICE_UNAVAILABLE` when search is not available for the site. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `q` | query | string | No | Full-text search query string. Min 1 character | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | | `market` | query | string | No | Market `mkt_` id: products hidden in that market are left out. An unknown, draft or malformed value is ignored | | `category` | query | string | No | Keeps only the contents in the category with this slug | | `tag` | query | string | No | Keeps only the contents carrying the tag with this slug | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (min 1) | No | Hits per page. Defaults to the search profile's `defaultLimit`. A value above its `maxLimit` is lowered to it, and a non-numeric one uses the default | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Never cached (`no-store`). Rate-limit bucket: general. An empty `q` > returns an empty `data` array and `meta.total` 0. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const { data, meta } = await lynkow.search.search('formulaire', { locale: 'fr', category: 'guides', limit: 5, }) for (const hit of data) { console.log(hit._formatted?.title ?? hit.title, hit.path, hit.isFallback) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/search?q=pricing&locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/search?q=pricing&locale=en`) const { data, meta } = await res.json() ``` ### Response Example ```json { "data": [ { "id": "01J9R4QV6ZK7T0W1FH3DXB6P2Y", "title": "Pricing", "slug": "pricing", "excerpt": "Simple pricing. Start free, scale when you grow.", "locale": "en", "requestedLocale": "en", "isFallback": false, "type": "page", "_formatted": { "title": "Pricing" } }, { "id": "01J9P1B5N4XZRWQEKM2H6A3T8C", "title": "How we set our pricing", "slug": "how-we-set-our-pricing", "excerpt": "A behind-the-scenes look at the pricing model.", "locale": "en", "requestedLocale": "en", "isFallback": false, "type": "content", "_formatted": { "title": "How we set our pricing" } } ], "meta": { "total": 2, "page": 1, "totalPages": 1, "perPage": 20, "query": "pricing", "processingTimeMs": 6, "profile": "default", "facetDistribution": { "type": { "page": 1, "content": 1 } } } } ``` --- --- # Analytics visitor id (never disclosed) **Published**: 2026-11-30 **Category**: Analytics & Tracking ## `GET /analytics/visitor-id` **Analytics visitor id (never disclosed)** Returns a constant payload: `cookie_visitor_id` is always `null` and `source` is always the label `"fingerprint"`. The value of the tracking cookie is never disclosed here. Tracking is unaffected: the collector `POST /storefront/{siteId}/analytics/events` reads the cookie from the request itself, so nothing client-side needs its value. The route is kept so tracker builds already deployed on merchant sites keep working. Field names are snake_case. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Never cached (`no-store`). Rate-limit bucket: analytics, 600 requests > per minute per site and client. ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/analytics/visitor-id" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/analytics/visitor-id`, { credentials: 'include' }) const { data } = await res.json() // data.cookie_visitor_id is always null; data.source is always "fingerprint" ``` ### Response Example ```json { "data": { "cookie_visitor_id": null, "source": "fingerprint" } } ``` --- --- # Serve the tracking pixel **Published**: 2026-11-30 **Category**: Analytics & Tracking ## `GET /analytics/pixel` **Serve the tracking pixel** Returns a 42-byte transparent 1x1 GIF. The Lynkow tracker loads it once the visitor accepts analytics cookies. With `consent=1` and no visitor cookie yet, the response sets the HttpOnly visitor cookie for 400 days, partitioned to the site that loads the pixel, and links it to the `fp` fingerprint. Otherwise no visitor cookie is set, and invalid query parameters still get the GIF. Any response expires an older visitor cookie the browser still sends. Records no page view: send events to `POST /analytics/events`. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `consent` | query | "0" \| "1" | No | One of: 0, 1 | | `fp` | query | string | No | 8-64 characters | | `t` | query | string | No | Cache-buster timestamp | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Content type: `image/gif`. Sets `Cache-Control: private, max-age=60` > and `X-Visitor-Source`. Rate-limit bucket: pixel, 120 requests per > minute per site and client. ### Examples ```html ``` ### Response Example ``` (binary: 42-byte transparent GIF, application/octet-stream representation suppressed) ``` --- --- # Collect an analytics event **Published**: 2026-11-30 **Category**: Analytics & Tracking ## `POST /analytics/events` **Collect an analytics event** Records one analytics event. Always returns 204 with an empty body, also when the event is dropped: an invalid body, an excluded IP or path, tracking turned off, or a localhost origin. Send `application/json` with `session_id` (a UUID per visit), `visitor_id` (stable per browser, 8 to 64 characters), `event_type`, `page_path` and `event_time` (ISO 8601). Every other field is optional. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `session_id` | string | Yes | Required. Analytics session UUID. UUID format | | `visitor_id` | string | Yes | Required. 8-64 characters | | `cookie_visitor_id` | string \| null | No | Ignored. Accepted so older trackers keep working: the collector reads the cookie from the request | | `visitor_id_source` | "cookie" \| "fingerprint" \| "hybrid" | No | One of: cookie, fingerprint, hybrid | | `event_type` | "pageview" \| "scroll" \| "time_on_page" \| "cwv" \| "exit" \| "heartbeat" \| "click" \| "outbound_link" \| "file_download" \| "email_click" \| "phone_click" \| "rage_click" \| "dead_click" \| "copy" \| "form_start" \| "form_submit" \| "form_abandon" \| "form_field" \| "form_error" \| "heatmap_click" | Yes | Required. Kind of event, such as `pageview`, `heartbeat` or `click` | | `page_url` | string | No | Max 2048 characters | | `page_path` | string | Yes | Required. Max 1024 characters | | `event_time` | string | Yes | Required. Event time (ISO 8601). A time far from the server clock is replaced by the receive time | | `page_title` | string | No | Max 500 characters | | `page_referrer` | string \| null | No | URL of the referring page | | `scroll_depth` | number (0 to 100) \| null | No | Scroll depth as a percentage (0-100) | | `time_on_page` | number (0 to 3600000) \| null | No | Time on page in milliseconds (max 3600000) | | `engaged_time` | number (0 to 3600000) \| null | No | Active engagement time in milliseconds (max 3600000) | | `lcp` | number (0 to 60000) \| null | No | Largest Contentful Paint in milliseconds (Core Web Vital) | | `fid` | number (0 to 10000) \| null | No | First Input Delay in milliseconds (Core Web Vital) | | `cls` | number (0 to 10) \| null | No | Cumulative Layout Shift score (unitless, Core Web Vital) | | `ttfb` | number (0 to 30000) \| null | No | Time To First Byte in milliseconds | | `inp` | number (0 to 10000) \| null | No | Interaction to Next Paint in milliseconds (Core Web Vital) | | `utm_source` | string \| null | No | UTM source campaign parameter | | `utm_medium` | string \| null | No | UTM medium campaign parameter | | `utm_campaign` | string \| null | No | UTM campaign name parameter | | `utm_term` | string \| null | No | UTM term campaign parameter | | `utm_content` | string \| null | No | UTM content campaign parameter | | `traffic_source` | "direct" \| "organic" \| "social" \| "paid" \| "referral" \| "email" \| "internal" \| "ai" \| null | No | Traffic source channel: direct, organic, social, paid, referral, email, internal, ai | | `device_type` | "desktop" \| "laptop" \| "mobile" \| "tablet" \| null | No | Device category: desktop, laptop, mobile, tablet | | `browser` | string \| null | No | Browser name | | `browser_version` | string \| null | No | Browser version string | | `os` | string \| null | No | Operating system name | | `os_version` | string \| null | No | Operating system version string | | `screen_width` | number (0 to 10000) \| null | No | Screen width in pixels | | `screen_height` | number (0 to 10000) \| null | No | Screen height in pixels | | `language` | string \| null | No | Browser language code | | `content_locale` | string \| null | No | Language of the page being read. A language the site does not offer is stored as `null` | | `timezone` | string \| null | No | Timezone name (IANA, e.g. Europe/Paris) | | `referrer_domain` | string \| null | No | Domain of the referrer | | `is_entry` | boolean | No | Send `true` on the first `pageview` of a visit: it opens the session, and later events only update an open one | | `is_exit` | boolean | No | `true` on the event that ends the visit; the page report counts it as an exit from `page_path` | | `max_scroll_depth` | number (0 to 100) \| null | No | Maximum scroll depth reached as a percentage (0-100) | | `click_x` | number (0 to 32767) \| null | No | Horizontal click coordinate in pixels | | `click_y` | number (0 to 32767) \| null | No | Vertical click coordinate in pixels | | `click_element` | string \| null | No | Descriptor of the clicked element | | `click_element_tag` | string \| null | No | Tag name of the clicked element | | `click_element_id` | string \| null | No | ID attribute of the clicked element | | `click_element_class` | string \| null | No | Class attribute of the clicked element | | `click_element_text` | string \| null | No | Text content of the clicked element | | `click_target_url` | string \| null | No | Target URL of the clicked link | | `click_count` | number (min 1) \| null | No | Number of clicks recorded for the event | | `viewport_width` | number (0 to 10000) \| null | No | Viewport width in pixels | | `viewport_height` | number (0 to 10000) \| null | No | Viewport height in pixels | | `file_name` | string \| null | No | Name of the downloaded file | | `file_extension` | string \| null | No | Extension of the downloaded file | | `file_url` | string \| null | No | URL of the downloaded file | | `copied_text` | string \| null | No | Text copied by the visitor (copy event) | | `scroll_behavior` | "reading" \| "skimming" \| "jumping" \| null | No | Scroll behavior pattern: reading, skimming, jumping | | `form_id` | string \| null | No | Identifier of the form involved in the event | | `form_name` | string \| null | No | Name of the form involved in the event | | `field_name` | string \| null | No | Name of the form field involved in the event | | `field_type` | string \| null | No | Type of the form field involved in the event | | `field_time` | number (min 0) \| null | No | Time spent on the form field in milliseconds | | `error_message` | string \| null | No | Form validation or submission error message | | `form_completion_rate` | number (0 to 100) \| null | No | Form completion rate as a percentage (0-100) | ### Responses | Status | Description | | --- | --- | | `204` | No content | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Always 204 with an empty body. Rate-limit bucket: analytics, 600 > requests per minute per site and client. ### Examples ```curl curl -X POST "https://api.lynkow.com/storefront/{siteId}/analytics/events" \ -H "Content-Type: application/json" \ -d '{ "session_id": "3f2b8c1e-7a4d-4e9b-9c2a-5d6e7f8a9b0c", "visitor_id": "9b1f4c7e2a6d8350", "event_type": "pageview", "page_path": "/pricing", "event_time": "2026-05-12T14:32:18.000Z" }' ``` ```javascript fetch(`https://api.lynkow.com/storefront/${siteId}/analytics/events`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, credentials: 'include', keepalive: true, body: JSON.stringify({ session_id: sessionId, visitor_id: visitorId, event_type: 'pageview', page_path: location.pathname, event_time: new Date().toISOString(), }), }) ``` --- --- # Match a path against redirects **Published**: 2026-11-30 **Category**: SEO & LLMs ## `GET /redirects/match` **Match a path against redirects** Returns the redirect that matches `path`. The site's stored rules are tried first and always win. When no stored rule matches, a locale redirect is computed. A leading default-locale segment is dropped (`/en/pricing` to `/pricing` on an English-default site). A source-slug URL goes to its translated URL in that locale. A URL under a locale the site does not enable goes to the same item in the default locale. A computed redirect is a 301 with `preserveQueryString: true`: append the visitor's query string to the target. Returns 404 `REDIRECT_NOT_FOUND` when nothing matches, and 400 when `path` is missing. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `path` | query | string | Yes | Source URL path to resolve against the site's active redirect rules. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | The required `path` query parameter is missing, empty, or not a string. | | `404` | No safe active stored redirect matches the supplied path, and no locale redirect is synthesized for it. | > **Notes:** Cache: a match is `public, max-age=0, s-maxage=300`, a miss > `s-maxage=30`. A blank or oversized path returns an uncached 404. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // In a Next.js middleware const redirect = await lynkow.paths.matchRedirect(pathname) if (redirect) { return NextResponse.redirect(redirect.target, redirect.statusCode) } // No redirect, continue to normal page rendering ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/redirects/match?path=/old-pricing" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/redirects/match?path=/old-pricing`) if (res.status === 404) return null const { data } = await res.json() ``` ### Response Example ```json { "data": { "source": "/old-pricing", "target": "https://acme.io/pricing", "statusCode": 301, "preserveQueryString": true } } ``` --- --- # Render llms-full.txt **Published**: 2026-11-30 **Category**: SEO & LLMs ## `GET /:locale/llms-full.txt` **Render llms-full.txt** Locale-scoped variant of `/llms-full.txt`. On a multi-language site, it returns the full Markdown of the articles and pages available in `:locale`, and a commerce block of the products, product categories and collections written in that locale, with names, descriptions and URLs in that locale. A product hidden there and entries marked noindex are left out. Returns 404 when llms.txt is disabled for the site, or when `:locale` is not an enabled locale. A single-language site serves its only file for any `:locale`, with `Content-Language` set to its default locale and `Cache-Control: no-store`. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | > **Notes:** Content type: `text/markdown; charset=utf-8`. Cache: > `Cache-Control: public, max-age=0, s-maxage=3600`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // In a Next.js route handler (app/llms-full.txt/route.ts) export async function GET() { const md = await lynkow.seo.llmsFullTxt() return new Response(md, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } }) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/fr/llms-full.txt" ``` ### Response Example ``` # Documentation Acme ## /fr/tarifs Titre: Tarifs Tarifs simples. Commencez gratuitement. ... ``` --- --- # Render llms.txt **Published**: 2026-11-30 **Category**: SEO & LLMs ## `GET /:locale/llms.txt` **Render llms.txt** Locale-scoped variant of `/llms.txt`. On a multi-language site, `:locale` selects the file: it lists the entries written in that locale (their own language or a translation), with their names and URLs in that locale, and leaves out a product hidden there. Entries marked noindex are left out. Returns 404 when llms.txt is disabled for the site, or when `:locale` is not an enabled locale. A single-language site serves its only file for any `:locale`, with `Content-Language` set to its default locale and `Cache-Control: no-store`. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | > **Notes:** Content type: `text/markdown; charset=utf-8`. Cache: > `Cache-Control: public, max-age=0, s-maxage=3600`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // In a Next.js route handler (app/llms.txt/route.ts) export async function GET() { const md = await lynkow.seo.llmsTxt() return new Response(md, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } }) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/fr/llms.txt" ``` ### Response Example ``` # Acme > Linen clothing, cut and sewn in Portugal. ## Sitemap - [Sitemap XML](https://www.acme.io/sitemap.xml) ## Blog - [Comment nous choisissons notre lin](https://www.acme.io/fr/blog/comment-nous-choisissons-notre-lin.md): D'ou vient notre tissu. ## Products - [Chemise en lin](https://www.acme.io/fr/products/chemise-en-lin) ## Pages - [Tarifs](https://www.acme.io/fr/tarifs.md): Tarifs simples. Commencez gratuitement. ``` --- --- # Render llms-full.txt **Published**: 2026-11-30 **Category**: SEO & LLMs ## `GET /llms-full.txt` **Render llms-full.txt** Returns the site's `llms-full.txt`: the full Markdown of the published articles and pages in one text, separated by horizontal rules (`---`). `/llms.txt` is the index-only variant. On a site with a product catalog, a block between the articles and the pages lists the products, product categories and collections as in `/llms.txt`, each with its description when it has one and no price or stock. Items marked noindex are left out. On a multi-language site, `locale` selects the language, as `/{locale}/llms-full.txt` does. Returns 404 when llms.txt is disabled for the site. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Content type: `text/markdown; charset=utf-8`. Cache: > `Cache-Control: public, max-age=0, s-maxage=3600`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // In a Next.js route handler (app/llms-full.txt/route.ts) export async function GET() { const md = await lynkow.seo.llmsFullTxt() return new Response(md, { headers: { 'Content-Type': 'text/plain; charset=utf-8' } }) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/llms-full.txt" ``` ### Response Example ``` # Acme Documentation ## /pricing Title: Pricing Simple pricing. Start free, scale when you grow. ## Tiers ... --- ## /getting-started Title: Getting started Install the SDK and ship your first request. ... ``` --- --- # Render robots.txt **Published**: 2026-11-30 **Category**: SEO & LLMs ## `GET /robots.txt` **Render robots.txt** Returns the site's robots.txt as plain text. It holds the per-agent Allow and Disallow rules from the SEO settings, or a default block that disallows `/admin` and `/api`, then a `Sitemap:` line for `/sitemap.xml` unless the site turned it off. When `llms.txt` is enabled, Googlebot and Bingbot keep the `*` rules and are also blocked from `/llms.txt` and `/llms-full.txt`. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Content type: `text/plain`. Cache: > `Cache-Control: public, max-age=0, s-maxage=3600`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // In a Next.js route handler (app/robots.txt/route.ts) export async function GET() { const txt = await lynkow.seo.robots() return new Response(txt, { headers: { 'Content-Type': 'text/plain' } }) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/robots.txt" ``` ### Response Example ``` User-agent: * Disallow: /admin Disallow: /api Allow: / Sitemap: https://docs.acme.io/sitemap.xml ``` --- --- # Render one part of the sitemap **Published**: 2026-11-30 **Category**: SEO & LLMs ## `GET /:sitemapPart.xml` **Render one part of the sitemap** Returns one part of the site's own sitemap as a ``. Parts are named `sitemap-1.xml`, `sitemap-2.xml` and so on, each holding up to 50,000 URLs and 50 MB, in the order of `/sitemap-content.xml`. `/sitemap.xml` lists the parts only when there is more than one. External sitemap sources never appear in a part. Part 0, a number with a leading zero, or one past the last part returns 404. Changes appear within 5 minutes. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `sitemapPart` | path | string | Yes | File name of a sitemap part without `.xml`: `sitemap-` then the part number, from 1 (`sitemap-1`) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | > **Notes:** Content type: `application/xml`. Cache: > `Cache-Control: no-cache, no-store, must-revalidate`. A part is > never edge-cached. Rate-limit bucket: general. ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/sitemap-2.xml" ``` ### Response Example ``` https://docs.acme.io/blog/engineering/how-we-set-our-pricing 2026-05-05 monthly 0.6 ``` --- --- # Render the content sitemap **Published**: 2026-11-30 **Category**: SEO & LLMs ## `GET /sitemap-content.xml` **Render the content sitemap** Returns the site's own sitemap, without the external sitemap sources. `/sitemap.xml` points at it when an external source is enabled. Within one part (50,000 URLs and 50 MB) it is the `` that `/sitemap-1.xml` returns. Beyond that it is a `` of the parts. The URLs and hreflang alternates are those of `/sitemap.xml`. Changes appear within 5 minutes. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | > **Notes:** Content type: `application/xml`. Cache: > `Cache-Control: no-cache, no-store, must-revalidate`. The sitemap is > never edge-cached. Rate-limit bucket: general. ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/sitemap-content.xml" ``` ### Response Example ``` https://docs.acme.io/blog/engineering/how-we-set-our-pricing 2026-05-05 monthly 0.6 ``` --- --- # Get review-form settings **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /reviews/settings` **Get review-form settings** Returns the public part of the site's review settings, which a review form needs before it renders: whether submission is open, whether an email is required, and the custom fields. With `locale`, the custom field labels and option labels come in that language when the site translates them, else in the site's default labels. Field ids, types, `required` flags and option values never change. A missing translation is never a 404, so `fallback=false` has no effect. A `fallback` that is not a boolean returns 422. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean | No | Has no effect here: a missing translation never empties this response | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=60` (the same > short-lived tier as `/reviews`). Rate-limit bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const settings = await lynkow.reviews.settings() if (!settings.publicSubmissionEnabled) { // Submissions are disabled, hide the form return } for (const field of settings.customFieldsSchema) { renderInput(field.id, field.label, field.type, field.required) } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/reviews/settings" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/reviews/settings`) const { data } = await res.json() ``` ### Response Example ```json { "data": { "publicSubmissionEnabled": true, "requireEmail": false, "customFieldsSchema": [] } } ``` --- --- # Submit a public review **Published**: 2026-11-30 **Category**: Forms & Reviews ## `POST /reviews` **Submit a public review** Submits a review. It enters the moderation queue and appears in `GET /reviews` once approved; the response `status` tells you whether the site approved it at once. Read `GET /reviews/settings` first for the required email and the custom fields. `locale` files the review under a language (default: the site's); a multi-language site returns 400 for a locale it does not enable. An invalid `productId` returns 422. With honeypot on, send an empty `_hp` and `_ts`, the display time in Unix milliseconds. A v3 reCAPTCHA token needs action `review_submit`. Returns 403 `AUTHZ_PERMISSION_DENIED` when submissions are closed, and 400 `VALIDATION_FIELD_REQUIRED` when a required email is missing. ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `authorName` | string | Yes | Required. Display name of the author. 2-100 characters | | `authorEmail` | string | No | Author email address. Valid email address | | `authorPhotoUrl` | string | No | Author photo URL. Valid URL | | `authorCompany` | string | No | Author company name. Max 100 characters | | `authorPosition` | string | No | Author job title. Max 100 characters | | `authorCity` | string | No | Author city. Max 100 characters | | `rating` | integer (1 to 5) | Yes | Required | | `content` | string | Yes | Required. Text content. 10-5000 characters | | `title` | string | No | Display title. Max 200 characters | | `productName` | string | No | Associated product name. Max 200 characters | | `productSku` | string | No | Associated product SKU. Max 100 characters | | `productId` | string \| null | No | The `prod_` id or slug of a published product to link the review to. Any other value returns 422. | | `customFields` | object | No | Free-form values. Counting the object itself, at most 3 levels deep; up to 50 keys per object, 50 items per array, 200-character keys and 5000-character strings | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr") | | `recaptchaToken` | string | No | Verification token, required when the site uses CAPTCHA. A v3 token needs this operation's action. | | `_hp` | string | No | Spam-trap field that must remain empty when the site uses honeypot protection. | | `_ts` | integer | No | Form-load Unix timestamp in milliseconds when the site uses honeypot protection. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | Spam protection failed: the `_ts` timestamp is too old, or the verification token is missing or invalid. | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | | `429` | Rate limit exceeded, or the `_ts` timestamp is missing, malformed or too recent. | > **Notes:** Limit: 10 per 15 minutes per site and client. A bad `_ts` returns 429 > `RATE_SUBMISSION_TOO_FAST`, or 400 `RATE_SUBMISSION_EXPIRED` if expired. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const result = await lynkow.reviews.submit({ authorName: 'Alice', rating: 5, content: 'Excellent service!' }) if (result.status === 'pending') { // Show "your review is awaiting moderation" } else { // result.status === 'approved': it is already live } console.log(result.id) // UUID of the new review ``` ### Examples ```curl # Set FORM_DISPLAYED_AT_MS to the integer timestamp captured at form display. # Send after the user completes the form, within the site's timing window. curl -X POST "https://api.lynkow.com/storefront/{siteId}/reviews" \ -H "Content-Type: application/json" \ -d "{ \"authorName\": \"Anna Cooper\", \"rating\": 5, \"title\": \"Great\", \"content\": \"Worked perfectly.\", \"_hp\": \"\", \"_ts\": ${FORM_DISPLAYED_AT_MS:?Set the form display timestamp} }" ``` ```javascript const formDisplayedAt = Date.now() // Capture when displaying the form. // Call when the user submits, within the site's timing window. async function submitReview() { return fetch(`https://api.lynkow.com/storefront/${siteId}/reviews`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ authorName: 'Anna Cooper', rating: 5, title: 'Great', content: 'Worked perfectly.', _hp: '', _ts: formDisplayedAt, }), }) } ``` ### Response Example ```json { "data": { "message": "Thank you! Your review will be published after moderation.", "status": "pending", "id": "3f6c2a8e-5b1d-4e7a-9c0f-8d2b1a6e4c37" } } ``` --- --- # List approved reviews publicly **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /reviews` **List approved reviews publicly** Lists the site's approved reviews, newest first by default. Filter by rating, featured status, product, language and date. A `product` naming no published product returns 404 `PRODUCT_NOT_FOUND`. On a multi-language site, `locale` lists each review once, in the best translation the locale chain finds, and `fallback=false` keeps the requested locale only. With `product` and no `locale`, reviews come in every language. With neither, only the default locale's reviews are listed. A `fallback` that is not a boolean returns 422. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100, default 20) | No | Number of items per page | | `status` | query | "pending" \| "approved" \| "rejected" | No | One of: pending, approved, rejected | | `rating` | query | number (1 to 5) | No | Keeps only the reviews with exactly this rating | | `ratingMin` | query | number (1 to 5) | No | Keeps only the reviews rated at least this | | `ratingMax` | query | number (1 to 5) | No | Keeps only the reviews rated at most this | | `isFeatured` | query | boolean | No | `true` keeps only the featured reviews, `false` only the others | | `productName` | query | string | No | Associated product name | | `product` | query | string | No | Product `prod_` id or slug. A value naming no published product returns 404. | | `source` | query | "admin" \| "csv_import" \| "public_form" | No | One of: admin, csv_import, public_form | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "created_at" \| "rating" \| "author_name" \| "display_order" \| "review_date" (default "created_at") | No | One of: created_at, rating, author_name, display_order, review_date | | `sortOrder` | query | "asc" \| "desc" (default "desc") | No | One of: asc, desc | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | | `reviewDateFrom` | query | string | No | Filter by review date from (ISO 8601) | | `reviewDateTo` | query | string | No | Filter by review date until (ISO 8601) | | `slug` | query | string | No | URL-friendly identifier, unique per site and locale | | `slugs` | query | string[] | No | Keeps only the items whose slug is one of these | | `ids` | query | string[] | No | Keeps only the items with these UUIDs | | `excludeIds` | query | string[] | No | Leaves out the items with these UUIDs | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `translationGroupId` | query | string | No | Translation group UUID (links translations across locales). UUID format | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | | `language` | query | string | No | Keeps only the reviews served in this language (a locale code). Unlike `locale`, it hides the reviews in other languages. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=60`. > `meta.averageRating` and `meta.totalApproved` ignore every filter > except `locale`, `fallback` and `language`. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const { data, meta } = await lynkow.reviews.list({ minRating: 4, sort: 'rating', order: 'desc', limit: 10, }) console.log(meta.averageRating, data.length) ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/reviews?page=1&limit=10&ratingMin=4" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/reviews?page=1&limit=10&ratingMin=4`) const { data, meta } = await res.json() ``` ### Response Example ```json { "data": [ { "id": "01J9R5Z3KE7Q1XB4T6F8H2D9P0", "authorName": "Anna Cooper", "rating": 5, "title": "Outstanding support.", "content": "The team replied within an hour and the fix shipped the next day.", "productName": "Pro plan", "productId": "prod_01j9zq7m4k2x8v3n6p5r0t1w2w", "isFeatured": true, "reviewDate": "2026-04-22T00:00:00.000Z", "createdAt": "2026-04-22T11:14:30.000Z", "authorCity": "Lyon" } ], "meta": { "total": 84, "perPage": 10, "currentPage": 1, "lastPage": 9, "averageRating": 4.72, "totalApproved": 84 } } ``` --- --- # Get a form by slug **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /forms/:slug` **Get a form by slug** Returns an active form by slug, with its field schema and settings, so you can render it before posting to `POST /forms/{slug}/submissions`. An unknown or inactive slug returns 404. `recaptchaVersion` and `recaptchaSiteKey` describe this form's own verification. When site-wide verification is active, read them from `GET /spam-settings` instead. Without `locale`, a multi-language site serves its default language. With `locale`, the locale chain picks the translation, and `fallback=false` returns 404 when the requested language has none. Send the same `locale` and `fallback` when you submit. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | | `locale` | query | string | No | Language of the form. Without a translation, the locale chain serves another one (`isFallback` true) unless `fallback=false`. | | `fallback` | query | boolean (default true) | No | With `locale`, `false` returns 404 when the item is not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | | `422` | `fallback` is present and is not a boolean, with or without `locale`. `locale` itself never produces a 422. | > **Notes:** Cache: `Cache-Control: no-store`. Rate-limit bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const form = await lynkow.forms.getBySlug('contact') // Each field's `id` is the key you submit its value under. form.schema.fields.forEach(field => { console.log(field.id, field.type, field.label, field.required) }) ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/forms/contact" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/forms/contact`) const { data } = await res.json() ``` ### Response Example ```json { "data": { "id": "7c4b1f92-6d3a-4e58-9b21-0af5c8d37e64", "name": "Contact us", "slug": "contact", "description": "Reach the team about anything.", "schema": { "fields": [ { "id": "email", "type": "email", "label": "Email", "required": true, "placeholder": "you@example.com" }, { "id": "message", "type": "textarea", "label": "Message", "required": true, "validation": { "minLength": 10 } } ], "settings": { "submitLabel": "Send", "successMessage": "Thanks, we got your message and will reply within 24 hours." }, "conditions": [] }, "honeypotEnabled": true, "recaptchaEnabled": false, "recaptchaVersion": "v3", "recaptchaSiteKey": null, "status": "active", "locale": "en" } } ``` --- --- # List site variables **Published**: 2026-11-30 **Category**: Content ## `GET /variables` **List site variables** Returns the site's variables, one item per key, sorted by key. The list is not paginated. A `calendar` variable's `value` is its schedule as a JSON string. Without `locale`, each key is served in the site's default locale. With `locale`, a key with no value in that locale is served from the next locale of the site's chain, and the response sends `Content-Language`. A `fallback` that is not a boolean returns 422. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` keeps only the keys that have a value in the requested locale. Single-language sites ignore it. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Sets `ETag` and `Cache-Control: public, max-age=0, s-maxage=300`. > Rate-limit bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const { data: variables } = await lynkow.variables.list({ locale: 'fr' }) // A footer status indicator driven by a `status` variable. const status = variables.find((v) => v.key === 'status')?.value ?? 'ok' ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/variables?locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/variables?locale=en`) const { data } = await res.json() const phone = data.find((variable) => variable.key === 'phone')?.value ``` ### Response Example ```json { "data": [ { "key": "phone", "type": "text", "value": "+33 1 23 45 67 89", "locale": "en", "requestedLocale": "en", "isFallback": false }, { "key": "status", "type": "text", "value": "ok", "locale": "fr", "requestedLocale": "en", "isFallback": true } ] } ``` --- --- # Get a page by path **Published**: 2026-11-30 **Category**: Pages & Site Blocks ## `GET /page-by-path` **Get a page by path** Returns the published page at a public path, such as `/pricing` or `/fr/tarifs`, with the same shape and cache headers as `GET /pages/{slug}`. Without `locale`, a leading locale segment of `path` selects the locale. With `locale`, a missing translation is served from the next locale of the site's chain. When no page matches but a redirect covers the path, the response is a 200 with `type: redirect`, as `GET /redirects/match` answers. With `locale`, so is a fallback page whose translation has its own URL. Errors: 400 `VALIDATION_FIELD_REQUIRED` without `path`, 404 `PATH_NOT_FOUND`. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `path` | query | string | Yes | The page's public URL path, such as `/about` or `/fr/a-propos`. Only a non-default locale carries a prefix | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` returns 404 when the item is not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Same caching contract as `/pages/{slug}`. Rate-limit bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) import { isRedirectResponse } from 'lynkow' // Resolve a page from the current URL const page = await lynkow.pages.getByPath('/services/consulting') if (isRedirectResponse(page)) { // Send the visitor to page.redirect.target with page.redirect.statusCode } else { console.log(page.name) // "Consulting" } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/page-by-path?path=/pricing&locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/page-by-path?path=/pricing&locale=en`) const { data } = await res.json() ``` ### Response Example ```json { "data": { "id": "01J9R4QV6ZK7T0W1FH3DXB6P2Y", "slug": "pricing", "name": "Pricing", "path": "/pricing", "publicPath": "/pricing", "locale": "en", "requestedLocale": "en", "isFallback": false, "canonicalPath": "/pricing", "tags": [ "public", "conversion" ], "data": { "hero": { "title": "Simple pricing" } }, "seo": { "metaTitle": "Pricing | Acme" }, "alternates": [ { "locale": "en", "path": "/pricing", "current": true }, { "locale": "fr", "path": "/fr/tarifs", "current": false } ], "structuredData": { "graph": [] }, "updatedAt": "2026-05-10T09:14:22.000Z" } } ``` --- --- # Get a page by slug **Published**: 2026-11-30 **Category**: Pages & Site Blocks ## `GET /pages/:slug` **Get a page by slug** Returns one published Site Builder page by slug: its page tree, the resolved SEO bundle, the JSON-LD graph and its translations in `alternates`. Build links and the canonical URL from `publicPath`, which is always set; `path` is the stored value and can be null. Without `locale`, the page is read in the site's default locale. With `locale`, a missing translation is served from the next locale of the site's chain. Send `If-None-Match` with the `ETag` to get a 304. Errors: 404 `RESOURCE_NOT_FOUND` for an unknown slug. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` returns 404 when the item is not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | | `422` | Validation error | > **Notes:** Sets `ETag` and `Cache-Control: public, max-age=0, s-maxage=300`. > Send `If-None-Match: ` to get a 304 Not Modified. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const page = await lynkow.pages.getBySlug('about') console.log(page.data) // Resolved DataSource content console.log(page.seo) // SEO metadata console.log(page.alternates) // Other locale versions ``` ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const result = await lynkow.legal.getBySlug(slug) ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/pages/pricing?locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/pages/pricing?locale=en`) const { data } = await res.json() ``` ### Response Example ```json { "data": { "id": "01J9R4QV6ZK7T0W1FH3DXB6P2Y", "slug": "pricing", "name": "Pricing", "path": "/pricing", "publicPath": "/en/pricing", "locale": "en", "tags": [ "public", "conversion" ], "data": { "hero": { "title": "Simple pricing", "subtitle": "Start free, scale when you grow." }, "tiers": [ { "name": "Free", "price": 0, "features": [ "1 site", "1 GB media" ] }, { "name": "Pro", "price": 29, "features": [ "Unlimited sites", "100 GB media" ] } ] }, "seo": { "metaTitle": "Pricing | Acme", "metaDescription": "Transparent pricing for Acme.", "ogImage": "https://cdn.lynkow.com/sites/acme/og/pricing.png" }, "alternates": [ { "locale": "en", "path": "/en/pricing", "current": true }, { "locale": "fr", "path": "/fr/tarifs", "current": false } ], "structuredData": { "graph": [ { "@type": "WebPage", "name": "Pricing", "url": "https://docs.acme.io/pricing" } ] }, "updatedAt": "2026-05-10T09:14:22.000Z" } } ``` --- --- # Get the site payload **Published**: 2026-11-30 **Category**: Pages & Site Blocks ## `GET /site` **Get the site payload** Returns the site's public configuration: identity, locale settings, effective badge visibility and analytics consent mode. Call it once at app boot to set up locale handling and consent. With `locale`, `name`, `description` and `logoUrl` are served in the requested locale or its base language when the site enables and translates it, else from the site's default values, never a 404. The payload then carries `locale`, `requestedLocale` and `isFallback`, and the response sends `Content-Language`. A `fallback` that is not a boolean returns 422. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean | No | Has no effect here: a missing translation never empties this response | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Cache: `public, max-age=0` with an `s-maxage` of at most 300, and an > `ETag` (`If-None-Match` gets a 304). Rate-limit bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const config = await lynkow.site.getConfig() console.log(config.enabledLocales) // ['en', 'fr', 'de'] console.log(config.i18n.detection.enabled) // true console.log(config.analytics.consentMode) // 'opt-in' ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/site" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/site`) const { data } = await res.json() ``` ### Response Example ```json { "data": { "id": "c3bc8a0a-7820-4945-b174-5c9328b98719", "name": "Acme Documentation", "domain": "docs.acme.io", "description": "Public docs for the Acme platform.", "logoUrl": "https://cdn.lynkow.com/sites/acme/logo.svg", "faviconUrl": "https://cdn.lynkow.com/sites/acme/favicon.ico", "timezone": "Europe/Paris", "defaultLocale": "en", "enabledLocales": [ "en", "fr", "de" ], "i18n": { "enabled": true, "default": "en", "locales": [ { "code": "en", "name": "English", "flag": "🇬🇧", "direction": "ltr" }, { "code": "fr", "name": "Français", "flag": "🇫🇷", "direction": "ltr" }, { "code": "de", "name": "Deutsch", "flag": "🇩🇪", "direction": "ltr" } ], "switcher": true, "detection": { "enabled": true, "order": [ "cookie", "browser" ], "cookieName": "_lkw_lang", "cookieMaxAge": 365 } }, "showBranding": true, "analytics": { "consentMode": "opt-in" } } } ``` --- --- # Get a content by slug **Published**: 2026-11-30 **Category**: Content ## `GET /contents/slug/:slug` **Get a content by slug** Fetches a published content entry by slug, with its rendered body, SEO fields, custom data and structured data. Only published entries are served. With `locale`, the entry is served through the locale chain, so a missing translation is a 200 with the fallback row. A fallback item has empty `alternates`, and its `canonicalPath` is the URL of the default-locale version. On a multi-language site, `fallback=false` returns 404 `RESOURCE_NOT_FOUND` when no published row holds the slug in the requested locale. Without `locale`, a slug shared by several translations returns the default-locale one, else the oldest. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` returns 404 when the item is not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const content = await lynkow.contents.getBySlug('my-article') console.log(content.title) // Article title console.log(content.body) // HTML body string console.log(content.author?.fullName) // Author name console.log(content.categories) // Associated categories ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/contents/slug/how-we-set-our-pricing?locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/contents/slug/how-we-set-our-pricing?locale=en`) const { data } = await res.json() ``` ### Response Example ```json { "data": { "id": "9b2c1e7a-4f3d-4a1b-9c2e-8d7f6a5b4c3d", "type": "post", "title": "How we set our pricing", "slug": "how-we-set-our-pricing", "path": "/guides/how-we-set-our-pricing", "canonicalPath": "/guides/how-we-set-our-pricing", "locale": "en", "requestedLocale": "en", "isFallback": false, "excerpt": "A behind-the-scenes look at the pricing model.", "body": "

Our pricing model is built around three principles...

", "status": "published", "displayOrder": 0, "metaTitle": "How we set our pricing | Acme", "metaDescription": "The principles behind Acme pricing.", "keywords": "pricing, saas", "canonicalUrl": null, "featuredImage": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg", "featuredImageVariants": { "thumbnail": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=thumbnail", "card": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=card", "medium": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=medium", "content": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=content", "hero": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=hero", "og": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=og" }, "ogImage": "https://cdn.lynkow.com/sites/acme/og/pricing-blog.png", "ogImageVariants": { "og": "https://cdn.lynkow.com/sites/acme/og/pricing-blog.png?preset=og" }, "authorName": null, "authorUrl": null, "author": { "id": "3f1a7c9e-2b4d-4e6f-8a1b-0c2d3e4f5a6b", "fullName": "Ada Lovelace", "avatarUrl": null }, "categories": [ { "id": "01a2b3c4-d5e6-4f70-8a1b-2c3d4e5f6071", "name": "Guides", "slug": "guides", "parentId": null, "parent": null } ], "tags": [ { "id": "aa11bb22-cc33-4d44-9e55-6f7788990011", "name": "pricing", "slug": "pricing" } ], "alternates": [ { "locale": "en", "path": "/guides/how-we-set-our-pricing", "current": true }, { "locale": "fr", "path": "/fr/guides/comment-nous-fixons-nos-prix", "current": false } ], "customData": null, "meta": {}, "structuredData": {}, "jsonLdGraph": [], "faqSettings": null, "publishedAt": "2026-05-05T08:00:00.000Z", "createdAt": "2026-05-01T09:00:00.000Z", "updatedAt": "2026-05-05T08:00:00.000Z" } } ``` --- --- # List contents **Published**: 2026-11-30 **Category**: Content ## `GET /contents` **List contents** Lists the site's published content entries, paginated. Filter by locale, tag, category, slug or date range. With `groupByTranslation=true` on a multi-language site, each item carries its per-locale `translations`, published ones only. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100, default 20) | No | Number of items per page | | `search` | query | string | No | Text to find in the title or slug, case-insensitive | | `type` | query | string | No | Resource type | | `status` | query | "draft" \| "published" \| "archived" \| "scheduled" | No | One of: draft, published, archived, scheduled | | `contentMode` | query | "standard" \| "structured" | No | One of: standard, structured | | `sortBy` | query | "created_at" \| "updated_at" \| "published_at" \| "title" \| "slug" \| "display_order" (default "published_at") | No | One of: created_at, updated_at, published_at, title, slug, display_order | | `sortOrder` | query | "asc" \| "desc" (default "desc") | No | One of: asc, desc | | `categoryIds` | query | string[] | No | Keeps only the contents in at least one of these categories (UUIDs) | | `tagIds` | query | string[] | No | Keeps only the contents with at least one of these tags (UUIDs) | | `category` | query | string | No | Keeps only the contents in the category with this slug | | `tag` | query | string | No | Keeps only the contents carrying the tag with this slug | | `authorId` | query | string | No | Author user ID. UUID format | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | | `publishedFrom` | query | string | No | Filter by publish date from (ISO 8601) | | `publishedTo` | query | string | No | Filter by publish date until (ISO 8601) | | `slug` | query | string | No | URL-friendly identifier, unique per site and locale | | `slugs` | query | string[] | No | Keeps only the items whose slug is one of these | | `ids` | query | string[] | No | Keeps only the items with these UUIDs | | `excludeIds` | query | string[] | No | Leaves out the items with these UUIDs | | `hasCategory` | query | boolean | No | `true` keeps the contents in at least one category, `false` those in none | | `hasTag` | query | boolean | No | `true` keeps the contents with at least one tag, `false` those with none | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `translationGroupId` | query | string | No | Translation group UUID (links translations across locales). UUID format | | `groupByTranslation` | query | boolean | No | On a multi-language site, `true` adds each content its `translations`. Without `locale`, it also lists one content per translation group | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. > Rate-limit bucket: general (12000 requests per minute, counted per > site and per client). ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // Fetch the first page of articles in the "tech" category const { data, meta } = await lynkow.contents.list({ page: 1, limit: 10, category: 'tech' }) // Search for articles const results = await lynkow.contents.list({ search: 'typescript' }) ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/contents?page=1&limit=10&locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/contents?page=1&limit=10&locale=en`) const { data, meta } = await res.json() ``` ### Response Example ```json { "data": [ { "id": "9b2c1e7a-4f3d-4a1b-9c2e-8d7f6a5b4c3d", "type": "post", "title": "How we set our pricing", "slug": "how-we-set-our-pricing", "path": "/guides/how-we-set-our-pricing", "excerpt": "A behind-the-scenes look at the pricing model.", "status": "published", "locale": "en", "metaTitle": "How we set our pricing", "metaDescription": "A behind-the-scenes look at the pricing model.", "keywords": "pricing, saas", "canonicalUrl": null, "featuredImage": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg", "featuredImageVariants": { "thumbnail": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=thumbnail", "card": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=card", "medium": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=medium", "content": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=content", "hero": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=hero", "og": "https://cdn.lynkow.com/sites/acme/pricing-cover.jpg?preset=og" }, "ogImage": null, "publishedAt": "2026-05-05T08:00:00.000Z", "createdAt": "2026-05-01T09:00:00.000Z", "updatedAt": "2026-05-05T08:00:00.000Z", "author": { "id": "3f1a7c9e-2b4d-4e6f-8a1b-0c2d3e4f5a6b", "fullName": "Ada Lovelace" }, "categories": [ { "id": "01a2b3c4-d5e6-4f70-8a1b-2c3d4e5f6071", "name": "Guides", "slug": "guides" } ], "tags": [ { "id": "aa11bb22-cc33-4d44-9e55-6f7788990011", "name": "pricing", "slug": "pricing" } ] } ], "meta": { "total": 32, "perPage": 10, "currentPage": 1, "lastPage": 4 } } ``` --- --- # Resolve a URL path **Published**: 2026-11-30 **Category**: Content ## `GET /resolve` **Resolve a URL path** Resolves a URL path to a content entry, a category or a commerce page; `type` says which. A commerce page matches only at its exact public URL, and a product hidden in that locale misses. A commerce hit is a pointer (`id`, `slug`, `path`), or with `include=record` and a key in `X-Lynkow-Pk`, the record. With `locale`, a path missing in its locale is served from the next locale of the chain. When nothing resolves but a redirect covers the path, the response is a 200 with `type: redirect`. Errors: 400 `VALIDATION_FIELD_REQUIRED` without `path`, 401 `STOREFRONT_KEY_REQUIRED` for a record without a valid key, 404 `PATH_NOT_FOUND`. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1, default 1) | No | When `path` resolves to a category, the page of its contents, starting at 1 | | `limit` | query | number (1 to 500, default 500) | No | When `path` resolves to a category, the number of its contents per page | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` makes a page not translated into the locale of `path` a miss. Single-language sites ignore it | | `path` | query | string | Yes | The URL path to resolve, such as `/fr/guides/article`. Only a non-default locale carries a prefix. A leading slash is implied. | | `include` | query | string | No | Set to `record` to get a commerce page's full record and its `structuredData.graph`. Requires `X-Lynkow-Pk`. Other values are ignored. | | `market` | query | string | No | Market identifier (mkt_ prefixed id). A product hidden there misses and is left out of a record's structured data. Unusable values are ignored. | | `country` | query | string | No | Buyer's country (ISO 3166-1 alpha-2) for the VAT in a product record's prices. An unusable value falls back to the merchant's country. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** A 200 carries `public, max-age=0, s-maxage=300`, and a cached copy > is served to any caller of the URL. The 401 is `no-store`. ### SDK ```typescript import { renderJsonLdGraph } from 'lynkow' const lynkow = createClient({ siteId: '...', publishableKey: 'lkw_pk_...' }) const result = await lynkow.paths.resolve('/products/blue-mug') switch (result.type) { case 'content': console.log(result.content.title) break case 'category': console.log(result.category.name, result.contents.data.length) break case 'product': if ('structuredData' in result) { const jsonLd = renderJsonLdGraph(result.structuredData.graph) } break case 'redirect': console.log(result.redirect.target, result.redirect.statusCode) break } ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/resolve?path=/blog/engineering" curl -H "X-Lynkow-Pk: lkw_pk_..." "https://api.lynkow.com/storefront/{siteId}/resolve?path=/products/linen-shirt&include=record" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/resolve?path=/blog/engineering`) const { data } = await res.json() if (data.type === 'category') { /* category branch */ } else if (data.type === 'content') { /* content branch */ } else { /* product, product_category or product_collection pointer */ } // With the publishable key: the record and its JSON-LD graph in one call. const keyed = await fetch( `https://api.lynkow.com/storefront/${siteId}/resolve?path=/products/linen-shirt&include=record`, { headers: { 'X-Lynkow-Pk': publishableKey } } ) const { data: page } = await keyed.json() // page.product.title, page.product.availability, page.structuredData.graph ``` ### Response Example ```json { "data": { "type": "category", "locale": "en", "blogUrlMode": "nested", "category": { "id": "01J9PA0NZK7BX4HQ7M2DC9V5T8", "name": "Engineering", "slug": "engineering", "path": "/blog/engineering" }, "contents": { "data": [ { "id": "01J9P1B5N4XZRWQEKM2H6A3T8C", "title": "How we set our pricing", "slug": "how-we-set-our-pricing", "locale": "en" } ], "meta": { "total": 12, "perPage": 10, "currentPage": 1, "lastPage": 2 } } } } ``` --- --- # Get a blog category **Published**: 2026-11-30 **Category**: Content ## `GET /categories/:slug` **Get a blog category** Returns a category by slug with its published contents, paginated under `contents` (`limit` defaults to 500). Without `locale`, a multi-language site reads the slug in its default locale. Errors: 404 `RESOURCE_NOT_FOUND` for an unknown slug. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | | `page` | query | number (min 1, default 1) | No | Page of the category's contents, starting at 1 | | `limit` | query | number (1 to 500, default 500) | No | Number of the category's contents per page, 500 by default | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` returns 404 when the item is not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const { category, contents } = await lynkow.categories.getBySlug('tech', { page: 1, limit: 10 }) console.log(category.name) // "Tech" console.log(contents.data.length) // Number of articles on this page console.log(contents.meta.currentPage < contents.meta.lastPage) // Whether more pages exist ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/categories/engineering?page=1&limit=10&locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/categories/engineering?page=1&limit=10&locale=en`) const { data: { category, contents, locale } } = await res.json() ``` ### Response Example ```json { "data": { "category": { "id": "01J9PA0NZK7BX4HQ7M2DC9V5T8", "name": "Engineering", "slug": "engineering", "path": "/blog/engineering", "description": "Posts about the engineering team.", "image": "https://cdn.lynkow.com/sites/acme/cat/engineering.jpg", "contentMode": "standard", "displayOrder": 1, "locale": "en" }, "contents": { "data": [ { "id": "01J9P1B5N4XZRWQEKM2H6A3T8C", "title": "How we set our pricing", "slug": "how-we-set-our-pricing", "locale": "en", "publishedAt": "2026-05-05T08:00:00.000Z" } ], "meta": { "total": 12, "perPage": 10, "currentPage": 1, "lastPage": 2 } }, "locale": "en" } } ``` --- --- # List categories as a tree **Published**: 2026-11-30 **Category**: Content ## `GET /categories/tree` **List categories as a tree** Returns the site's categories as a tree under `tree`: each node nests its sub-categories in `children`. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const { tree } = await lynkow.categories.tree() // Iterate root categories and their children tree.forEach(root => { console.log(root.name) root.children.forEach(child => { console.log(` - ${child.name}`) }) }) ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/categories/tree?locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/categories/tree?locale=en`) const { data: { tree, blogUrlMode, locale } } = await res.json() ``` ### Response Example ```json { "data": { "tree": [ { "id": "01J9PA0NZK7BX4HQ7M2DC9V5T8", "name": "Engineering", "slug": "engineering", "path": "/blog/engineering", "locale": "en", "contentCount": 12, "children": [ { "id": "01J9PE2T4VHQR9K3M7B6X8N1FW", "name": "Performance", "slug": "performance", "path": "/blog/engineering/performance", "locale": "en", "contentCount": 4, "children": [] } ] } ], "blogUrlMode": "with-categories", "locale": "en" } } ``` --- --- # List paths for static generation **Published**: 2026-11-30 **Category**: Content ## `GET /paths` **List paths for static generation** Lists every renderable path of the site, for static-site generators and sitemaps: content entries and categories under the active `blogUrlMode`, plus published products, product categories and collections with `include=commerce`. Without `locale`, a multi-language site lists its default-locale paths only. With `locale`, the list holds one entry per translation group: its row in the requested locale, else its fallback URL. Every listed path resolves through `GET /resolve`. A product hidden in the read's locale is left out. Any `include` other than `commerce` returns 422. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the fallback URL of each entry not translated into the requested locale | | `include` | query | "commerce" | No | One of: commerce | | `market` | query | string | No | Market `mkt_` id: with `include=commerce`, the URLs of products hidden in that market are left out. Unknown or draft markets are ignored | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) // Next.js generateStaticParams() export async function generateStaticParams() { const { paths } = await lynkow.paths.list() return paths.map((p) => ({ slug: p.path.split('/').filter(Boolean) })) } // Article, category and commerce URLs, for a sitemap const { paths } = await lynkow.paths.list({ include: 'commerce' }) const productUrls = paths.filter((p) => p.type === 'product').map((p) => p.path) ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/paths?locale=en&include=commerce" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/paths?locale=en&include=commerce`) const { data: { paths, blogUrlMode, locale } } = await res.json() ``` ### Response Example ```json { "data": { "paths": [ { "type": "category", "path": "/blog/engineering", "locale": "en", "id": "01J9PA0NZK7BX4HQ7M2DC9V5T8", "updatedAt": "2026-05-02T10:00:00.000Z", "requestedLocale": "en", "isFallback": false }, { "type": "content", "path": "/blog/engineering/how-we-set-our-pricing", "locale": "en", "id": "9b2c1e7a-4f3d-4a1b-9c2e-8d7f6a5b4c3d", "updatedAt": "2026-05-05T08:00:00.000Z", "requestedLocale": "en", "isFallback": false }, { "type": "product", "path": "/products/linen-shirt", "locale": "en", "id": "prod_01j9zq7m4k2x8v3n6p5r0t1w2w", "updatedAt": "2026-05-08T14:30:00.000Z", "requestedLocale": "en", "isFallback": false } ], "blogUrlMode": "with-categories", "locale": "en" } } ``` --- --- # Render the calendar widget **Published**: 2026-11-30 **Category**: Content ## `GET /widgets/calendar/:variableKey` **Render the calendar widget** Returns a self-contained HTML page that renders the `calendar` variable named by `variableKey`. Embed it in an ` ``` ### Response Example ``` Calendar widget
...
``` --- --- # Site Access & Spam Protection **Published**: 2026-11-30 **Category**: Storefront API Every Storefront API request names your site by its ID in the URL. Commerce routes also require your publishable key, and customer account routes require a customer session token. ## Site identification The site ID is the first path segment after `/storefront`: ```http GET https://api.lynkow.com/storefront/{siteId}/contents ``` The admin shows your site ID under **Settings > Developers > Storefront**, and on the last screen of site creation, under **Add your environment variables**, as `NEXT_PUBLIC_LYNKOW_SITE_ID`. `GET /v1/site/info` returns it as `data.id`. A site ID that is not a UUID returns `400`, and an unknown one returns `404`. ## Publishable key Send your publishable key in the `X-Lynkow-Pk` header. It has the form `lkw_pk_` followed by 24 characters. It is not a secret, so it can ship in browser code. Commerce routes require it: products, product collections and categories, availability and bookings, payments, cart, checkout and customer accounts. Without it they return `401` `STOREFRONT_KEY_REQUIRED`, and an unknown or revoked key returns `401`. Every other route accepts the key and ignores an invalid one. The key is in the admin under **Settings > Developers > Storefront**. The admin shows the full key once, when it is created. If you no longer have it, regenerate it there: the previous key stops working at once. ## Server key A server that calls the Storefront API for its buyers, such as a server-rendered store, reaches it from one address, so all its buyers share the per-visitor rate limits. Send the buyer's IP in `X-Lynkow-Client-Ip` and the site's server key in `X-Lynkow-Server-Key` to count each buyer on their own. The server key has the form `lkw_srv_` followed by 24 characters. Create it under **Settings > Developers > Storefront**, where it is shown once. It is a secret: keep it on your server, never in browser code. It only vouches for the buyer IP and grants no other access. A secret API token also works in `X-Lynkow-Server-Key`. A missing, unknown or revoked key never fails the request: the IP is ignored. `X-Lynkow-Client-Ip` holds one IPv4 or IPv6 address, with no port. Read it from a header your proxy or CDN overwrites on every request, never from one the buyer can write. [Server Key and Buyer IP](/sdk/advanced/server-key-buyer-ip) lists the limits it affects and how to check it works. ## Customer session `POST /customers/login` and `POST /customers/activation/confirm` return a customer session token in `data.token`. Send it as `Authorization: Bearer `, together with the publishable key. `/customers/me` and its addresses and marketing consent, `/customers/logout`, `/customers/resend-verification` and `/cart/claim` require it, and answer `401` `CUSTOMER_AUTH_REQUIRED` without a valid one. Cart, checkout and booking routes accept it too, and then act for that customer. ## Allowed origins When your site has a domain, the content, page, site, form, review, search and SEO routes check the `Origin` or `Referer` header. Commerce, analytics and cookie consent routes do not. A request from another hostname returns `403` `DOMAIN_MISMATCH`. A form or review submission that carries neither header returns `403` `DOMAIN_ORIGIN_REQUIRED`, so a server-side caller sends an `Origin` header naming your domain. A read without them is served. To allow another hostname, such as a local or staging host, add it under **Settings > Developers > Storefront > Allowed origins**. Only the hostname is compared: the port and the scheme are ignored. ## Spam protection on writes Form, review, booking, checkout, signup and password reset requests go through the site's spam protection, in one of two modes: - Honeypot and timestamp, the default. Leave `_hp` empty and set `_ts` to the time the form loaded, in milliseconds. A missing `_ts`, or one more recent than the site's minimum delay (3 seconds by default), returns `429` `RATE_SUBMISSION_TOO_FAST`. One older than the maximum (1 hour by default) returns `400` `RATE_SUBMISSION_EXPIRED`. - reCAPTCHA, when the site uses it. Send the token in `recaptchaToken`. A missing or failed token returns `400`. Read routes have no spam protection. ## Caching Every response carries a `Cache-Control` header that says whether, and for how long, you may cache it. ## Error responses | Status | Meaning | | --- | --- | | `400` | Site ID not a UUID, form expired, or reCAPTCHA token missing or failed | | `401` | Publishable key or customer session token missing or invalid where required | | `403` | Origin not allowed, site inactive, customer account or verified email required, no access to this payment, or the feature is not public | | `404` | Site or resource not found | | `422` | Validation error | | `429` | Too many requests, or a form sent too soon | --- # List blog categories **Published**: 2026-11-30 **Category**: Content ## `GET /categories` **List blog categories** Lists the site's categories as a flat list, each with its `path` under the site's `blogUrlMode` and its published content count. Use `GET /categories/tree` for the nested form. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | With `locale`, `false` leaves out the items not translated into the requested locale. Single-language sites ignore it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=300`. Rate-limit > bucket: general. ### SDK ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const { categories, blogUrlMode } = await lynkow.categories.list() categories.forEach(cat => { console.log(`${cat.name} (${cat.contentCount} articles)`) }) ``` ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/categories?locale=en" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/categories?locale=en`) const { data: { categories, blogUrlMode, locale } } = await res.json() ``` ### Response Example ```json { "data": { "categories": [ { "id": "01J9PA0NZK7BX4HQ7M2DC9V5T8", "name": "Engineering", "slug": "engineering", "path": "/blog/engineering", "description": "Posts about the engineering team.", "image": "https://cdn.lynkow.com/sites/acme/cat/engineering.jpg", "contentMode": "standard", "schema": null, "schemaSource": null, "displayOrder": 1, "locale": "en", "contentCount": 12 } ], "blogUrlMode": "with-categories", "locale": "en" } } ``` --- --- # Overview **Published**: 2026-11-30 **Category**: Storefront API Public read and submission endpoints for storefronts and frontends. Requests carry no API token: the site ID is in the URL path. Commerce and customer account routes also require your publishable key in the `X-Lynkow-Pk` header, and signed-in customer routes a customer session token. Form, review, booking, checkout, signup and password reset requests go through the site spam protection. ## Authentication Requests carry no API token. The site ID is part of the base URL. Commerce routes also require your publishable key in the `X-Lynkow-Pk` header, and customer account routes require a customer session token as `Authorization: Bearer `. Each endpoint page lists what it requires. [Site Access & Spam Protection](/storefront-api/storefront-site-access) details both, with the allowed origins and the spam protection on writes. ## First request Read the public configuration of your site. It needs no key. ```typescript import { createClient } from 'lynkow' const lynkow = createClient({ siteId: process.env.LYNKOW_SITE_ID! }) const config = await lynkow.site.getConfig() console.log(config.enabledLocales) // ['en', 'fr', 'de'] console.log(config.i18n.detection.enabled) // true console.log(config.analytics.consentMode) // 'opt-in' ``` ```bash curl "https://api.lynkow.com/storefront/$LYNKOW_SITE_ID/site" ``` ## Errors Every error returns JSON with an `errors` array and a `requestId`: ```json { "errors": [ { "message": "The email field must be defined", "field": "email", "code": "VALIDATION_REQUIRED" } ], "requestId": "8f14e45f-ceea-467f-a8e5-2c0d3a1b6f9e" } ``` Branch on `code`: it is stable, while `message` is written for people and can change. `field` names the input at fault. Quote `requestId` when you contact support. | Status | Meaning | | --- | --- | | `400` | Malformed request, or a submission refused by spam protection | | `401` | Missing, invalid or revoked publishable key, or no valid customer session (`CUSTOMER_AUTH_REQUIRED`) | | `403` | The request origin is not allowed for the site or the key, or a write on a site whose storefront API is read-only, such as the docs demo site (`STOREFRONT_READ_ONLY`) | | `404` | Unknown or unpublished resource | | `422` | Validation failed: one entry per invalid field | | `429` | Rate limit exceeded (`RATE_LIMIT_EXCEEDED`), or a form sent too fast (`RATE_SUBMISSION_TOO_FAST`) | | `500` | Server error, with a generic message | ## Rate limits Requests are counted per minute, per site and per client IP. With a publishable key, they are also counted per key. Some routes have tighter limits of their own, such as form and review submissions, customer sign-in and the cart. Past a limit, the API returns 429 `RATE_LIMIT_EXCEEDED`. Wait, then retry with an exponential backoff. Only the customer sign-in and confirmation backoffs send a `Retry-After` header. A successful response carries `X-RateLimit-Limit` and `X-RateLimit-Remaining` for one of the limits that apply, so a tighter route limit can refuse a request first. --- # Update site settings **Published**: 2026-11-30 **Category**: Settings & Config ## `PUT /site/settings` **Update site settings** Updates the settings you send and leaves the others unchanged. Sending `allowedHostnames`, or a new `domain`, also requires the `sites.hostnames.update` permission on the token, else 403 `AUTHZ_INSUFFICIENT_PERMISSIONS` and nothing is written. The domain is stored as a lower-case ASCII hostname: `https://Bücher.example:8443/shop` becomes `xn--bcher-kva.example`. A new domain clears any custom account-pages URL and invalidates pending customer verification and password-reset links. `logoUrl` and `faviconUrl` take an absolute http or https URL; null or an empty string clears them. `showBranding` stays true when the site's plan requires the badge. Setting `isActive` to false turns the site off: later calls with an API token on it return 403 `TENANT_SITE_INACTIVE`. Without `sites.view`, the response is an acknowledgement instead of the settings. Errors: 400 `SITE_DOMAIN_TAKEN` when another site uses the domain, 422 for a domain that is not a hostname, an invalid URL or a new `timezone` that is not an IANA zone. Required permissions: `sites.update` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-255 characters | | `domain` | string | No | Primary site domain, stored as a lowercase ASCII hostname: a pasted http or https URL keeps only its host, and an internationalized name is stored in its ASCII (xn--) form. 1-255 characters | | `description` | string \| null | No | Description text | | `logoUrl` | string \| null | No | Absolute http or https URL of the site logo, 500 characters at most. null, an empty string or a whitespace-only string clears the logo; any other value is a 422 | | `faviconUrl` | string \| null | No | Absolute http or https URL of the site favicon, 500 characters at most. null, an empty string or a whitespace-only string clears the favicon; any other value is a 422 | | `timezone` | string | No | IANA timezone name, such as `Europe/Paris`. A new value that is an unknown zone or a UTC offset returns 422 | | `isActive` | boolean | No | Set to false to turn the site off: API token calls on it then return 403 `TENANT_SITE_INACTIVE` | | `showBranding` | boolean | No | Whether the SDK shows the "Made with Lynkow" badge on your pages. A plan that requires the badge keeps it shown | | `previewUrl` | string \| null | No | Frontend preview URL | | `allowedHostnames` | string[] | No | Hostnames, besides the site domain, that non-commerce storefront requests may come from, matched on `Origin` or `Referer`. Replaces the stored list | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | `SITE_DOMAIN_TAKEN`: another site already uses this domain. Nothing is changed. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/site/settings \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "My Updated Website", "timezone": "America/New_York", "previewUrl": "https://staging.example.com" }' ``` ### Response Example ```json { "data": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "My Updated Website", "domain": "www.example.com", "slug": "my-website", "description": "Company website and blog", "logoUrl": "https://cdn.lynkow.com/sites/abc123/logo.png", "faviconUrl": "https://cdn.lynkow.com/sites/abc123/favicon.ico", "timezone": "America/New_York", "isActive": true, "showBranding": false, "previewUrl": "https://staging.example.com", "allowedHostnames": [ "staging.example.com" ], "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "createdAt": "2025-01-01T00:00:00.000Z", "updatedAt": "2025-04-06T11:00:00.000Z", "defaultLocale": "en", "multiLanguageEnabled": true, "enabledLocales": [ "en", "fr" ], "i18nDetectionEnabled": true, "i18nDetectionOrder": [ "cookie", "browser" ], "i18nCookieName": "_lkw_lang", "i18nCookieMaxAge": 365, "analyticsConsentMode": "opt-in" } } ``` --- --- # Delete a customer address **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /customers/:id/addresses/:addressId` **Delete a customer address** Deletes one of the customer's addresses. Deleting the default shipping or billing address leaves the customer without that default: no other address takes it. Returns 404 for an unknown customer or address, and when customer addresses are turned off for the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer identifier (cust_ prefixed id) | | `addressId` | path | string | Yes | Customer address identifier (addr_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Update cookie consent settings **Published**: 2026-11-30 **Category**: Settings & Config ## `PUT /cookie-consent/settings` **Update cookie consent settings** Updates the cookie consent settings with the fields you send and returns them. `themeStyles` is merged, so a partial light or dark patch keeps the other keys. `texts` and `categories` replace what is stored. A banner string sent empty or equal to the default copy is not stored, so the public banner keeps showing it in each visitor's language. A site with no stored settings gets them created from the defaults, and the banner stays off until you send `enabled: true`. `layout` is always `floating`, and a `position` other than `bottom-left` or `bottom-right` becomes `bottom-right`. A save that changes a value fires the `site.updated` webhook with `fields: ['cookie_consent']`. 422 for more than 50 `categories`, or for a `thirdPartyScripts` entry whose `category` is neither `necessary`, `analytics`, `marketing`, `preferences` nor a category sent in the request (or, when none is sent, already stored). Required permissions: `cookie_consent.update` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | No | Whether the consent banner runs. When `false`, no banner shows and Lynkow analytics tracks without waiting for consent | | `consentMode` | "opt-in" \| "opt-out" \| "notice-only" | No | One of: opt-in, opt-out, notice-only | | `showOnFirstVisit` | boolean | No | Whether the banner opens by itself for a visitor who has not answered yet. When `false`, open it from your own link | | `position` | "bottom" \| "top" \| "center" \| "bottom-left" \| "bottom-right" | No | Banner position: bottom-left or bottom-right. The retired values bottom, top and center are still accepted and stored as bottom-right | | `layout` | "banner" \| "modal" \| "floating" | No | Banner layout. Every accepted value is stored as floating, the only layout the banner supports | | `theme` | "light" \| "dark" \| "auto" | No | One of: light, dark, auto | | `primaryColor` | string | No | Primary brand color (hex) | | `borderRadius` | number (0 to 50) | No | Corner radius in pixels of the SDK consent banner, its buttons and the preferences dialog | | `fontSize` | number (11 to 17) | No | Font size in pixels of the banner text and buttons | | `showCustomizeButton` | boolean | No | Whether the banner shows a button that opens the per-category consent choices | | `orientation` | "auto" \| "column" | No | One of: auto, column | | `maxWidth` | number (280 to 1200) | No | Maximum width of the consent banner in pixels, for the bottom-left and bottom-right positions | | `buttonSize` | "compact" \| "comfortable" | No | One of: compact, comfortable | | `themeStyles` | object | No | Custom theme style overrides | | `texts` | object | No | UI text content | | `categories` | object[] | No | The site's consent categories, replacing the stored list. Each carries an id (one of the built-in ids necessary, analytics, marketing and preferences, or a custom id), a name, a description, and the required and enabled flags | | `privacyPolicyUrl` | string \| null | No | Privacy policy page URL | | `cookiePolicyUrl` | string \| null | No | Cookie policy page URL | | `thirdPartyScripts` | object[] | No | Third-party scripts loaded once the visitor consents to their category, replacing the stored list. Each `category` is a built-in id or a category this request sends (else a stored one); any other returns 422 | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Response Example ```json { "data": { "id": 42, "siteId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "enabled": true, "consentMode": "opt-in", "showOnFirstVisit": true, "position": "bottom-right", "layout": "floating", "theme": "light", "primaryColor": "#1e40af", "borderRadius": 8, "fontSize": 13, "showCustomizeButton": true, "orientation": "auto", "maxWidth": 580, "buttonSize": "compact", "themeStyles": { "light": { "primaryColor": "#1e40af", "bgColor": "#ffffff", "textColor": "#1a1a1a" }, "dark": { "primaryColor": "#f4f4f5", "bgColor": "#18181b", "textColor": "#f4f4f5" } }, "texts": { "description": "This site uses cookies to improve your experience and analyze traffic.", "acceptAll": "Accept all", "rejectAll": "Reject all", "customize": "Customize", "save": "Save my choices", "privacyPolicy": "Privacy policy", "required": "(required)" }, "categories": [ { "id": "necessary", "name": "Necessary", "description": "These cookies are essential for the site to work.", "required": true, "enabled": true }, { "id": "analytics", "name": "Analytics", "description": "Help us understand how you use the site.", "required": false, "enabled": true }, { "id": "marketing", "name": "Marketing", "description": "Used for personalized advertising.", "required": false, "enabled": false }, { "id": "preferences", "name": "Preferences", "description": "Remember your choices and preferences.", "required": false, "enabled": true } ], "privacyPolicyUrl": "https://www.example.com/privacy", "cookiePolicyUrl": null, "thirdPartyScripts": [ { "id": "visit-stats", "name": "Visit statistics", "category": "analytics", "script": "", "enabled": true } ], "createdAt": "2026-05-12T14:32:18.000Z", "updatedAt": "2026-10-02T08:41:05.000Z" } } ``` --- --- # Get basic site info **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /site/info` **Get basic site info** Returns the identity and branding of the token's site, with its ID. `GET /site/settings` returns the same fields plus the editable settings. Required permissions: `sites.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/site/info \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "My Website", "domain": "www.example.com", "slug": "my-website", "logoUrl": "https://cdn.lynkow.com/sites/abc123/logo.png", "faviconUrl": "https://cdn.lynkow.com/sites/abc123/favicon.ico", "timezone": "Europe/Paris" } } ``` --- --- # Get consent statistics **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /cookie-consent/stats` **Get consent statistics** Returns consent counts for the site over the `period` query parameter (`7d`, `30d`, `3m`, `6m` or `12m`, default `30d`): how many consent choices were recorded, by action and by optional category. Required permissions: `cookie_consent.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/cookie-consent/stats \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "totalInteractions": 5420, "acceptAll": 3850, "rejectAll": 420, "custom": 1150, "byCategory": { "necessary": 5420, "analytics": 4200, "marketing": 2100 } } ``` --- --- # Get a support ticket **Published**: 2026-11-30 **Category**: Admin API ## `GET /support/tickets/:id` **Get a support ticket** Returns one ticket of the token's organization and site, with its messages and attachments in chronological order. Internal notes are not included. `updatedAt` is the last activity you can see, as on the list. An unknown ticket answers 404. Required permissions: `support.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | The API token does not resolve to an organization and one of its sites (code `SUPPORT_TOKEN_IDENTITY_INVALID`). | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Get i18n detection settings **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /site/settings/i18n-detection` **Get i18n detection settings** Returns whether visitor language detection is on. When it is, the `@lynkow/next` proxy sends a first visit to the home page, without the `_lkw_lang` cookie, to the home page of the browser's language. The detection order, cookie name and cookie lifetime are fixed. Required permissions: `sites.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Response Example ```json { "data": { "detectionEnabled": true, "detectionOrder": [ "cookie", "browser" ], "cookieName": "_lkw_lang", "cookieMaxAge": 365 } } ``` --- --- # List supported locales **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /site/settings/locales` **List supported locales** Returns every locale Lynkow supports, with its native name in `label`, its flag and its writing direction. The locales enabled on the site are returned by `GET /site/settings/language`. Required permissions: `sites.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Response Example ```json { "data": [ { "code": "en", "label": "English", "flag": "🇬🇧", "direction": "ltr" }, { "code": "fr", "label": "Français", "flag": "🇫🇷", "direction": "ltr" } ] } ``` --- --- # List available timezones **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /site/settings/timezones` **List available timezones** Returns the timezones offered for the site's `timezone` setting, each with its IANA identifier in `value` and a display `label`. Required permissions: `sites.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Response Example ```json { "data": [ { "value": "Europe/Paris", "label": "Paris (GMT+1)" }, { "value": "Europe/London", "label": "London (GMT+0)" }, { "value": "America/New_York", "label": "New York (GMT-5)" }, { "value": "UTC", "label": "UTC (GMT+0)" } ] } ``` --- --- # List webhook delivery logs **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /webhooks/:id/logs` **List webhook delivery logs** Returns the webhook's delivery logs, newest first, paginated and filterable by `success`. Each attempt, retries and tests included, has its own log. Logs omit the event payload and the destination's response body, and are kept for 30 days. An unknown `id` returns 404. Required permissions: `webhooks.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Items per page; maximum 100 and default 20 on `/v1` | | `success` | query | boolean | No | Filter delivery logs by successful or failed outcome | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Upsert a settings translation **Published**: 2026-11-30 **Category**: Settings & Config ## `PUT /site/settings/translations/:setting/:locale` **Upsert a settings translation** Creates or replaces the override of one setting in one language. The body is that setting's translation payload: it replaces the stored one, and an absent field inherits the default-language value. For `seo.json_ld_graph`, each `data` is merged over the site JSON-LD node of the same `id`. An entry whose `id` is not in the site graph, and that this language does not already store, returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks advanced JSON-LD. Fires the `site.updated` webhook with the setting and the locale, plus `seo.updated` for the `seo.*` settings. Errors: 422 `VALIDATION_FIELD_INVALID` on `locale` for the default language or a language not enabled on the site, 422 for an unknown `setting` or an invalid payload, 403 `AUTHZ_PERMISSION_DENIED` without the update permission of that setting. Required permissions (any one of): `sites.update`, `cookie_consent.update`, `seo.update`, `reviews.settings`, `search.config.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `setting` | path | string | Yes | Settings translation key: one of site.identity, cookie_consent, seo.json_ld_graph, seo.llms_description, reviews.custom_field_labels, search.synonyms. Any other value is a 422 | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Request Body Content-Type: `application/json` *No schema defined* ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Get site settings **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /site/settings` **Get site settings** Returns the site's settings. `showBranding` is the value applied: it is always true when the site's plan requires the Lynkow badge. `allowedHostnames` lists the hostnames, beyond the site domain, allowed to call the storefront API. Language settings are read from `GET /site/settings/language` and `GET /site/settings/i18n-detection`. Required permissions: `sites.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/site/settings \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "My Website", "domain": "www.example.com", "slug": "my-website", "description": "Company website and blog", "logoUrl": "https://cdn.lynkow.com/sites/abc123/logo.png", "faviconUrl": "https://cdn.lynkow.com/sites/abc123/favicon.ico", "timezone": "Europe/Paris", "isActive": true, "showBranding": false, "previewUrl": "https://www.example.com", "allowedHostnames": [ "staging.example.com" ], "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "createdAt": "2025-01-01T00:00:00.000Z", "updatedAt": "2025-04-05T14:30:00.000Z" } } ``` --- --- # Create a webhook **Published**: 2026-11-30 **Category**: Settings & Config ## `POST /webhooks` **Create a webhook** Creates a webhook that POSTs each subscribed event to `url`. Each event needs the view permission of what it reports, such as `forms.submissions.view` for `form.submitted`, or the request returns 403 naming each event and its permission. The full `secret` appears only in this response. With a secret, each delivery carries `X-Webhook-Signature: sha256=`, the HMAC-SHA256 of the raw request body keyed by the secret. The body is `{ "event", "timestamp", "data" }`, with the event's payload in `data`. With `groupBursts`, on by default, the 11th and later events of one type within 60 seconds arrive as one `.batch` delivery. A delivery fails on a non-2xx answer, a redirect, or no answer within 30 seconds. An event is retried with backoff only when every webhook subscribed to it failed, so one event can arrive twice. Delivery order is not guaranteed. Errors: 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` or `SUBSCRIPTION_QUOTA_EXCEEDED`, 422 for a refused `url` or `headers`. Required permissions: `webhooks.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Webhook display name | | `url` | string | Yes | HTTP or HTTPS destination whose host resolves to a public address. Localhost, internal addresses, credentials in the URL and ports 22, 23, 25, 3306, 5432, 6379, 27017 and 11211 return 422 | | `events` | "content.created" \| "content.updated" \| "content.deleted" \| "content.published" \| "content.unpublished" \| "content.scheduled" \| "content.archived" \| "content.translated" \| "content.bulk_published" \| "content.bulk_archived" \| "content.bulk_deleted" \| "form.created" \| "form.updated" \| "form.deleted" \| "form.submitted" \| "form.translated" \| "review.created" \| "review.updated" \| "review.deleted" \| "review.bulk_updated" \| "review.bulk_deleted" \| "review.translated" \| "media.uploaded" \| "media.updated" \| "media.replaced" \| "media.trashed" \| "media.restored" \| "media.deleted" \| "category.created" \| "category.updated" \| "category.deleted" \| "category.translated" \| "tag.created" \| "tag.updated" \| "tag.deleted" \| "tag.translated" \| "redirect.created" \| "redirect.updated" \| "redirect.deleted" \| "redirect.bulk_deleted" \| "sitemap_entry.created" \| "sitemap_entry.updated" \| "sitemap_entry.deleted" \| "sitemap_rule.created" \| "sitemap_rule.updated" \| "sitemap_rule.deleted" \| "site_block.created" \| "site_block.updated" \| "site_block.schema_updated" \| "site_block.published" \| "site_block.unpublished" \| "site_block.deleted" \| "site_block.translation_created" \| "variable.created" \| "variable.updated" \| "variable.deleted" \| "variable.translated" \| "site.updated" \| "seo.updated" \| "product.created" \| "product.updated" \| "product.published" \| "product.archived" \| "product.deleted" \| "product.translated" \| "product_option.created" \| "product_option.updated" \| "product_option.deleted" \| "product_variant.created" \| "product_variant.updated" \| "product_variant.deleted" \| "product_collection.created" \| "product_collection.updated" \| "product_collection.deleted" \| "product_collection.translated" \| "product_category.created" \| "product_category.updated" \| "product_category.deleted" \| "product_category.moved" \| "product_category.translated" \| "reservation.booked" \| "reservation.cancelled" \| "reservation.rescheduled" \| "reservation_offering.translated" \| "reservation_calendar.translated" \| "order.placed" \| "order.paid" \| "order.cancelled" \| "payment.captured" \| "payment.refund_pending" \| "shipment.created" \| "shipment.in_transit" \| "shipment.out_for_delivery" \| "shipment.ready_for_pickup" \| "shipment.delivered" \| "shipment.failed" \| "shipment.cancelled" \| "webhook.test"[] | Yes | One or more event names that trigger delivery | | `headers` | object | No | Headers added to each delivery, values write-only. Reserved names such as `Authorization` and `X-Webhook-Signature` are dropped. 422 for two spellings of one name, a non-token name, or a value with an ASCII control other than tab or a character above U+00FF | | `secret` | string | No | HMAC signing secret of 32 to 255 characters, returned in full only by the create response. Omit it to deliver unsigned on create, or to keep the stored secret on update | | `isEnabled` | boolean | No | Filter by enabled state on lists, or enable/disable delivery on writes | | `groupBursts` | boolean | No | Deliver the 11th and later events of one type within 60 seconds as one `.batch` delivery. Defaults to true on create | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan lacks this feature, its quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # List customer groups **Published**: 2026-11-30 **Category**: Commerce ## `GET /customer-groups` **List customer groups** Lists the site's customer groups with their member count, newest first by default, 20 per page. `search` matches the group name. Returns 404 when customer groups are turned off for the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name. Max 120 characters | | `sortBy` | query | "name" \| "created_at" | No | One of: name, created_at | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # List support tickets **Published**: 2026-11-30 **Category**: Admin API ## `GET /support/tickets` **List support tickets** Lists the support tickets of the token's organization and site, most recently active first. Filter with `status` (`open`, `pending`, `in_progress`, `resolved`, `closed`); `limit` defaults to 20, max 100. Each ticket carries `messagesCount`, which excludes internal notes. `updatedAt` moves only on activity you can see: public messages and attachments, and changes to status, priority, category, resolution or closure. Internal notes and assignment changes leave it unchanged, so it is safe to poll. Errors: 400 when the token resolves to no organization and site, 422 for an invalid `status`. Required permissions: `support.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `status` | query | "open" \| "pending" \| "in_progress" \| "resolved" \| "closed" | No | One of: open, pending, in_progress, resolved, closed | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | The API token does not resolve to an organization and one of its sites (code `SUPPORT_TOKEN_IDENTITY_INVALID`). | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Get cookie consent settings **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /cookie-consent/settings` **Get cookie consent settings** Returns the site's cookie consent settings: banner texts, categories, theme styles, layout, third-party scripts and policy URLs. A banner string the site does not store is returned as the default copy in the site's default locale (English when that locale has none); the public banner shows it in each visitor's language. A site with no stored settings gets the defaults, `enabled: false` and `consentMode: 'opt-in'`, with `id`, `createdAt` and `updatedAt` set to `null`. Required permissions: `cookie_consent.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/cookie-consent/settings \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": 42, "siteId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "enabled": true, "consentMode": "opt-in", "showOnFirstVisit": true, "position": "bottom-right", "layout": "floating", "theme": "light", "primaryColor": "#000000", "borderRadius": 8, "fontSize": 13, "showCustomizeButton": true, "orientation": "auto", "maxWidth": 580, "buttonSize": "compact", "themeStyles": { "light": { "primaryColor": "#000000", "bgColor": "#ffffff", "textColor": "#1a1a1a" }, "dark": { "primaryColor": "#f4f4f5", "bgColor": "#18181b", "textColor": "#f4f4f5" } }, "texts": { "description": "This site uses cookies to improve your experience and analyze traffic.", "acceptAll": "Accept all", "rejectAll": "Reject all", "customize": "Customize", "save": "Save my choices", "privacyPolicy": "Privacy policy", "required": "(required)" }, "categories": [ { "id": "necessary", "name": "Necessary", "description": "These cookies are essential for the site to work.", "required": true, "enabled": true }, { "id": "analytics", "name": "Analytics", "description": "Help us understand how you use the site.", "required": false, "enabled": true }, { "id": "marketing", "name": "Marketing", "description": "Used for personalized advertising.", "required": false, "enabled": false }, { "id": "preferences", "name": "Preferences", "description": "Remember your choices and preferences.", "required": false, "enabled": true } ], "privacyPolicyUrl": "https://www.example.com/privacy", "cookiePolicyUrl": null, "thirdPartyScripts": [ { "id": "visit-stats", "name": "Visit statistics", "category": "analytics", "script": "", "enabled": true } ], "createdAt": "2026-05-12T14:32:18.000Z", "updatedAt": "2026-06-03T09:15:42.000Z" } } ``` --- --- # List missing and needs-review translations **Published**: 2026-11-30 **Category**: Core CMS ## `GET /translations/pending` **List missing and needs-review translations** Lists the translations still to do, per locale and type: `missing` when the entity has no version in that locale, `needs_review` when its default-language text changed after the translation was written. Up-to-date translations are not listed. Without `locale`, every language of the site is listed. 20 items per page by default, at most 100. A `locale` the site does not use is a 422. Lists only the types the token may view, such as `contents.view` or `products.view`. Asking for a `type` it may not view returns 403 `AUTHZ_PERMISSION_DENIED`. Clear a `needs_review` item with `POST /translations/mark-reviewed`. Required permissions (any one of): `contents.view`, `categories.view`, `tags.view`, `variables.view`, `forms.view`, `reviews.view`, `site_blocks.view`, `products.view`, `product_categories.view`, `product_collections.view`, `reservations.view`, `sites.view`, `cookie_consent.view`, `seo.view`, `reviews.settings`, `search.config.update`, `media.view`, `commerce_emails.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr"). 1-35 characters | | `type` | query | "content" \| "category" \| "tag" \| "variable" \| "form" \| "review" \| "site_block" \| "product" \| "product_category" \| "product_collection" \| "reservation_offering" \| "reservation_calendar" \| "shipping_option" \| "setting" \| "media" \| "email_override" | No | Resource type. One of: content, category, tag, variable, form, review, site_block, product, product_category, product_collection, reservation_offering, reservation_calendar, shipping_option, setting, media, email_override | | `status` | query | "missing" \| "needs_review" | No | One of: missing, needs_review | | `page` | query | integer (min 1) | No | Page number, starting at 1 | | `limit` | query | integer (1 to 100) | No | Number of items per page | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Mark a translation as reviewed **Published**: 2026-11-30 **Category**: Core CMS ## `POST /translations/mark-reviewed` **Mark a translation as reviewed** Clears the `needsReview` flag of one translation without changing its text. A translation is flagged when the default-language text it was translated from changes; it stays published meanwhile. Send the `type`, `id` and `locale` of an item listed by `GET /translations/pending`. Requires the update permission of that type, such as `contents.update` or `products.update` (403 `AUTHZ_PERMISSION_DENIED` otherwise). Returns 404 when the entity is not on the site or has no translation in that locale, and 422 on `locale` for the site's default language. Fires no webhook. Required permissions (any one of): `contents.update`, `categories.update`, `tags.update`, `variables.update`, `forms.update`, `reviews.update`, `site_blocks.update`, `products.update`, `product_categories.manage`, `product_collections.manage`, `reservations.manage`, `sites.update`, `cookie_consent.update`, `seo.update`, `reviews.settings`, `search.config.update`, `media.update`, `commerce_emails.manage` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | "content" \| "category" \| "tag" \| "variable" \| "form" \| "review" \| "site_block" \| "product" \| "product_category" \| "product_collection" \| "reservation_offering" \| "reservation_calendar" \| "shipping_option" \| "setting" \| "media" \| "email_override" | Yes | Required. Resource type. One of: content, category, tag, variable, form, review, site_block, product, product_category, product_collection, reservation_offering, reservation_calendar, shipping_option, setting, media, email_override | | `id` | string | Yes | Required. The id GET /translations/pending lists: the id of any language version of a CMS entity, a prefixed commerce id such as prod_... (or its UUID), a setting key, or an email template family | | `locale` | string | Yes | Required. BCP 47 locale code (e.g. "en", "fr"). 1-35 characters | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Update spam settings **Published**: 2026-11-30 **Category**: Settings & Config ## `PUT /spam-settings` **Update spam settings** Updates the spam protection settings with the fields you send. Times are in milliseconds. Setting `protectionMethod` to `recaptcha` requires both reCAPTCHA keys, sent or already stored, and `recaptchaEnabled` true, else 400 `VALIDATION_FAILED` naming what is missing. The reCAPTCHA secret is masked in the response, and sending that mask back leaves the stored secret unchanged. A caller without `spam.settings.view` receives an acknowledgement instead of the settings. Required permissions: `spam.settings.update` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `protectionMethod` | "honeypot" \| "recaptcha" | No | One of: honeypot, recaptcha | | `honeypotEnabled` | boolean | No | Whether a submission that fills the hidden decoy field is dropped. The sender still receives a success response | | `minSubmissionTimeMs` | number (0 to 60000) | No | Minimum milliseconds between a form's `_ts` render timestamp and its submission; a faster one gets 429 `RATE_SUBMISSION_TOO_FAST`. Honeypot mode only | | `maxSubmissionTimeMs` | number (60000 to 86400000) | No | Maximum milliseconds between a form's `_ts` render timestamp and its submission; an older one gets 400 `RATE_SUBMISSION_EXPIRED`. Honeypot mode only | | `spamPatternsEnabled` | boolean | No | Discards a submission whose `content` or `message` matches common spam patterns, while answering with a success response. Honeypot mode only | | `recaptchaEnabled` | boolean | No | Whether reCAPTCHA is on. It applies only with both keys set and `protectionMethod` set to `recaptcha`; otherwise the honeypot does | | `recaptchaSiteKey` | string \| null | No | Public reCAPTCHA key your storefront renders the widget with. `null` clears it | | `recaptchaSecretKey` | string \| null | No | Private reCAPTCHA key used to verify tokens. Reads return it masked, so send it only to change it; `null` clears it | | `recaptchaVersion` | "v2" \| "v3" | No | Verification version: v2 challenge or v3 action and score verification. One of: v2, v3 | | `recaptchaMinScore` | number (0 to 1) | No | Minimum accepted v3 score between 0 and 1, default 0.5; authenticated configuration only | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Response Example ```json { "data": { "message": "Spam settings updated successfully", "settings": { "protectionMethod": "recaptcha", "honeypotEnabled": true, "minSubmissionTimeMs": 3000, "maxSubmissionTimeMs": 1800000, "spamPatternsEnabled": true, "recaptchaEnabled": true, "recaptchaSiteKey": "6Le...", "recaptchaSecretKey": "••••••••", "recaptchaVersion": "v3", "recaptchaMinScore": 0.5, "isRecaptchaConfigured": true } } } ``` --- --- # Update language settings **Published**: 2026-11-30 **Category**: Settings & Config ## `PUT /site/settings/language` **Update language settings** Replaces the site's language settings: send `defaultLocale`, `multiLanguageEnabled` and `enabledLocales` together. `defaultLocale` must be one of `enabledLocales`. The old URLs of a removed locale redirect to the same page in the default locale, else in another enabled locale that serves it. Markets stop offering a removed locale. On a site that stays single-language, a new `defaultLocale` moves the site's content and commerce translations to it. A row that would collide with an existing one stays in the old locale and is listed in `relabel.kept`. Fires the `site.updated` webhook with the fields that changed. Errors: 400 `SITE_DEFAULT_LOCALE_MISMATCH`, 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the plan allows fewer locales, 422 for a duplicate or unsupported locale. Required permissions: `sites.update` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `defaultLocale` | string | Yes | Required | | `multiLanguageEnabled` | boolean | Yes | Required | | `enabledLocales` | string[] | Yes | Required | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Response Example ```json { "data": { "defaultLocale": "en", "multiLanguageEnabled": true, "enabledLocales": [ "en", "fr", "es", "de" ], "redirects": { "created": 0, "deleted": 0 }, "message": "Multi-language enabled. 0 redirects created." } } ``` --- --- # Delete a settings translation **Published**: 2026-11-30 **Category**: Settings & Config ## `DELETE /site/settings/translations/:setting/:locale` **Delete a settings translation** Deletes the override of one setting in one language, so that language serves the default-language value again. Returns 204, also when nothing was stored. A deletion fires the `site.updated` webhook with the setting and the locale, plus `seo.updated` for the `seo.*` settings. Errors: 422 `VALIDATION_FIELD_INVALID` on `locale` for the default language or a language not enabled on the site, 422 for an unknown `setting`, 403 `AUTHZ_PERMISSION_DENIED` without the update permission of that setting. Required permissions (any one of): `sites.update`, `cookie_consent.update`, `seo.update`, `reviews.settings`, `search.config.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `setting` | path | string | Yes | Settings translation key: one of site.identity, cookie_consent, seo.json_ld_graph, seo.llms_description, reviews.custom_field_labels, search.synonyms. Any other value is a 422 | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Upload a support ticket attachment **Published**: 2026-11-30 **Category**: Admin API ## `POST /support/tickets/:id/attachments` **Upload a support ticket attachment** Attaches one file to a ticket of the token's organization and site, sent as multipart form data in the `file` field. The file is at most 5 MB and must be `jpg`, `jpeg`, `png`, `gif`, `webp`, `pdf`, `txt` or `log`; any other file answers 422. An unknown ticket answers 404. Required permissions: `support.create` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `multipart/form-data` | Field | Type | Required | Description | | --- | --- | --- | --- | | `file` | string | Yes | Attachment file, up to 5 MB. Allowed extensions: jpg, jpeg, png, gif, webp, pdf, txt, log. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | The ticket is closed (code `SUPPORT_TICKET_CLOSED`), the file upload could not be read, or the API token does not resolve to an organization and one of its sites (code `SUPPORT_TOKEN_IDENTITY_INVALID`). | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | | `503` | Attachment storage is unavailable. | --- --- # Get spam settings **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /spam-settings` **Get spam settings** Returns the site's spam protection settings: the protection method, the honeypot timing window in milliseconds, the spam-pattern filter and the reCAPTCHA settings. The reCAPTCHA secret is masked, and `isRecaptchaConfigured` tells whether `recaptchaEnabled` is true with both reCAPTCHA keys set. Required permissions: `spam.settings.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/spam-settings \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "protectionMethod": "honeypot", "honeypotEnabled": true, "minSubmissionTimeMs": 3000, "maxSubmissionTimeMs": 1800000, "spamPatternsEnabled": true, "recaptchaEnabled": false, "recaptchaSiteKey": null, "recaptchaSecretKey": null, "recaptchaVersion": "v3", "recaptchaMinScore": 0.5, "isRecaptchaConfigured": false } } ``` --- --- # Get a settings translation **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /site/settings/translations/:setting/:locale` **Get a settings translation** Returns the override of one setting in one language. `payload` holds only the fields the translation sets: the others inherit the default-language value. When none is stored, including in the default language, returns 200 with an empty `payload` and a null `updatedAt`. Errors: 403 `AUTHZ_PERMISSION_DENIED` without the read permission of that setting, 422 for an unknown `setting`. Required permissions (any one of): `sites.view`, `cookie_consent.view`, `seo.view`, `reviews.settings`, `search.config.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `setting` | path | string | Yes | Settings translation key: one of site.identity, cookie_consent, seo.json_ld_graph, seo.llms_description, reviews.custom_field_labels, search.synonyms. Any other value is a 422 | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Update i18n detection settings **Published**: 2026-11-30 **Category**: Settings & Config ## `PUT /site/settings/i18n-detection` **Update i18n detection settings** Switches visitor language detection on or off with `detectionEnabled`, the only writable field. Other fields sent in the body are ignored. Fires the `site.updated` webhook when the value changes. Required permissions: `sites.update` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `detectionEnabled` | boolean | Yes | Required | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Response Example ```json { "data": { "detectionEnabled": true, "detectionOrder": [ "cookie", "browser" ], "cookieName": "_lkw_lang", "cookieMaxAge": 365 } } ``` --- --- # List settings translations **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /site/settings/translations` **List settings translations** Lists the site's settings translations without their payloads, ordered by setting then locale. A settings translation overrides the text of one site setting in one language other than the default. `needsReview` is true when the default-language value changed after the translation was written. Only the settings your token may read are listed: each setting has its own read permission, such as `sites.view` for `site.identity` or `seo.view` for the `seo.*` settings. Filtering on a `setting` you may not read returns 403 `AUTHZ_PERMISSION_DENIED`. Required permissions (any one of): `sites.view`, `cookie_consent.view`, `seo.view`, `reviews.settings`, `search.config.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `setting` | query | "site.identity" \| "cookie_consent" \| "seo.json_ld_graph" \| "seo.llms_description" \| "reviews.custom_field_labels" \| "search.synonyms" | No | One of: site.identity, cookie_consent, seo.json_ld_graph, seo.llms_description, reviews.custom_field_labels, search.synonyms | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr"). 1-35 characters | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Get language settings **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /site/settings/language` **Get language settings** Returns the site's language settings, with every supported locale flagged `enabled` when the site serves it. With `multiLanguageEnabled`, each enabled locale other than the default is served under its own path prefix, such as `/fr/`. The default locale has no prefix. Required permissions: `sites.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/site/settings/language \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "defaultLocale": "en", "multiLanguageEnabled": true, "enabledLocales": [ "en", "fr", "es" ], "availableLocales": [ { "code": "en", "label": "English", "flag": "🇬🇧", "direction": "ltr", "enabled": true }, { "code": "fr", "label": "Français", "flag": "🇫🇷", "direction": "ltr", "enabled": true }, { "code": "es", "label": "Español", "flag": "🇪🇸", "direction": "ltr", "enabled": true }, { "code": "de", "label": "Deutsch", "flag": "🇩🇪", "direction": "ltr", "enabled": false } ] } } ``` --- --- # Close a support ticket **Published**: 2026-11-30 **Category**: Admin API ## `POST /support/tickets/:id/close` **Close a support ticket** Closes a ticket of the token's organization and site and adds a system message to its conversation. A closed ticket accepts no further message or attachment. A token without `support.view` receives an acknowledgement (`id`, `status`, `createdAt`, `updatedAt`) instead of the ticket. An unknown ticket answers 404. Required permissions: `support.create` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | The ticket is already closed (code `SUPPORT_TICKET_CLOSED`), or the API token does not resolve to an organization and one of its sites (code `SUPPORT_TOKEN_IDENTITY_INVALID`). | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Get a webhook **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /webhooks/:id` **Get a webhook** Returns one webhook with its ten most recent delivery logs. The `secret` is masked, custom header values read `[REDACTED]`, and `url` is reduced to its origin. Logs omit the event payload and the destination's response body. An unknown `id` returns 404. Required permissions: `webhooks.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Remove a customer-group member **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /customer-groups/:id/members/:customerId` **Remove a customer-group member** Removes a customer from a group. Returns 204 even when the customer was not a member. Returns 404 for an unknown group or customer, and when customer groups are turned off for the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer group identifier (cgrp_ prefixed id) | | `customerId` | path | string | Yes | Customer identifier (cust_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Add a support ticket message **Published**: 2026-11-30 **Category**: Admin API ## `POST /support/tickets/:id/messages` **Add a support ticket message** Adds a customer reply to a ticket of the token's organization and site. Send `content` (1 to 10000 characters). The ticket moves to `pending`, and a resolved ticket is reopened. A closed ticket answers 400, an unknown ticket 404 and an invalid body 422. Required permissions: `support.create` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `content` | string | Yes | Required. Text content. 1-10000 characters | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | The ticket is closed (code `SUPPORT_TICKET_CLOSED`), or the API token does not resolve to an organization and one of its sites (code `SUPPORT_TOKEN_IDENTITY_INVALID`). | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List support organizations **Published**: 2026-11-30 **Category**: Admin API ## `GET /support/organizations` **List support organizations** Returns the organization and site the token belongs to, the only scope its tickets can use. Answers 400 when the token resolves to no organization and site. Required permissions: `support.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | The API token does not resolve to an organization and one of its sites (code `SUPPORT_TOKEN_IDENTITY_INVALID`). | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | --- --- # Delete a webhook **Published**: 2026-11-30 **Category**: Settings & Config ## `DELETE /webhooks/:id` **Delete a webhook** Deletes the webhook and its delivery logs. An unknown `id` returns 404. Required permissions: `webhooks.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Create a support ticket **Published**: 2026-11-30 **Category**: Admin API ## `POST /support/tickets` **Create a support ticket** Opens a support ticket for the token's organization and site. Send `category` (`billing`, `technical`, `feature_request`, `bug` or `other`), `subject` (5 to 255 characters) and `description` (10 to 10000 characters). The organization and site come from the token, so do not send them. The ticket opens as `open` with `normal` priority. Errors: 400 when the token resolves to no organization and site, 422 for an invalid body. Required permissions: `support.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `category` | "billing" \| "technical" \| "feature_request" \| "bug" \| "other" | Yes | Required. One of: billing, technical, feature_request, bug, other | | `subject` | string | Yes | Required. 5-255 characters | | `description` | string | Yes | Required. Description text. 10-10000 characters | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | The API token does not resolve to an organization and one of its sites (code `SUPPORT_TOKEN_IDENTITY_INVALID`). | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Update a webhook **Published**: 2026-11-30 **Category**: Settings & Config ## `PUT /webhooks/:id` **Update a webhook** Updates the fields sent and keeps the others. `headers: null` or `{}` removes the custom headers. Sending back what a read returned keeps the stored value: the masked `secret`, a `url` equal to the stored origin, and a `[REDACTED]` header value. Stored header values never follow a new destination. When `url` changes on a webhook with custom headers, send `headers` again, or `null`, or the request returns 422. A `[REDACTED]` value also returns 422 with a new `url`, or when no single stored header matches its name. An event added to `events` needs its view permission, as on create. So does every event of the webhook when `url` changes or a disabled webhook is enabled. A missing one returns 403. Enabling a disabled webhook can return the 402 errors of create. A caller without `webhooks.view` receives an acknowledgement. Required permissions: `webhooks.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Webhook display name | | `url` | string | No | HTTP or HTTPS destination whose host resolves to a public address. Localhost, internal addresses, credentials in the URL and ports 22, 23, 25, 3306, 5432, 6379, 27017 and 11211 return 422 | | `events` | "content.created" \| "content.updated" \| "content.deleted" \| "content.published" \| "content.unpublished" \| "content.scheduled" \| "content.archived" \| "content.translated" \| "content.bulk_published" \| "content.bulk_archived" \| "content.bulk_deleted" \| "form.created" \| "form.updated" \| "form.deleted" \| "form.submitted" \| "form.translated" \| "review.created" \| "review.updated" \| "review.deleted" \| "review.bulk_updated" \| "review.bulk_deleted" \| "review.translated" \| "media.uploaded" \| "media.updated" \| "media.replaced" \| "media.trashed" \| "media.restored" \| "media.deleted" \| "category.created" \| "category.updated" \| "category.deleted" \| "category.translated" \| "tag.created" \| "tag.updated" \| "tag.deleted" \| "tag.translated" \| "redirect.created" \| "redirect.updated" \| "redirect.deleted" \| "redirect.bulk_deleted" \| "sitemap_entry.created" \| "sitemap_entry.updated" \| "sitemap_entry.deleted" \| "sitemap_rule.created" \| "sitemap_rule.updated" \| "sitemap_rule.deleted" \| "site_block.created" \| "site_block.updated" \| "site_block.schema_updated" \| "site_block.published" \| "site_block.unpublished" \| "site_block.deleted" \| "site_block.translation_created" \| "variable.created" \| "variable.updated" \| "variable.deleted" \| "variable.translated" \| "site.updated" \| "seo.updated" \| "product.created" \| "product.updated" \| "product.published" \| "product.archived" \| "product.deleted" \| "product.translated" \| "product_option.created" \| "product_option.updated" \| "product_option.deleted" \| "product_variant.created" \| "product_variant.updated" \| "product_variant.deleted" \| "product_collection.created" \| "product_collection.updated" \| "product_collection.deleted" \| "product_collection.translated" \| "product_category.created" \| "product_category.updated" \| "product_category.deleted" \| "product_category.moved" \| "product_category.translated" \| "reservation.booked" \| "reservation.cancelled" \| "reservation.rescheduled" \| "reservation_offering.translated" \| "reservation_calendar.translated" \| "order.placed" \| "order.paid" \| "order.cancelled" \| "payment.captured" \| "payment.refund_pending" \| "shipment.created" \| "shipment.in_transit" \| "shipment.out_for_delivery" \| "shipment.ready_for_pickup" \| "shipment.delivered" \| "shipment.failed" \| "shipment.cancelled" \| "webhook.test"[] | No | One or more event names that trigger delivery | | `headers` | object | No | Headers added to each delivery, values write-only. Reserved names such as `Authorization` and `X-Webhook-Signature` are dropped. 422 for two spellings of one name, a non-token name, or a value with an ASCII control other than tab or a character above U+00FF | | `secret` | string | No | HMAC signing secret of 32 to 255 characters, returned in full only by the create response. Omit it to deliver unsigned on create, or to keep the stored secret on update | | `isEnabled` | boolean | No | Filter by enabled state on lists, or enable/disable delivery on writes | | `groupBursts` | boolean | No | Deliver the 11th and later events of one type within 60 seconds as one `.batch` delivery. Defaults to true on create | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan lacks this feature, its quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List webhooks **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /webhooks` **List webhooks** Returns the site's webhooks, newest first, paginated and filterable by `isEnabled`. Each `secret` is masked, custom header values read `[REDACTED]`, and `url` is reduced to its origin (scheme, host and port), because a webhook path can itself be a credential. Required permissions: `webhooks.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Items per page; maximum 100 and default 20 on `/v1` | | `isEnabled` | query | boolean | No | Filter by enabled state on lists, or enable/disable delivery on writes | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Add customer-group members **Published**: 2026-11-30 **Category**: Commerce ## `POST /customer-groups/:id/members` **Add customer-group members** Adds customers to a group. A customer already in the group is skipped. One unknown customer in `customerIds` rejects the whole request with 422, and no customer is added. A caller that also holds `customers.view` receives the full group with its new member count. Any other caller receives an acknowledgement with `id` and `updatedAt` only. Returns 404 for an unknown group, and when customer groups are turned off for the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer group identifier (cgrp_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `customerIds` | string[] | Yes | Required. Identifiers (cust_ prefixed id) of the site's customers to add, 1 to 500 | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Delete a customer group **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /customer-groups/:id` **Delete a customer group** Deletes a customer group. Its name can then be given to a new group. Returns 404 for an unknown group, and when customer groups are turned off for the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer group identifier (cgrp_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Update a customer group **Published**: 2026-11-30 **Category**: Commerce ## `PATCH /customer-groups/:id` **Update a customer group** Renames a customer group or replaces its `metadata`. A caller that also holds `customers.view` receives the full group. Any other caller receives an acknowledgement with `id` and `updatedAt` only. Errors: 422 on `name` when another group of the site has that name, and 404 for an unknown group, or when customer groups are turned off for the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer group identifier (cgrp_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-120 characters | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Create a customer group **Published**: 2026-11-30 **Category**: Commerce ## `POST /customer-groups` **Create a customer group** Creates a customer group. A caller that also holds `customers.view` receives the full group. Any other caller receives an acknowledgement with `id`, `createdAt` and `updatedAt` only. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the site has reached its plan's group limit, 422 on `name` when another group of the site has that name, and 404 when customer groups are turned off for the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Required. Display name. 1-120 characters | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Test a webhook **Published**: 2026-11-30 **Category**: Settings & Config ## `POST /webhooks/:id/test` **Test a webhook** Sends one `webhook.test` event to the webhook now, signed and shaped like a real delivery, and returns the logged result. Its `data` holds `message`, `site_id` and `webhook_id`. The webhook does not need to subscribe to `webhook.test`, and a failed test is not retried. A completed attempt returns 200 even when `data.success` is false. Errors: 400 for a disabled webhook, 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the plan has no webhooks. Required permissions: `webhooks.test` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | The webhook is disabled and cannot be tested. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # List a product category's translations **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-categories/:id/translations` **List a product category's translations** Returns the translation status of the category in every language enabled on the site except its source language, missing translations included. `needs_review` means the base text changed after the translation was written. An unknown category returns 404. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_categories.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product category identifier (pcat_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Get a product category **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-categories/:id` **Get a product category** Returns one product category of the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_categories.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product category identifier (pcat_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Move a product category **Published**: 2026-11-30 **Category**: Commerce ## `POST /product-categories/:id/move` **Move a product category** Moves the category, with its descendants, under `parentCategoryId`, or to the root when it is null. Moving a category under itself or one of its descendants returns 400 on `parentCategoryId`, and an unknown parent returns 404. A category URL does not include its parent, so a move keeps it. While products nest under their category, a move that hides or shows the subtree moves the URLs of its published products, each with a 301 redirect counted in the response. Fires `product_category.moved` when the category actually moved. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_categories.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product category identifier (pcat_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `parentCategoryId` | string \| null | Yes | Required. Parent product category identifier (pcat_ prefixed id) | | `position` | integer (min 0) | No | Display position among sibling resources | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Create a market **Published**: 2026-11-30 **Category**: Commerce ## `POST /commerce/markets` **Create a market** Creates a market from a `name`, the `locales` it offers and a `defaultLocale` among them, with optional `countries` and `status` (`draft` when omitted). Each locale must be enabled on the site. Each country must be a European Union member state that no other market of the site holds. The currency is always the site currency. A caller that also holds `sites.view` receives the market. Any other caller receives an acknowledgement carrying only `id`, `createdAt` and `updatedAt`. A refused field returns 422 with that field named. A site at its plan's market limit gets 402 `SUBSCRIPTION_QUOTA_EXCEEDED`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.update` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Required. Display name. 1-120 characters | | `status` | "active" \| "draft" | No | One of: active, draft | | `countries` | string[] | No | ISO 3166-1 alpha-2 codes of the European Union countries the market serves, each held by no other market of the site | | `locales` | string[] | Yes | Language codes the market offers, each enabled on the site | | `defaultLocale` | string | Yes | The market's default language, one of its locales | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Markets are not available on this site. | | `422` | A field is refused: a country outside the European Union or already held by another market of the site, a locale not enabled on the site, or a `defaultLocale` outside `locales`. The error names the field. | --- --- # Get a cart **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/carts/:id` **Get a cart** Returns one cart with its lines, at the prices of the cart's last storefront read or change: this read never re-prices them. Amounts not named net include VAT, and the line subtotals add up to `subtotalCents`. Shipping and VAT use the current settings, so a checked-out cart can differ from its order, which records what was charged. Returns 404 for an unknown cart. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `carts.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Cart identifier (cart_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # List product collections **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-collections` **List product collections** Lists the site's product collections, 20 per page by default and at most 100. Filter by `id` or match `search` against the title and slug. A caller holding `products.view` or `products.update` without `product_collections.view` receives only each collection's `id` and `title`. > **Note:** Available only on sites with e-commerce enabled. Required permissions (any one of): `product_collections.view`, `products.view`, `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | query | string | No | Filter by product collection identifier (col_ prefixed id) | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "title" \| "slug" \| "created_at" \| "updated_at" | No | One of: title, slug, created_at, updated_at | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Send a customer password-reset link **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/:id/send-reset-link` **Send a customer password-reset link** Emails the customer a single-use password reset link, the one the storefront sends when a buyer asks for it. The email is in the customer's preferred language, else the site's default language. Requires both `customers.manage` and `customers.view`. Errors: 422 for a customer without an account, 409 `CUSTOMER_EMAIL_RECENTLY_CHANGED` within 72 hours of an email change, 429 `RATE_LIMIT_EXCEEDED` when a link was sent recently, 503 when the email could not be delivered, and 404 for an unknown customer. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage`, `customers.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer identifier (cust_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | No content | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | `CUSTOMER_EMAIL_RECENTLY_CHANGED`: the customer's email changed less than 72 hours ago, so no link is sent. | | `422` | Validation error | | `429` | A reset link was sent recently; retry after the cooldown. | | `503` | The reset email could not be delivered. | --- --- # Delete a shipping option translation **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /commerce/markets/:marketId/shipping-options/:id/translations/:locale` **Delete a shipping option translation** Deletes a shipping option's label in one language and answers 204. Deleting a language with no translation also answers 204 and changes nothing. Returns 404 when the market does not exist or the option is not one of its options, 422 on `locale` when the language is not enabled on the site or is the site's default language, and 422 naming the field a value is refused on. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `marketId` | path | string | Yes | Market identifier (mkt_ prefixed id) | | `id` | path | string | Yes | Shipping option identifier (shp_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Get a payment **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/payments/:id` **Get a payment** Returns one payment with the identifier of the booking or order it pays for. Returns 404 for an unknown or malformed payment identifier. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `payments.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Payment identifier (pay_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # List carts **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/carts` **List carts** Lists the site's carts, newest first, each with its line count. Checked-out carts are included. Filter by `hasCustomer` (carts with or without a customer account) and a creation-date range. Amounts are the totals saved at the cart's last change. Get a cart computes them again from its lines, so the two can differ. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `carts.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `hasCustomer` | query | boolean | No | Filter carts by ownership: true for customer carts, false for guest carts | | `dateFrom` | query | string | No | Include rows created on or after this calendar day (YYYY-MM-DD) | | `dateTo` | query | string | No | Include rows created through this calendar day (YYYY-MM-DD) | | `sortBy` | query | "created_at" | No | One of: created_at | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # List a shipping option's translations **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/markets/:marketId/shipping-options/:id/translations` **List a shipping option's translations** Lists the translations of a shipping option's `label` in every language enabled on the site other than its default language, missing translations included. A shipping option has no source language of its own: `data.sourceLocale` is the site's default language, the language of its `name`. `data.translations` holds one entry per other language, each carrying `locale`, `status` (`translated`, `needs_review` when the option's `name` changed after the translation was written, or `missing`), `label` (null when missing) and `updatedAt`. Returns 404 when the market does not exist or the option is not one of its options. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `marketId` | path | string | Yes | Market identifier (mkt_ prefixed id) | | `id` | path | string | Yes | Shipping option identifier (shp_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Export customers **Published**: 2026-11-30 **Category**: Commerce ## `GET /customers/export` **Export customers** Exports every customer, or the members of `group`, as a UTF-8 CSV file, newest first. The `groups` column lists the customer's group names, comma-separated. Each export is recorded in the site's audit log. Requires both `customers.manage` and `customers.view`. Returns 404 for an unknown `group`, or for any `group` while customer groups are turned off. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage`, `customers.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `group` | query | string | No | Filter by customer group identifier (cgrp_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Response Example ``` id,email,name,phone,has_account,created_at,groups cust_7wnrrkmx3977q33f59esw6vw80,jane@example.com,Jane Doe,0612345678,true,2026-01-15T09:30:00.000+00:00,"Newsletter,VIP" ``` --- --- # Update a shipping option **Published**: 2026-11-30 **Category**: Commerce ## `PUT /commerce/markets/:marketId/shipping-options/:id` **Update a shipping option** Updates a shipping option of a market. Send any of `name`, `priceCents`, `status`, `position` and the binding; a field left out keeps its value. `carrier` and `carrierServiceCode` travel together: send both to bind the option to a service of the site's connected carrier account, or `carrier: null` to unbind it. The server sets `requiresPickupPoint` from the service. A caller that also holds `sites.view` receives the option. Any other caller receives an acknowledgement carrying `id`, the binding fields and `updatedAt`. Errors (422): `SHIPPING_OPTION_CARRIER_SERVICE_INVALID` naming `carrier` or `carrierServiceCode`, `SHIPPING_ORIGIN_REQUIRED`, `CARRIER_CREDENTIALS_INVALID`, or the field a value is refused on. 503 `CARRIER_UNAVAILABLE` when the carrier cannot be reached. An unknown market or option returns 404. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `marketId` | path | string | Yes | Market identifier (mkt_ prefixed id) | | `id` | path | string | Yes | Shipping option identifier (shp_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-120 characters | | `priceCents` | integer (0 to 99999999) | No | Price in the smallest currency unit (cents) | | `status` | "active" \| "inactive" | No | One of: active, inactive | | `position` | integer (0 to 1000000) | No | Display position among sibling resources | | `carrier` | string \| null | No | Code of a carrier the site has a connected account for, sent with carrierServiceCode; null unbinds the option | | `carrierServiceCode` | string \| null | No | Code of a service the connected carrier account offers, required with carrier; null or omitted when unbinding | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | The market or the shipping option does not exist, or shipping options are not available on this site. | | `422` | An identifier is malformed, or a field is refused, such as a negative or decimal `priceCents` or a carrier service the connected carrier account does not offer. The error names the field. | | `503` | The carrier could not be reached to check the service (`CARRIER_UNAVAILABLE`). Nothing is saved. | --- --- # List a product's booking offerings **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:productId/booking-offerings` **List a product's booking offerings** Lists the product's live offerings in the merchant's order, to choose one before booking. A product without reservations returns an empty list. Returns 404 for an unknown product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `productId` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Create a reservation calendar **Published**: 2026-11-30 **Category**: Commerce ## `POST /reservation-calendars` **Create a reservation calendar** Creates a shared calendar that products can attach to. Set its weekly rules with the update route and its exceptions with the `/exceptions` routes. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the plan's calendar limit is reached. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Required. Display name. 1-255 characters | | `capacity` | integer (1 to 100000) | Yes | Required. Concurrent guest capacity for the reservation calendar | | `timezone` | string | Yes | Required. Timezone name (IANA, e.g. Europe/Paris) | | `slotDurationMin` | integer (1 to 1440) | Yes | Required. Reservation slot duration in minutes | | `bufferBeforeMin` | integer (0 to 1440) | Yes | Required. Blocked buffer time before each reservation, in minutes | | `bufferAfterMin` | integer (0 to 1440) | Yes | Required. Blocked buffer time after each reservation, in minutes | | `minNoticeMin` | integer (0 to 525600) | Yes | Required. Minimum advance notice required before a reservation, in minutes | | `maxAdvanceDays` | integer (1 to 3650) | Yes | Required. Maximum number of days in advance that can be reserved | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Shared calendars are not available on this site. | | `422` | Validation error | --- --- # Update a product variant **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id/variants/:variantId` **Update a product variant** Updates the fields sent; `optionValueIds` replaces the variant's combination, and null clears `gtin`, `mpn` or `weightGrams`. `compareAtPriceCents` must exceed the resulting price. Fires `product_variant.updated` when something changed. A caller without `products.view` receives an acknowledgement instead of the variant. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `variantId` | path | string | Yes | Product variant identifier (var_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `title` | string | No | Display title. 1-255 characters | | `sku` | string \| null | No | Stock keeping unit, unique per site; an empty string stores none | | `gtin` | string \| null | No | Global Trade Item Number: 8, 12, 13 or 14 digits with a valid check digit | | `mpn` | string \| null | No | Manufacturer Part Number | | `priceCents` | integer (0 to 99999999) | No | Price in the smallest currency unit (cents) | | `compareAtPriceCents` | integer (0 to 99999999) \| null | No | Reference price in cents, such as the price before a discount; must exceed the price, null removes it | | `stockQuantity` | integer (0 to 2000000000) \| null | No | Units in stock; null means stock is not tracked | | `weightGrams` | integer (1 to 1000000) \| null | No | Shipping weight in whole grams, read when a shipping label is created; null clears it. A variant's weight overrides the product's | | `position` | integer (0 to 1000000) | No | Display position among sibling resources | | `metadata` | object | No | Custom key-value metadata | | `optionValueIds` | string[] | No | Option value UUIDs of the variant, exactly one per product option | | `images` | string[] | No | Ordered variant image URLs selected from the parent product gallery | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List offering translations **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:id/reservation-offerings/:offeringId/translations` **List offering translations** Returns the offering's label in every language enabled on the site except the source language, which is the product's. A language with no translation is listed as `missing`. `needs_review` means the base label changed after the translation was written. Returns 404 for an unknown product, or an offering that is archived or belongs to another product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `offeringId` | path | string | Yes | Reservation offering identifier (roff_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Update a product category **Published**: 2026-11-30 **Category**: Commerce ## `PUT /product-categories/:id` **Update a product category** Updates the fields sent and keeps the others; null clears an optional field. Change the parent with `POST /product-categories/{id}/move`. A new `slug` another category already holds, in any language, returns 409 on `slug`. A new `slug` on a visible category creates a 301 redirect from its previous URL. While products nest under their category, a new `slug`, `isActive` or `isInternal` also moves the URLs of its published products, each with a redirect, counted in `redirectsCreated` and `redirectsSkipped`. A category that becomes visible deletes the automatic redirects from its URL and from a descendant that becomes visible with it; hand-written ones stay. An `imageUrl` that replaces or removes the image, sent without `imageAlt`, clears the stored `imageAlt`; `ogImageUrl` without `ogImageAlt` does the same to `ogImageAlt`. Fires `product_category.updated`. A `jsonLdGraph` or `jsonLdExclusions` entry the stored list lacks returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks advanced JSON-LD. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_categories.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product category identifier (pcat_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-255 characters | | `slug` | string | No | Source-language slug of the product category. Unique per site among the other product categories' base slugs and their translated slugs in every language. Omit it to keep the current slug (a name change never re-slugs). A new slug already taken is a 409 on slug and nothing is written. Translated slugs are set with PUT /product-categories/{id}/translations/{locale} | | `description` | string \| null | No | Description text | | `imageUrl` | string \| null | No | URL of a media file of the site, used as the image | | `imageAlt` | string \| null | No | Alternative text of the resource image, for accessibility and search engines | | `isActive` | boolean | No | Whether the product category is active | | `isInternal` | boolean | No | Whether the product category is hidden from storefront navigation | | `position` | integer (min 0) | No | Display position among sibling resources | | `seoTitle` | string \| null | No | Search-engine title override | | `seoDescription` | string \| null | No | Search-engine description override | | `keywords` | string \| null | No | Comma-separated SEO keywords | | `canonicalUrl` | string \| null | No | Canonical URL override | | `ogTitle` | string \| null | No | Open Graph title used when the page is shared on social networks | | `ogDescription` | string \| null | No | Open Graph description used when the page is shared on social networks | | `ogImageUrl` | string \| null | No | Open Graph image URL; must be a media file of the current site's media library, or null to remove the image | | `ogImageAlt` | string \| null | No | Alternative text of the Open Graph image | | `twitterCard` | "summary" \| "summary_large_image" \| "app" \| "player" \| null | No | Card type used when the page is shared on social networks (summary, summary_large_image, app or player) | | `noIndex` | boolean | No | When true, asks search engines not to index the page (robots noindex) | | `noFollow` | boolean | No | When true, asks search engines not to follow the links of the page (robots nofollow) | | `sitemapPriority` | number (0 to 1) \| null | No | Sitemap priority (0.0-1.0) | | `sitemapChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" \| null | No | Sitemap change frequency (always, hourly, daily, weekly, monthly, yearly or never) | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Get a customer **Published**: 2026-11-30 **Category**: Commerce ## `GET /customers/:id` **Get a customer** Returns a customer with their bookings, most recent first, their marketing consent per channel and the groups they belong to. `groups` is empty when customer groups are turned off for the site. Returns 404 for an unknown customer. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer identifier (cust_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # List shipping options **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/markets/:marketId/shipping-options` **List shipping options** Lists the shipping options of a market, by `position` and then oldest first. Every country of the market is offered the same options. Returns 404 when the market does not exist. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `marketId` | path | string | Yes | Market identifier (mkt_ prefixed id) | | `page` | query | integer (min 1, default 1) | No | Page number. | | `limit` | query | integer (1 to 100, default 20) | No | Shipping options per page. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | The market does not exist, or shipping options are not available on this site. | | `422` | The market identifier or a query parameter is invalid. | --- --- # Update a market **Published**: 2026-11-30 **Category**: Commerce ## `PUT /commerce/markets/:id` **Update a market** Updates a market of the site. Send any of `name`, `status`, `countries`, `locales` and `defaultLocale`: `countries` and `locales` replace the whole list. The result must still hold a `defaultLocale` among its `locales`, and the same country and locale rules as on creation apply. A caller that also holds `sites.view` receives the market. Any other caller receives an acknowledgement carrying only `id` and `updatedAt`. A refused field returns 422 with that field named. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Market identifier (mkt_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-120 characters | | `status` | "active" \| "draft" | No | One of: active, draft | | `countries` | string[] | No | ISO 3166-1 alpha-2 codes of the European Union countries the market serves, each held by no other market of the site. Replaces the stored list | | `locales` | string[] | No | Language codes the market offers, each enabled on the site. Replaces the stored list | | `defaultLocale` | string | No | The market's default language, one of its locales | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | The market does not exist, or markets are not available on this site. | | `422` | The market identifier is malformed, or a field is refused: a country outside the European Union or already held by another market of the site, a locale not enabled on the site, or a `defaultLocale` outside `locales`. The error names the field. | --- --- # Get an order **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/orders/:id` **Get an order** Returns one order with its items and its shipments, oldest first. Each item keeps the title, options and price it had when the order was placed, plus the buyer-language title when it differed. A shipment names the items it carries by their `id`. Returns 404 for an unknown order. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `orders.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Order identifier (ord_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Restore an archived reservation offering **Published**: 2026-11-30 **Category**: Commerce ## `POST /products/:id/reservation-offerings/:offeringId/restore` **Restore an archived reservation offering** Brings an archived offering back to the live list, after every other offering, and returns it. No body is read and no other field changes. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the plan's offering limit is reached, 422 for a product that is not bookable or when no position is left. Returns 404 for an unknown product, or an offering that is live or belongs to another product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `offeringId` | path | string | Yes | Reservation offering identifier (roff_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | The product does not exist, or the offering is not archived under this product. | | `422` | The product is no longer bookable, or no offering position is left. | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/products/prod_01j9zq7m4k2x8v3n6p5r0t1w2w/reservation-offerings/roff_01j9zq8a7b6c5d4e3f2g1h0j9g/restore \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Create a shipping option **Published**: 2026-11-30 **Category**: Commerce ## `POST /commerce/markets/:marketId/shipping-options` **Create a shipping option** Creates a shipping option in a market from a `name` and a `priceCents`, with an optional `status` (`active` when omitted) and `position` (0 when omitted). To bind it to a carrier service, send `carrier` with a `carrierServiceCode` offered by the site's connected carrier account. The server sets `requiresPickupPoint` from that service. A caller that also holds `sites.view` receives the option. Any other caller receives an acknowledgement carrying `id`, the binding fields, `createdAt` and `updatedAt`. Errors (422): `SHIPPING_OPTION_CARRIER_SERVICE_INVALID` naming `carrier` or `carrierServiceCode`, `SHIPPING_ORIGIN_REQUIRED`, `CARRIER_CREDENTIALS_INVALID`, or the field a value is refused on. 503 `CARRIER_UNAVAILABLE` when the carrier cannot be reached. 402 `SUBSCRIPTION_QUOTA_EXCEEDED` at the plan's shipping option limit. An unknown market returns 404. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `marketId` | path | string | Yes | Market identifier (mkt_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Required. Display name. 1-120 characters | | `priceCents` | integer (0 to 99999999) | Yes | Required. Price in the smallest currency unit (cents) | | `status` | "active" \| "inactive" | No | One of: active, inactive | | `position` | integer (0 to 1000000) | No | Display position among sibling resources | | `carrier` | string \| null | No | Code of a carrier the site has a connected account for, sent with carrierServiceCode; null unbinds the option | | `carrierServiceCode` | string \| null | No | Code of a service the connected carrier account offers, required with carrier; null or omitted when unbinding | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | The market does not exist, or shipping options are not available on this site. | | `422` | The market identifier is malformed, or a field is refused, such as a negative or decimal `priceCents` or a carrier service the connected carrier account does not offer. The error names the field. | | `503` | The carrier could not be reached to check the service (`CARRIER_UNAVAILABLE`). Nothing is saved. | --- --- # Get a booking **Published**: 2026-11-30 **Category**: Commerce ## `GET /bookings/:id` **Get a booking** Returns one booking with its calendar's name and timezone, to show its local time. `resolvedProductId` names the product the booking is for: the offering's product, else the only live product on the booking's calendar. When no single product qualifies, it is null and `productCandidateCount` says how many products share the calendar. Returns 404 for an unknown booking. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Booking identifier (bkg_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # List slot availability for a bookable product **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:productId/availability` **List slot availability for a bookable product** Lists the bookable slots of a product between `from` and `to`, both required dates. A range wider than the booking window, or than 62 days, is shortened rather than refused: `meta` returns the window used, the timezone and the slot length. `offeringId` applies that offering's duration and buffers. When the product books from several calendars, a slot is listed while any of them has room and `remaining` adds them up. `seatsRemaining` is the largest party one booking can take. `resourceId` narrows the grid to one of those calendars. Errors (422): `NOT_BOOKABLE`, `OFFERING_NOT_FOUND`, `RESOURCE_NOT_IN_POOL`, and 422 when `to` is before `from`. Returns 404 for an unknown product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `productId` | path | string | Yes | Product identifier (prod_ prefixed id) | | `from` | query | string | Yes | First calendar-local day to compute (YYYY-MM-DD) | | `to` | query | string | Yes | Last requested calendar-local day (YYYY-MM-DD); an over-wide span is clamped | | `offeringId` | query | string | No | Reservation offering identifier (roff_ prefixed id) | | `resourceId` | query | string | No | Narrow the grid to one calendar of the product pool (bres_ prefixed id); omit it for the pool-wide union | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Configure a product reservation **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id/reservation` **Configure a product reservation** Creates or updates the product's reservation configuration and returns the same body as the read. The first call creates the product's own calendar. The `product*` fields override the calendar's slot length, buffers and booking window for this product only. When the product uses a shared calendar, its calendar fields are edited with the `/reservation-calendars/{id}` routes. A changed calendar value, or any `weeklyRules`, sent here returns 422 `SHARED_CALENDAR_READ_ONLY` and nothing is written. An unchanged value is accepted. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the plan's calendar limit is reached, 422 for a product that is not bookable. Returns 404 for an unknown product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-255 characters | | `capacity` | integer (1 to 100000) | Yes | Required. Concurrent guest capacity for the reservation calendar | | `timezone` | string | Yes | Required. Timezone name (IANA, e.g. Europe/Paris) | | `slotDurationMin` | integer (1 to 1440) | Yes | Required. Reservation slot duration in minutes | | `bufferBeforeMin` | integer (0 to 1440) | Yes | Required. Blocked buffer time before each reservation, in minutes | | `bufferAfterMin` | integer (0 to 1440) | Yes | Required. Blocked buffer time after each reservation, in minutes | | `minNoticeMin` | integer (0 to 525600) | Yes | Required. Minimum advance notice required before a reservation, in minutes | | `maxAdvanceDays` | integer (1 to 3650) | Yes | Required. Maximum number of days in advance that can be reserved | | `resourceSelectionMode` | "auto" \| "customer_optional" | No | Resource selection policy: `auto` assigns a calendar; `customer_optional` permits a choice. One of: auto, customer_optional | | `productSlotDurationMin` | integer (1 to 1440) \| null | No | Product-level slot-duration override in minutes; null inherits the calendar default | | `productBufferBeforeMin` | integer (0 to 1440) \| null | No | Product-level pre-buffer override in minutes; null inherits the calendar default | | `productBufferAfterMin` | integer (0 to 1440) \| null | No | Product-level post-buffer override in minutes; null inherits the calendar default | | `productMinNoticeMin` | integer (0 to 525600) \| null | No | Minimum notice in minutes before a slot can be booked; it replaces the calendar's only when per-product booking windows are enabled for the site, and `null` keeps the calendar's | | `productMaxAdvanceDays` | integer (1 to 3650) \| null | No | How many days ahead a slot can be booked; it replaces the calendar's limit only when per-product booking windows are enabled for the site, and `null` keeps the calendar's | | `weeklyRules` | object[] | No | Replacement weekly availability schedule; omit it to leave the stored schedule unchanged | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Create a product collection **Published**: 2026-11-30 **Category**: Commerce ## `POST /product-collections` **Create a product collection** Creates a product collection. Without `slug`, the slug is derived from the title and suffixed `-2`, `-3` when taken. An explicit `slug` another collection already holds, in any language, returns 409 on `slug`. `imageUrl` and `ogImageUrl` take URLs of media files of the site. Fires the `product_collection.created` webhook. A site at its plan's product collection limit gets 402 `SUBSCRIPTION_QUOTA_EXCEEDED`. A non-empty `jsonLdGraph` or `jsonLdExclusions` returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks advanced JSON-LD. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_collections.manage` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `title` | string | Yes | Required. Display title. 1-255 characters | | `slug` | string | No | Source-language slug of the collection (its text is written in the site default language). Unique per site among the other collections' base slugs and their translated slugs in every language. Derived from the title when omitted, and suffixed -2, -3, ... when that derived slug is taken. A slug sent explicitly and already taken is a 409 on slug and nothing is written. Translated slugs are set with PUT /product-collections/{id}/translations/{locale} | | `description` | string \| null | No | Description text | | `imageUrl` | string \| null | No | URL of a media file of the site, used as the image | | `imageAlt` | string \| null | No | Alternative text of the resource image, for accessibility and search engines | | `seoTitle` | string \| null | No | Search-engine title override | | `seoDescription` | string \| null | No | Search-engine description override | | `keywords` | string \| null | No | Comma-separated SEO keywords | | `canonicalUrl` | string \| null | No | Canonical URL override | | `ogTitle` | string \| null | No | Open Graph title used when the page is shared on social networks | | `ogDescription` | string \| null | No | Open Graph description used when the page is shared on social networks | | `ogImageUrl` | string \| null | No | Open Graph image URL; must be a media file of the current site's media library, or null to remove the image | | `ogImageAlt` | string \| null | No | Alternative text of the Open Graph image | | `twitterCard` | "summary" \| "summary_large_image" \| "app" \| "player" \| null | No | Card type used when the page is shared on social networks (summary, summary_large_image, app or player) | | `noIndex` | boolean | No | When true, asks search engines not to index the page (robots noindex) | | `noFollow` | boolean | No | When true, asks search engines not to follow the links of the page (robots nofollow) | | `sitemapPriority` | number (0 to 1) \| null | No | Sitemap priority (0.0-1.0) | | `sitemapChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" \| null | No | Sitemap change frequency (always, hourly, daily, weekly, monthly, yearly or never) | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan lacks this feature, its quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Update an order status **Published**: 2026-11-30 **Category**: Commerce ## `POST /commerce/orders/:id/status` **Update an order status** Applies one merchant action: `paid`, `fulfilled` or `cancelled`. Payment and fulfillment are independent: the order becomes `confirmed` after one of them and `completed` after both. Cancelling is final and returns the stock taken at checkout. Repeating an action already applied returns 200 and changes nothing. A pending card order cannot be marked `paid`: it becomes paid when the payment is captured. Cancelling an order whose card payment was captured fires `payment.refund_pending`: the refund is yours to issue. Fires `order.paid` or `order.cancelled`. A new `paid` also emails the buyer a payment confirmation, once per order. An API-token caller always receives a minimal transition projection: the statuses and timestamps, with no buyer, address, amount or item data. Errors: 422 `INVALID_STATUS_TRANSITION` for a refused action. 404 for an unknown order. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `orders.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Order identifier (ord_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `status` | "paid" \| "fulfilled" \| "cancelled" | Yes | Required. One of: paid, fulfilled, cancelled | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List payments **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/payments` **List payments** Lists the site's payments, newest first. Filter by `bookingId`, `orderId` or `status`. Each payment points to the booking or order it pays for. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `payments.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number starting at 1 (default 1) | | `limit` | query | number (1 to 100) | No | Rows per page (default 20, maximum 100) | | `bookingId` | query | string | No | Filter by booking identifier (bkg_ prefixed id) | | `orderId` | query | string | No | Filter by order identifier (ord_ prefixed id) | | `status` | query | "pending" \| "processing" \| "captured" \| "failed" \| "expired" | No | One of: pending, processing, captured, failed, expired | | `sortBy` | query | "created_at" | No | One of: created_at | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Create a customer address **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/:id/addresses` **Create a customer address** Adds an address to a customer. Setting `isDefaultShipping` or `isDefaultBilling` to `true` moves that default from the customer's other address. A caller that also holds `customers.view` receives the full address. Any other caller receives an acknowledgement with `id`, `isDefaultShipping`, `isDefaultBilling`, `createdAt` and `updatedAt` only. Errors: 422 `CUSTOMER_ADDRESSES_LIMIT_REACHED` when the customer already has 20 addresses, 409 when another address became the default at the same time, and 404 for an unknown or anonymized customer, or when customer addresses are turned off for the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer identifier (cust_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `addressName` | string \| null | No | Label of the address, such as Home or Office | | `firstName` | string | Yes | Required. Given name; on an address, the recipient's. 1-120 characters | | `lastName` | string | Yes | Required. Family name; on an address, the recipient's. 1-120 characters | | `company` | string \| null | No | Company name on the address | | `address1` | string | Yes | Required. 1-255 characters | | `address2` | string \| null | No | Second address line, such as an apartment or suite | | `city` | string | Yes | Required. 1-120 characters | | `postalCode` | string | Yes | Required. 1-32 characters | | `province` | string \| null | No | State, province or region of the address | | `countryCode` | string | Yes | Required. ISO 3166-1 alpha-2 country code | | `phone` | string \| null | No | Phone number, stored as entered: no format is checked | | `isDefaultShipping` | boolean | No | Whether this is the customer's default shipping address. `true` removes that default from their other addresses | | `isDefaultBilling` | boolean | No | Whether this is the customer's default billing address. `true` removes that default from their other addresses | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Restore a default email template **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /commerce/email-templates/:family/:locale` **Restore a default email template** Removes your override for one family and language, so the default copy is sent again. Removing a missing override also returns 204. A buyer in that language then gets the override of its base language when one exists. Returns 404 for an unknown family or when email customization is not available on the site, and 422 for a language the site does not offer. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `commerce_emails.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `family` | path | string | Yes | Buyer email template family: one of commerce.customer_welcome, commerce.order_confirmation, commerce.order_paid, commerce.reservation_confirmation, commerce.reservation_rescheduled, commerce.reservation_cancelled, commerce.order_shipped, commerce.order_out_for_delivery, commerce.order_ready_for_pickup, commerce.order_delivered, commerce.order_collected. Any other value is a 404 | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Create or update a shipping option translation **Published**: 2026-11-30 **Category**: Commerce ## `PUT /commerce/markets/:marketId/shipping-options/:id/translations/:locale` **Create or update a shipping option translation** Sets a shipping option's `label` (at most 120 characters) in one language other than the site's default, and returns that language's `locale`, `status`, `label` and `updatedAt` with 200. `status` becomes `needs_review` when the option's `name` changes later. Returns 404 when the market does not exist or the option is not one of its options, 422 on `locale` when the language is not enabled on the site or is its default, and 422 on `label` when it is missing, blank or too long. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `marketId` | path | string | Yes | Market identifier (mkt_ prefixed id) | | `id` | path | string | Yes | Shipping option identifier (shp_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `label` | string | Yes | Required. The shipping option's label in the language of the path, 1-120 characters | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Summarize site-wide reservations by local day **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/reservations/summary` **Summarize site-wide reservations by local day** Counts the site's bookings per day between `dateFrom` and `dateTo`, both required, each day in the calendar's own timezone. Accepts the same `status` and `calendarId` filters as the list. Days with no booking are left out. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `dateFrom` | query | string | Yes | Include entries on or after this calendar-local day (YYYY-MM-DD) | | `dateTo` | query | string | Yes | Include entries through this calendar-local day (YYYY-MM-DD) | | `status` | query | "pending" \| "confirmed" \| "cancelled" \| "completed" \| "no_show" | No | One of: pending, confirmed, cancelled, completed, no_show | | `calendarId` | query | string | No | Reservation calendar identifier (bres_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Bookings are not available on this site. | | `422` | Validation error | --- --- # Delete a market **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /commerce/markets/:id` **Delete a market** Deletes a market of the site with its countries. Products hidden in that market stop referring to it. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Market identifier (mkt_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | The market does not exist, or markets are not available on this site. | | `422` | The market identifier is malformed. | --- --- # List product reservation exceptions **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:id/reservation/exceptions` **List product reservation exceptions** Lists the date-specific exceptions of the product's calendar, by date. Filter with `dateFrom` and `dateTo`. Returns 404 for an unknown product, or one whose reservations are not configured yet. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List markets **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/markets` **List markets** Lists the markets of the site, oldest first. Filter by `status` to read only the active or the draft markets. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | integer (min 1, default 1) | No | Page number. | | `limit` | query | integer (1 to 100, default 20) | No | Markets per page. | | `status` | query | "active" \| "draft" | No | Return only the markets in this status. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Markets are not available on this site. | | `422` | A query parameter is invalid. | --- --- # List reservation calendar exceptions **Published**: 2026-11-30 **Category**: Commerce ## `GET /reservation-calendars/:id/exceptions` **List reservation calendar exceptions** Lists the calendar's date-specific exceptions, by date. Filter with `dateFrom` and `dateTo`. Returns 404 for an unknown calendar. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Reservation calendar identifier (bres_ prefixed id) | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `dateFrom` | query | string | No | Include entries on or after this calendar-local day (YYYY-MM-DD) | | `dateTo` | query | string | No | Include entries through this calendar-local day (YYYY-MM-DD) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Delete a reservation calendar **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /reservation-calendars/:id` **Delete a reservation calendar** Deletes a calendar that has no attached product and no booking. Detach the products first. A calendar with bookings cannot be deleted. Errors: 422 on `id` when a live product is attached or the calendar has bookings. Returns 404 for an unknown calendar. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Reservation calendar identifier (bres_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | The calendar still has a live product attachment or booking history. | --- --- # Update a reservation calendar **Published**: 2026-11-30 **Category**: Commerce ## `PUT /reservation-calendars/:id` **Update a reservation calendar** Updates the fields sent. `weeklyRules`, when sent, replaces the whole weekly schedule; omit it to keep the schedule. Exceptions have their own routes. Returns 404 for an unknown calendar. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Reservation calendar identifier (bres_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-255 characters | | `capacity` | integer (1 to 100000) | No | Concurrent guest capacity for the reservation calendar | | `timezone` | string | No | Timezone name (IANA, e.g. Europe/Paris) | | `slotDurationMin` | integer (1 to 1440) | No | Reservation slot duration in minutes | | `bufferBeforeMin` | integer (0 to 1440) | No | Blocked buffer time before each reservation, in minutes | | `bufferAfterMin` | integer (0 to 1440) | No | Blocked buffer time after each reservation, in minutes | | `minNoticeMin` | integer (0 to 525600) | No | Minimum advance notice required before a reservation, in minutes | | `maxAdvanceDays` | integer (1 to 3650) | No | Maximum number of days in advance that can be reserved | | `weeklyRules` | object[] | No | Replacement weekly availability schedule; omit it to leave the stored schedule unchanged | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Delete an offering translation **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /products/:id/reservation-offerings/:offeringId/translations/:locale` **Delete an offering translation** Deletes the offering's label in one language. The offering then shows its base label in that language. A language with no translation also returns 204 and fires nothing. Fires the `reservation_offering.translated` webhook with `change: 'deleted'`. Errors (422): a `locale` that is the product's source language or is not enabled on the site. Returns 404 for an unknown product, or an offering that is archived or belongs to another product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `offeringId` | path | string | Yes | Reservation offering identifier (roff_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Update a reservation offering **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id/reservation-offerings/:offeringId` **Update a reservation offering** Updates the fields sent on a live offering, `position` included. Send `null` to clear an override. The minimum party size cannot exceed the maximum. Returns 404 for an unknown product, or an offering that is archived or belongs to another product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `offeringId` | path | string | Yes | Reservation offering identifier (roff_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `label` | string | No | Merchant-visible reservation offering label. 1-255 characters | | `priceCents` | integer (0 to 99999999) | No | Price in the smallest currency unit (cents) | | `slotDurationMin` | integer (1 to 1440) \| null | No | Reservation slot duration in minutes | | `bufferBeforeMin` | integer (0 to 1440) \| null | No | Blocked buffer time before each reservation, in minutes | | `bufferAfterMin` | integer (0 to 1440) \| null | No | Blocked buffer time after each reservation, in minutes | | `minPartySize` | integer (1 to 100000) \| null | No | Minimum party size allowed by the offering, or null when unrestricted | | `maxPartySize` | integer (1 to 100000) \| null | No | Maximum party size allowed by the offering, or null when unrestricted | | `position` | integer (0 to 1000000) | No | Display position among sibling resources | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Archive a reservation offering **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /products/:id/reservation-offerings/:offeringId` **Archive a reservation offering** Archives a live offering: it leaves the live list and stays listed with `archived=true` until restored. It keeps its position. Returns 404 for an unknown product, or an offering that is archived or belongs to another product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `offeringId` | path | string | Yes | Reservation offering identifier (roff_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Upsert an offering translation **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id/reservation-offerings/:offeringId/translations/:locale` **Upsert an offering translation** Creates or replaces the offering's label in one language and returns that language's entry, with 200 in both cases. `label` is required and cannot be blank: delete the translation to remove it. Fires the `reservation_offering.translated` webhook with `change: 'upserted'`. Errors (422): a `locale` that is the product's source language or is not enabled on the site, a missing or blank `label`. Returns 404 for an unknown product, or an offering that is archived or belongs to another product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `offeringId` | path | string | Yes | Reservation offering identifier (roff_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `label` | string \| null | No | Merchant-visible reservation offering label | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Create a reservation offering **Published**: 2026-11-30 **Category**: Commerce ## `POST /products/:id/reservation-offerings` **Create a reservation offering** Creates an offering on a bookable product. Without `position`, it goes after every existing offering, archived ones included. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the plan's offering limit is reached, 422 for a product that is not bookable or when no position is left. Returns 404 for an unknown product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `label` | string | Yes | Required. Merchant-visible reservation offering label. 1-255 characters | | `priceCents` | integer (0 to 99999999) | Yes | Required. Price in the smallest currency unit (cents) | | `slotDurationMin` | integer (1 to 1440) \| null | No | Reservation slot duration in minutes | | `bufferBeforeMin` | integer (0 to 1440) \| null | No | Blocked buffer time before each reservation, in minutes | | `bufferAfterMin` | integer (0 to 1440) \| null | No | Blocked buffer time after each reservation, in minutes | | `minPartySize` | integer (1 to 100000) \| null | No | Minimum party size allowed by the offering, or null when unrestricted | | `maxPartySize` | integer (1 to 100000) \| null | No | Maximum party size allowed by the offering, or null when unrestricted | | `position` | integer (0 to 1000000) | No | Display position among sibling resources | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List reservation offerings **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:id/reservation-offerings` **List reservation offerings** Lists the product's live offerings in the merchant's order. Each one shows the duration and buffers that apply and where they come from. `partySizeFit` says whether at least one of the product's calendars can seat its minimum party: it is advisory and blocks nothing. With `archived=true`, lists the archived offerings instead, most recently archived first. Bring one back with the restore route. Returns 404 for an unknown product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `archived` | query | boolean | No | List the archived offerings instead of the live ones, most recently archived first (default false) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Update a product reservation exception **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id/reservation/exceptions/:exceptionId` **Update a product reservation exception** Updates one exception of the product's calendar. Sending the stored values again returns 200 and changes nothing. When the product uses a shared calendar, edit its exceptions with the `/reservation-calendars/{id}/exceptions` routes: this call returns 422 `SHARED_CALENDAR_READ_ONLY`. Returns 404 for an unknown product or exception. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `exceptionId` | path | string | Yes | Availability exception UUID | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `date` | string | No | Calendar-local date affected by this availability exception (YYYY-MM-DD) | | `isClosed` | boolean | No | Whether this exception closes the calendar for the entire day | | `startTime` | string \| null | No | Local opening time (HH:MM); required with endTime for an open exception and omitted or null for a closed day | | `endTime` | string \| null | No | Local closing time (HH:MM); required with startTime for an open exception and omitted or null for a closed day | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Delete a reservation calendar exception **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /reservation-calendars/:id/exceptions/:exceptionId` **Delete a reservation calendar exception** Deletes one exception of the calendar. Returns 404 for an unknown calendar or exception. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Reservation calendar identifier (bres_ prefixed id) | | `exceptionId` | path | string | Yes | Availability exception UUID | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Create a reservation calendar exception **Published**: 2026-11-30 **Category**: Commerce ## `POST /reservation-calendars/:id/exceptions` **Create a reservation calendar exception** Adds a date-specific exception: a closed day (`isClosed: true`, no times), or opening hours for that date (`isClosed: false` with `startTime` and `endTime`). Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the plan's exception limit is reached. Returns 404 for an unknown calendar. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Reservation calendar identifier (bres_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `date` | string | Yes | Calendar-local date affected by this availability exception (YYYY-MM-DD) | | `isClosed` | boolean | Yes | Required. Whether this exception closes the calendar for the entire day | | `startTime` | string | No | Local opening time (HH:MM); required with endTime for an open exception and omitted or null for a closed day | | `endTime` | string | No | Local closing time (HH:MM); required with startTime for an open exception and omitted or null for a closed day | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Create a product reservation exception **Published**: 2026-11-30 **Category**: Commerce ## `POST /products/:id/reservation/exceptions` **Create a product reservation exception** Adds a date-specific exception to the product's calendar: a closed day (`isClosed: true`, no times), or opening hours for that date (`isClosed: false` with `startTime` and `endTime`). When the product uses a shared calendar, edit its exceptions with the `/reservation-calendars/{id}/exceptions` routes: this call returns 422 `SHARED_CALENDAR_READ_ONLY`. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the plan's exception limit is reached. Returns 404 for an unknown product, or one whose reservations are not configured yet. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `date` | string | Yes | Calendar-local date affected by this availability exception (YYYY-MM-DD) | | `isClosed` | boolean | Yes | Required. Whether this exception closes the calendar for the entire day | | `startTime` | string | No | Local opening time (HH:MM); required with endTime for an open exception and omitted or null for a closed day | | `endTime` | string | No | Local closing time (HH:MM); required with startTime for an open exception and omitted or null for a closed day | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Get a product reservation configuration **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:id/reservation` **Get a product reservation configuration** Returns the product's reservation calendar with its weekly rules and exceptions. `attachedProductCount` says how many products share that calendar. `effective` gives the slot length, buffers and booking window that apply, and whether each comes from the product, the calendar, or `varies` across calendars. `pool`, when present, lists every calendar the product books from. Returns 404 for an unknown product, or one whose reservations are not configured yet. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Create or update a product category translation **Published**: 2026-11-30 **Category**: Commerce ## `PUT /product-categories/:id/translations/:locale` **Create or update a product category translation** Creates or updates the category's translation in one language and returns it, with 200 in both cases. Every field is optional; null clears a field other than `name` and `slug`, so the language falls back to the base text. `name` is required when the translation does not exist yet. Without `slug`, a new translation takes one derived from its name, suffixed `-2`, `-3` when taken, and an update keeps the stored one. An explicit `slug` another category holds in that language returns 409 `RESOURCE_CONFLICT` on `slug`. When the translated slug of a visible category changes, a 301 redirect from its previous URL in that language is created. While products nest under their category, their URLs in that language move too, each with a redirect. The response counts the redirects. Fires `product_category.translated`. The source language, or a language not enabled on the site, returns 422 on `locale`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_categories.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product category identifier (pcat_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-255 characters | | `slug` | string | No | Slug of this translation, used in the URL in that language. It must be free among the other product categories' base slugs and their translated slugs in that same language. When a new translation omits it (or sends it empty), it is derived from the translated label, else from the source slug, and suffixed -2, -3, ... when taken; an update that omits it keeps the stored slug. A slug sent explicitly and already taken is a 409 on slug and nothing is written | | `description` | string \| null | No | Description text | | `imageAlt` | string \| null | No | Alternative text of the resource image, for accessibility and search engines | | `seoTitle` | string \| null | No | Search-engine title override | | `seoDescription` | string \| null | No | Search-engine description override | | `keywords` | string \| null | No | Comma-separated SEO keywords | | `canonicalUrl` | string \| null | No | Canonical URL override | | `ogTitle` | string \| null | No | Open Graph title used when the page is shared on social networks | | `ogDescription` | string \| null | No | Open Graph description used when the page is shared on social networks | | `ogImageAlt` | string \| null | No | Alternative text of the Open Graph image | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Delete a product reservation exception **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /products/:id/reservation/exceptions/:exceptionId` **Delete a product reservation exception** Deletes one exception of the product's calendar. When the product uses a shared calendar, edit its exceptions with the `/reservation-calendars/{id}/exceptions` routes: this call returns 422 `SHARED_CALENDAR_READ_ONLY`. Returns 404 for an unknown product or exception. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `exceptionId` | path | string | Yes | Availability exception UUID | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | `SHARED_CALENDAR_READ_ONLY`: the product uses a shared calendar. Delete the exception with `DELETE /reservation-calendars/{id}/exceptions/{exceptionId}`. | --- --- # Delete a product category **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /product-categories/:id` **Delete a product category** Deletes the category and all its descendants for good. Send `expectedDescendantCount`, the number of descendants you expect to delete: a different count returns 409 on that field and deletes nothing. Products of the deleted categories stay, without a category. While products nest under their category, each published one gets a 301 redirect to its new URL. Fires the `product_category.deleted` webhook. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_categories.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product category identifier (pcat_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `expectedDescendantCount` | integer (min 0) | Yes | Required. Number of descendants you expect the category to have; a different count returns 409 and deletes nothing | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Delete a calendar translation **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /reservation-calendars/:id/translations/:locale` **Delete a calendar translation** Deletes the calendar's name in one language. The calendar then shows its base name in that language. A language with no translation also returns 204 and fires nothing. Accepts a shared calendar and the calendar a product's reservation configuration creates. Fires the `reservation_calendar.translated` webhook with `change: 'deleted'`. Errors (422): a `locale` that is the calendar's source language or is not enabled on the site. Returns 404 for an unknown calendar. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Reservation calendar identifier (bres_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # List reservation calendars **Published**: 2026-11-30 **Category**: Commerce ## `GET /reservation-calendars` **List reservation calendars** Lists the site's shared calendars. Search by `name`. `attachedProductCount` says how many live products book from each calendar. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "name" \| "created_at" | No | One of: name, created_at | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Shared calendars are not available on this site. | | `422` | Validation error | --- --- # Get a reservation calendar **Published**: 2026-11-30 **Category**: Commerce ## `GET /reservation-calendars/:id` **Get a reservation calendar** Returns one calendar with its weekly rules, exceptions and the identifiers of the live products attached to it. Returns 404 for an unknown calendar. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Reservation calendar identifier (bres_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Get the product category tree **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-categories/tree` **Get the product category tree** Returns every category of the site as a nested tree, without pagination. A caller holding `products.view` or `products.update` without `product_categories.view` receives only each category's `id`, `name` and `parentCategoryId`. > **Note:** Available only on sites with e-commerce enabled. Required permissions (any one of): `product_categories.view`, `products.view`, `products.update` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | --- --- # Create a product category **Published**: 2026-11-30 **Category**: Commerce ## `POST /product-categories` **Create a product category** Creates a product category, at the root or under `parentCategoryId`. A category is public by default: it is stored active and not internal unless you send `isActive: false` or `isInternal: true`. Without `slug`, the slug is derived from the name and suffixed `-2`, `-3` when taken. An explicit `slug` another category already holds, in any language, returns 409 on `slug`. `imageUrl` and `ogImageUrl` take URLs of media files of the site. Fires the `product_category.created` webhook. A site at its plan's product category limit gets 402 `SUBSCRIPTION_QUOTA_EXCEEDED`. A non-empty `jsonLdGraph` or `jsonLdExclusions` returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks advanced JSON-LD. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_categories.manage` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Required. Display name. 1-255 characters | | `slug` | string | No | Source-language slug of the product category (its text is written in the site default language). Unique per site among the other product categories' base slugs and their translated slugs in every language. Derived from the name when omitted, and suffixed -2, -3, ... when that derived slug is taken. A slug sent explicitly and already taken is a 409 on slug and nothing is written. Translated slugs are set with PUT /product-categories/{id}/translations/{locale} | | `parentCategoryId` | string \| null | No | Parent product category identifier (pcat_ prefixed id) | | `description` | string \| null | No | Description text | | `imageUrl` | string \| null | No | URL of a media file of the site, used as the image | | `imageAlt` | string \| null | No | Alternative text of the resource image, for accessibility and search engines | | `isActive` | boolean | No | Whether the product category is active. Defaults to true, so a new category is visible on the storefront unless isInternal is true or an ancestor is hidden | | `isInternal` | boolean | No | Whether the product category is hidden from the storefront. Defaults to false | | `position` | integer (min 0) | No | Display position among sibling resources | | `seoTitle` | string \| null | No | Search-engine title override | | `seoDescription` | string \| null | No | Search-engine description override | | `keywords` | string \| null | No | Comma-separated SEO keywords | | `canonicalUrl` | string \| null | No | Canonical URL override | | `ogTitle` | string \| null | No | Open Graph title used when the page is shared on social networks | | `ogDescription` | string \| null | No | Open Graph description used when the page is shared on social networks | | `ogImageUrl` | string \| null | No | Open Graph image URL; must be a media file of the current site's media library, or null to remove the image | | `ogImageAlt` | string \| null | No | Alternative text of the Open Graph image | | `twitterCard` | "summary" \| "summary_large_image" \| "app" \| "player" \| null | No | Card type used when the page is shared on social networks (summary, summary_large_image, app or player) | | `noIndex` | boolean | No | When true, asks search engines not to index the page (robots noindex) | | `noFollow` | boolean | No | When true, asks search engines not to follow the links of the page (robots nofollow) | | `sitemapPriority` | number (0 to 1) \| null | No | Sitemap priority (0.0-1.0) | | `sitemapChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" \| null | No | Sitemap change frequency (always, hourly, daily, weekly, monthly, yearly or never) | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan lacks this feature, its quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Delete a product collection translation **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /product-collections/:id/translations/:locale` **Delete a product collection translation** Deletes the collection's translation in one language: the collection then serves its base text there. Returns 204, also when no translation existed. When the deleted translation had its own slug, a 301 redirect to the base-slug URL in that language is created. Fires `product_collection.translated`. The source language, or a language not enabled on the site, returns 422 on `locale`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_collections.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product collection identifier (col_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Delete a product collection **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /product-collections/:id` **Delete a product collection** Deletes the collection for good. Its products stay and leave the collection. Fires the `product_collection.deleted` webhook. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_collections.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product collection identifier (col_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Update a product collection **Published**: 2026-11-30 **Category**: Commerce ## `PUT /product-collections/:id` **Update a product collection** Updates the fields sent and keeps the others; null clears an optional field. A new `slug` another collection already holds, in any language, returns 409 on `slug`. When the new `slug` moves the collection's URL, a 301 redirect from the previous one is created and counted in the response. An `imageUrl` that replaces or removes the image, sent without `imageAlt`, clears the stored `imageAlt`; `ogImageUrl` without `ogImageAlt` does the same to `ogImageAlt`. Fires `product_collection.updated`. A `jsonLdGraph` or `jsonLdExclusions` entry the stored list lacks returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks advanced JSON-LD. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_collections.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product collection identifier (col_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `title` | string | No | Display title. 1-255 characters | | `slug` | string | No | Source-language slug of the collection. Unique per site among the other collections' base slugs and their translated slugs in every language. Omit it to keep the current slug (a title change never re-slugs). A new slug already taken is a 409 on slug and nothing is written. Translated slugs are set with PUT /product-collections/{id}/translations/{locale} | | `description` | string \| null | No | Description text | | `imageUrl` | string \| null | No | URL of a media file of the site, used as the image | | `imageAlt` | string \| null | No | Alternative text of the resource image, for accessibility and search engines | | `seoTitle` | string \| null | No | Search-engine title override | | `seoDescription` | string \| null | No | Search-engine description override | | `keywords` | string \| null | No | Comma-separated SEO keywords | | `canonicalUrl` | string \| null | No | Canonical URL override | | `ogTitle` | string \| null | No | Open Graph title used when the page is shared on social networks | | `ogDescription` | string \| null | No | Open Graph description used when the page is shared on social networks | | `ogImageUrl` | string \| null | No | Open Graph image URL; must be a media file of the current site's media library, or null to remove the image | | `ogImageAlt` | string \| null | No | Alternative text of the Open Graph image | | `twitterCard` | "summary" \| "summary_large_image" \| "app" \| "player" \| null | No | Card type used when the page is shared on social networks (summary, summary_large_image, app or player) | | `noIndex` | boolean | No | When true, asks search engines not to index the page (robots noindex) | | `noFollow` | boolean | No | When true, asks search engines not to follow the links of the page (robots nofollow) | | `sitemapPriority` | number (0 to 1) \| null | No | Sitemap priority (0.0-1.0) | | `sitemapChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" \| null | No | Sitemap change frequency (always, hourly, daily, weekly, monthly, yearly or never) | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Get a product collection **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-collections/:id` **Get a product collection** Returns one product collection of the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_collections.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product collection identifier (col_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Generate product variants **Published**: 2026-11-30 **Category**: Commerce ## `POST /products/:id/variants/generate` **Generate product variants** Creates a variant for every combination of option values that has none yet, all at `priceCents`, and returns only the new ones (an empty list when none is missing). Each is titled after its values, such as `M / Blue`, carries the `gtin` and `mpn` sent, and starts without stock tracking. Fires `product_variant.created` per variant. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` past the plan's limit per product, 422 past 100 variants per product or on a bookable product. Either way, none is created. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.create` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `priceCents` | integer (0 to 99999999) | Yes | Required. Price in the smallest currency unit (cents) | | `gtin` | string \| null | No | Global Trade Item Number: 8, 12, 13 or 14 digits with a valid check digit | | `mpn` | string \| null | No | Manufacturer Part Number | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Create a product variant **Published**: 2026-11-30 **Category**: Commerce ## `POST /products/:id/variants` **Create a product variant** Creates a variant from `optionValueIds`, one value of each product option, with its own price and stock. A combination that already exists returns 422. `compareAtPriceCents` must exceed `priceCents`, and `images` must come from the product gallery. A variant's `gtin`, `mpn` and `weightGrams` override the product's. A product holds at most 100 variants, fewer if the plan says so, and a bookable product none. Fires the `product_variant.created` webhook. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` at the plan's limit per product, 422 naming the refused field, a duplicate `sku` included. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.create` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `title` | string | No | Display title. 1-255 characters | | `sku` | string \| null | No | Stock keeping unit, unique per site; an empty string stores none | | `gtin` | string \| null | No | Global Trade Item Number: 8, 12, 13 or 14 digits with a valid check digit | | `mpn` | string \| null | No | Manufacturer Part Number | | `priceCents` | integer (0 to 99999999) | Yes | Required. Price in the smallest currency unit (cents) | | `compareAtPriceCents` | integer (0 to 99999999) \| null | No | Reference price in cents, such as the price before a discount; must exceed the price, null removes it | | `stockQuantity` | integer (0 to 2000000000) \| null | No | Units in stock; null means stock is not tracked | | `weightGrams` | integer (1 to 1000000) \| null | No | Shipping weight in whole grams, read when a shipping label is created; null clears it. A variant's weight overrides the product's | | `position` | integer (0 to 1000000) | No | Display position among sibling resources | | `metadata` | object | No | Custom key-value metadata | | `optionValueIds` | string[] | Yes | Required. Option value UUIDs of the variant, exactly one per product option | | `images` | string[] | No | Ordered variant image URLs selected from the parent product gallery | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Create or update a product collection translation **Published**: 2026-11-30 **Category**: Commerce ## `PUT /product-collections/:id/translations/:locale` **Create or update a product collection translation** Creates or updates the collection's translation in one language and returns it, with 200 in both cases. Every field is optional; null clears a field other than `title` and `slug`, so the language falls back to the base text. `title` is required when the translation does not exist yet. Without `slug`, a new translation takes one derived from its title, suffixed `-2`, `-3` when taken, and an update keeps the stored one. An explicit `slug` another collection holds in that language returns 409 `RESOURCE_CONFLICT` on `slug`. When the translated slug changes, a 301 redirect from the previous URL in that language is created and counted in the response. Fires `product_collection.translated`. The source language, or a language not enabled on the site, returns 422 on `locale`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_collections.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product collection identifier (col_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `title` | string | No | Display title. 1-255 characters | | `slug` | string | No | Slug of this translation, used in the URL in that language. It must be free among the other collections' base slugs and their translated slugs in that same language. When a new translation omits it (or sends it empty), it is derived from the translated label, else from the source slug, and suffixed -2, -3, ... when taken; an update that omits it keeps the stored slug. A slug sent explicitly and already taken is a 409 on slug and nothing is written | | `description` | string \| null | No | Description text | | `imageAlt` | string \| null | No | Alternative text of the resource image, for accessibility and search engines | | `seoTitle` | string \| null | No | Search-engine title override | | `seoDescription` | string \| null | No | Search-engine description override | | `keywords` | string \| null | No | Comma-separated SEO keywords | | `canonicalUrl` | string \| null | No | Canonical URL override | | `ogTitle` | string \| null | No | Open Graph title used when the page is shared on social networks | | `ogDescription` | string \| null | No | Open Graph description used when the page is shared on social networks | | `ogImageAlt` | string \| null | No | Alternative text of the Open Graph image | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Get a product collection translation **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-collections/:id/translations/:locale` **Get a product collection translation** Returns the collection's translation in one language. A language without a translation returns 200 with `status` `missing` and null fields. The source language, or a language not enabled on the site, returns 422 on `locale`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_collections.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product collection identifier (col_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # List product variants **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:id/variants` **List product variants** Lists the product's variants, each with its option values. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Delete a product option **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /products/:id/options/:optionId` **Delete a product option** Deletes an option and its values. An option whose values a variant still uses returns 422: delete those variants first. Fires the `product_option.deleted` webhook. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `optionId` | path | string | Yes | Product option UUID | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Update a customer address **Published**: 2026-11-30 **Category**: Commerce ## `PATCH /customers/:id/addresses/:addressId` **Update a customer address** Updates the fields sent on one of the customer's addresses. Setting `isDefaultShipping` or `isDefaultBilling` to `true` moves that default from the customer's other address. A caller that also holds `customers.view` receives the full address. Any other caller receives an acknowledgement with `id`, `isDefaultShipping`, `isDefaultBilling`, `createdAt` and `updatedAt` only. Errors: 409 when another address became the default at the same time, and 404 for an unknown address, an unknown or anonymized customer, or when customer addresses are turned off for the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer identifier (cust_ prefixed id) | | `addressId` | path | string | Yes | Customer address identifier (addr_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `addressName` | string \| null | No | Label of the address, such as Home or Office | | `firstName` | string | No | Given name; on an address, the recipient's. 1-120 characters | | `lastName` | string | No | Family name; on an address, the recipient's. 1-120 characters | | `company` | string \| null | No | Company name on the address | | `address1` | string | No | 1-255 characters | | `address2` | string \| null | No | Second address line, such as an apartment or suite | | `city` | string | No | 1-120 characters | | `postalCode` | string | No | 1-32 characters | | `province` | string \| null | No | State, province or region of the address | | `countryCode` | string | No | ISO 3166-1 alpha-2 country code | | `phone` | string \| null | No | Phone number, stored as entered: no format is checked | | `isDefaultShipping` | boolean | No | Whether this is the customer's default shipping address. `true` removes that default from their other addresses | | `isDefaultBilling` | boolean | No | Whether this is the customer's default billing address. `true` removes that default from their other addresses | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List customer addresses **Published**: 2026-11-30 **Category**: Commerce ## `GET /customers/:id/addresses` **List customer addresses** Lists a customer's addresses, newest first by default, 20 per page. Returns 404 for an unknown customer, and when customer addresses are turned off for the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer identifier (cust_ prefixed id) | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `sortBy` | query | "address_name" \| "created_at" | No | One of: address_name, created_at | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List calendar translations **Published**: 2026-11-30 **Category**: Commerce ## `GET /reservation-calendars/:id/translations` **List calendar translations** Returns the calendar's name in every language enabled on the site except the calendar's source language. A language with no translation is listed as `missing`. `needs_review` means the base name changed after the translation was written. Accepts a shared calendar and the calendar a product's reservation configuration creates. Returns 404 for an unknown calendar. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Reservation calendar identifier (bres_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Update customer marketing consent **Published**: 2026-11-30 **Category**: Commerce ## `PATCH /customers/:id/marketing-consent` **Update customer marketing consent** Opts the customer in or out of marketing on the channels in `channels`, or on every channel with `all`. The latest choice on a channel is the one that applies. A caller that also holds `customers.view` receives the full customer. Any other caller receives an acknowledgement with `id`, `updatedAt` and the resulting state of each channel the request targeted. Returns 404 for an unknown customer. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer identifier (cust_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `channels` | "whatsapp" \| "email"[] \| "all" | Yes | Required. `all`, or a list of channels among `email` and `whatsapp` | | `action` | "opt_in" \| "opt_out" | Yes | Required. One of: opt_in, opt_out | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Anonymize a customer **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers/:id/anonymize` **Anonymize a customer** Erases the customer's personal data for good and sets `anonymizedAt`. The email becomes a placeholder, the name, phone, company, language and addresses are cleared, marketing consent is withdrawn and login is disabled. The customer's bookings lose the guest's name, email and phone. Orders lose their email, contact name and every phone, but their billing address keeps the name, company and postal address, which the merchant must retain for accounting. Guest orders, guest bookings and reviews under the customer's email are erased too when the caller also holds `orders.manage`, `reservations.manage` or `reviews.update` respectively. Otherwise `meta.erasure.skipped` lists them, and a later call cannot reach them. Reviews keep their status, rating and text, are signed "Anonymous" in the site's language, and fire `review.updated`. A caller without `customers.view` receives an acknowledgement. Calling again on an anonymized customer changes nothing. Returns 409 `CUSTOMER_ANONYMIZE_REQUIRES_WHATSAPP_PERMISSION` on a site holding WhatsApp messages, and 404 for an unknown customer. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer identifier (cust_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | `CUSTOMER_ANONYMIZE_REQUIRES_WHATSAPP_PERMISSION`: the site holds WhatsApp messages, which an API token cannot erase. Nothing is erased: run the anonymization from the dashboard. | --- --- # Update a customer **Published**: 2026-11-30 **Category**: Commerce ## `PATCH /customers/:id` **Update a customer** Updates the customer's profile and `preferredLocale`, the language of the emails sent to them. Send only the fields to change. Marketing consent has its own route, `PATCH /customers/{id}/marketing-consent`. Changing the email sends a notice to the previous address. For the next 72 hours, the customer receives no password reset or account activation email, and `POST /customers/{id}/send-reset-link` returns 409. A caller that also holds `customers.view` receives the full customer. Any other caller receives an acknowledgement with `id`, `anonymizedAt` and `updatedAt` only. Returns 422 on `email` when another customer of the site already uses it, and 404 for an unknown customer. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Customer identifier (cust_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | No | Valid email address | | `firstName` | string \| null | No | Given name; on an address, the recipient's | | `lastName` | string \| null | No | Family name; on an address, the recipient's | | `phone` | string \| null | No | Phone number, stored as entered: no format is checked | | `companyName` | string \| null | No | Company the customer works for | | `preferredLocale` | string \| null | No | Language of the emails sent to the customer: a language tag of letters, digits, - and _, up to 35 characters, stored normalized (pt_br becomes pt-BR). null clears it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Create a customer **Published**: 2026-11-30 **Category**: Commerce ## `POST /customers` **Create a customer** Creates a guest customer, without an account. With `marketingOptIn: true`, the customer is opted in on every marketing channel. A caller that also holds `customers.view` receives the full customer. Any other caller receives an acknowledgement with `id`, `createdAt` and `updatedAt` only. Returns 422 on `email` when another customer of the site already uses it. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.manage` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `email` | string | Yes | Required. Valid email address | | `firstName` | string \| null | No | Given name; on an address, the recipient's | | `lastName` | string \| null | No | Family name; on an address, the recipient's | | `phone` | string \| null | No | Phone number, stored as entered: no format is checked | | `companyName` | string \| null | No | Company the customer works for | | `marketingOptIn` | boolean | No | Optional marketing opt-in. When true, opts the customer in on every supported marketing channel. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # List customers **Published**: 2026-11-30 **Category**: Commerce ## `GET /customers` **List customers** Lists the site's customers, newest first by default, 20 per page. Filter with `has_account` or `group`, or search `q` across email, first name and last name. Each row carries `bookingsCount` and every group the customer belongs to, whatever the `group` filter. `groups` is empty when customer groups are turned off for the site. Returns 404 for an unknown `group`, or for any `group` while customer groups are turned off. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `customers.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `has_account` | query | boolean | No | Filter registered customers (true) or guest customers (false) | | `q` | query | string | No | Match a customer email, first name, or last name | | `group` | query | string | No | Filter by customer group identifier (cgrp_ prefixed id) | | `sortBy` | query | "created_at" \| "email" \| "last_name" | No | One of: created_at, email, last_name | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Save an email template override **Published**: 2026-11-30 **Category**: Commerce ## `PUT /commerce/email-templates/:family/:locale` **Save an email template override** Saves your subject, preheader, introduction, conclusion and button label for one family in one language. The body replaces the whole override: an omitted or blank field uses the default, and a body with all five blank removes the override. Returns the defaults, the stored override and the resulting copy. `locale` is any language the site offers. At send time, a buyer gets the override of their exact language, else of its base language (`fr-CA` uses `fr`). Returns 404 for an unknown family or when email customization is not available on the site, and 422 for a language the site does not offer. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `commerce_emails.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `family` | path | string | Yes | Buyer email template family: one of commerce.customer_welcome, commerce.order_confirmation, commerce.order_paid, commerce.reservation_confirmation, commerce.reservation_rescheduled, commerce.reservation_cancelled, commerce.order_shipped, commerce.order_out_for_delivery, commerce.order_ready_for_pickup, commerce.order_delivered, commerce.order_collected. Any other value is a 404 | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `subject` | string \| null | No | Subject line in plain text, sent as written. Omitted or empty uses the default subject of this email and language | | `preheader` | string \| null | No | Inbox preview text shown after the subject, in plain text. Omitted or empty uses the default | | `introduction` | string \| null | No | Opening paragraph under the greeting, in plain text. Omitted or empty uses the default message | | `conclusion` | string \| null | No | Closing paragraph after the action button, in plain text. Omitted or empty leaves none | | `buttonLabel` | string \| null | No | Label of the action button, in plain text. Omitted or empty uses the default label | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List commerce email templates **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/email-templates` **List commerce email templates** Lists every customizable email family. For each language the site offers, it returns the default copy and your override (null when absent) of the five editable fields, plus the email logo. The languages are `en` plus the site's enabled languages, or its default language when multi-language is off. Returns 404 when email customization is not available on the site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `commerce_emails.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | --- --- # Delete a product category translation **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /product-categories/:id/translations/:locale` **Delete a product category translation** Deletes the category's translation in one language: the category then serves its base text there. Returns 204, also when no translation existed. When the deleted translation of a visible category had its own slug, a 301 redirect to the base-slug URL in that language is created, and nested product URLs move with it. Fires `product_category.translated`. The source language, or a language not enabled on the site, returns 422 on `locale`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_categories.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product category identifier (pcat_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Get a product category translation **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-categories/:id/translations/:locale` **Get a product category translation** Returns the category's translation in one language. A language without a translation returns 200 with `status` `missing` and null fields. The source language, or a language not enabled on the site, returns 422 on `locale`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_categories.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product category identifier (pcat_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Get a market **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/markets/:id` **Get a market** Returns one market of the site with its countries and locales. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Market identifier (mkt_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | The market does not exist, or markets are not available on this site. | | `422` | The market identifier is malformed. | --- --- # Update commerce settings **Published**: 2026-11-30 **Category**: Commerce ## `PUT /commerce/settings` **Update commerce settings** Updates the site's commerce settings. Every field is optional: an omitted field keeps its current value. Changing `currency` relabels prices without converting them: products, open carts and markets take the new code, so re-price by hand. Orders and payments keep their currency. Changing `priceEntryMode` converts no stored price either, and `exclusive` entry requires a `merchantCountry`. `accountPagesUrl` must use the site's domain, and `null` restores `https://{domain}/account`. `termsPageGroupId` must name a site page with a published version tagged `terms`, and `null` clears it. Setting `accountMode` to `accounts_required` turns off guest booking. `shippingOrigin` and `defaultPackage` replace the stored value whole, and `null` clears it. Turning `enabled` on returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks e-commerce. A refused field returns 422 naming that field, and nothing is written. Required permissions: `sites.update` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `enabled` | boolean | No | Whether commerce is enabled for the selected site. Optional: an omitted field keeps the current value | | `accountMode` | "guest_and_optional" \| "accounts_required" | No | One of: guest_and_optional, accounts_required | | `currency` | "EUR" \| "USD" \| "GBP" \| "BRL" \| "CHF" \| "CAD" \| "AUD" | No | One of: EUR, USD, GBP, BRL, CHF, CAD, AUD | | `accountPagesUrl` | string \| null | No | HTTPS base URL on the site's domain that account links in buyer emails point to. `null` uses `https://{domain}/account`, and a domain change clears it | | `termsPageGroupId` | string \| null | No | Translation group id of the terms page buyers accept at storefront checkout and booking: a site page of this site with at least one published row carrying the terms tag. Any other group (of another site, not a page, with only draft rows, or whose published rows carry no terms tag) is a 422 VALIDATION_FIELD_INVALID on this field and nothing is written. null clears the setting; an omitted field keeps it | | `oversellPolicy` | "refuse" \| "allow" | No | One of: refuse, allow | | `merchantCountry` | string \| null | No | ISO 3166-1 alpha-2 code of the EU-27 country the merchant is established in, case-insensitive and stored upper-case (Greece is GR, never EL); any other code is a 422 on this field. null clears it, and clearing it while priceEntryMode is exclusive is a 422 VALIDATION_FIELD_INVALID on this field; an omitted field keeps it | | `ossEnabled` | boolean | No | Whether the merchant uses the One-Stop Shop. An omitted field keeps the current value | | `priceEntryMode` | "inclusive" \| "exclusive" | No | Whether the stored prices are entered VAT-inclusive or VAT-exclusive. Changing it converts no stored price, so every stored price changes meaning. exclusive needs a merchant country, stored or sent in the same request, else a 422 VALIDATION_FIELD_INVALID on this field. An omitted field keeps the current value | | `priceDisplayMode` | "inclusive" \| "exclusive" | No | How the storefront shows prices, VAT-inclusive or VAT-exclusive. Presentation only: it never changes what is charged. An omitted field keeps the current value | | `shippingOrigin` | object \| null | No | The address shipping labels are sent from. Replaces the stored address whole; null clears it, and a label cannot be created without one. An omitted field keeps it | | `defaultPackage` | object \| null | No | The default package of a shipping label, all four fields required. Replaces the stored package whole; null clears it. An omitted field keeps it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # List a product collection's translations **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-collections/:id/translations` **List a product collection's translations** Returns the translation status of the collection in every language enabled on the site except its source language, missing translations included. `needs_review` means the base text changed after the translation was written. An unknown collection returns 404. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_collections.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product collection identifier (col_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Get commerce settings **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/settings` **Get commerce settings** Returns the site's commerce settings: the on/off switch, whether the site's plan includes e-commerce (`available`), buyer account mode, selling currency, oversell policy, VAT settings, terms page, ship-from address and default package. Commerce runs only while both `enabled` and `available` are true. A site where commerce was never turned on returns the defaults. `termsConfigured` stays false until the terms page has a published version, and while it is false storefront checkout and booking are refused. `termsCurrentVersion` describes the terms a buyer would accept now, in the site's default language. Required permissions: `sites.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | --- --- # List product categories **Published**: 2026-11-30 **Category**: Commerce ## `GET /product-categories` **List product categories** Lists the site's product categories, 20 per page by default and at most 100. Filter by `parentId`, `isActive` or `isInternal`, or match `search` against the name and slug. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `product_categories.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "name" \| "slug" \| "position" \| "created_at" | No | One of: name, slug, position, created_at | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | | `parentId` | query | string | No | Filter by parent product category identifier (pcat_ prefixed id), or `root` for root categories | | `isActive` | query | boolean | No | Whether the product category is active | | `isInternal` | query | boolean | No | Whether the product category is hidden from storefront navigation | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Delete a shipping option **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /commerce/markets/:marketId/shipping-options/:id` **Delete a shipping option** Deletes a shipping option of a market. A cart that had chosen it no longer has a shipping option, and orders already placed with it keep their shipping line. Returns 404 when the market does not exist or the option is not one of its options. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `sites.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `marketId` | path | string | Yes | Market identifier (mkt_ prefixed id) | | `id` | path | string | Yes | Shipping option identifier (shp_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | The market or the shipping option does not exist, or shipping options are not available on this site. | | `422` | An identifier is malformed. | --- --- # Get payment account status **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/payments/account` **Get payment account status** Returns the site's most recent payment account in the mode selected for the site: live, or test when the site is in test mode. The reference is masked. A disconnected account is still returned, with its `disconnectedAt`, and `null` means no account was ever connected in that mode. Connecting and disconnecting the account happen in the dashboard, not over the API. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `payments.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | --- --- # Cancel a shipment **Published**: 2026-11-30 **Category**: Commerce ## `POST /commerce/orders/:orderId/shipments/:id/status` **Cancel a shipment** Cancels a shipment recorded by hand: send `status: cancelled`. The order's `fulfillmentStatus` is recomputed from its other shipments. Cancelling a shipment already cancelled returns 200 and changes nothing. No email is sent. An API-token caller receives an acknowledgement with the shipment and order statuses, and no buyer or address data. Fires `shipment.cancelled`. A shipment with a carrier label cannot be cancelled with an API token. Errors: 422 `INVALID_STATUS_TRANSITION` for a delivered shipment or one with a carrier label. 404 for an unknown order or shipment. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `orders.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `orderId` | path | string | Yes | Order identifier (ord_ prefixed id) | | `id` | path | string | Yes | Shipment identifier (shpt_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `status` | "cancelled" | Yes | The only status you can set: `cancelled` | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Create a shipment **Published**: 2026-11-30 **Category**: Commerce ## `POST /commerce/orders/:orderId/shipments` **Create a shipment** Records a shipment of some or all units of an order's items. Send each order item `id` with the quantity shipped, the carrier's name and the tracking details you have. The parcel goes to the order's pickup point when it has one, else to its delivery address. The order becomes `partially_fulfilled`, then `fulfilled` once every unit has shipped. `notifyCustomer` defaults to `true` and emails the buyer that the order has shipped. An API-token caller receives an acknowledgement with the shipment and order statuses, and no buyer or address data. Fires `shipment.created`. Buying a carrier label is not available with an API token: a body carrying `label` returns 422. Errors (422): `SHIPMENT_ORDER_NOT_SHIPPABLE`, `SHIPMENT_ITEM_UNKNOWN`, `SHIPMENT_ITEMS_REQUIRED`, `SHIPMENT_QUANTITY_EXCEEDED`. An unknown order returns 404. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `orders.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `orderId` | path | string | Yes | Order identifier (ord_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `items` | object[] | Yes | Order items in the parcel: each order item `id` once, with the units shipped. A unit already shipped cannot ship again | | `carrierName` | string | Yes | Name of the carrier you handed the parcel to | | `trackingNumber` | string \| null | No | Tracking number of the parcel | | `trackingUrl` | string \| null | No | Tracking page of the parcel, an `https` URL. It is linked in the buyer email | | `notifyCustomer` | boolean | No | Whether to email the buyer that the order has shipped. Defaults to `true` | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List site-wide reservations **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/reservations` **List site-wide reservations** Lists the bookings of every calendar of the site, by start time. `dateFrom` and `dateTo` are days in each calendar's own timezone. Filter by `status` and `calendarId`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `status` | query | "pending" \| "confirmed" \| "cancelled" \| "completed" \| "no_show" | No | One of: pending, confirmed, cancelled, completed, no_show | | `dateFrom` | query | string | No | Include entries on or after this calendar-local day (YYYY-MM-DD) | | `dateTo` | query | string | No | Include entries through this calendar-local day (YYYY-MM-DD) | | `calendarId` | query | string | No | Reservation calendar identifier (bres_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Bookings are not available on this site. | | `422` | Validation error | --- --- # Cancel a booking **Published**: 2026-11-30 **Category**: Commerce ## `POST /bookings/:id/status` **Cancel a booking** Cancels a `confirmed` booking: send `{ "status": "cancelled" }`. The slot is freed at once and the booking is kept with status `cancelled`. Cancelling a cancelled booking returns 200 and changes nothing. Fires the `reservation.cancelled` webhook. The guest is emailed a cancellation notice. An API-token caller always receives a short acknowledgement, with no guest, customer or price data. Errors: 422 `INVALID_STATUS_TRANSITION` for a booking that is not `confirmed`. Returns 404 for an unknown booking. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Booking identifier (bkg_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `status` | "cancelled" | Yes | Required. One of: cancelled | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Create a manual booking **Published**: 2026-11-30 **Category**: Commerce ## `POST /products/:productId/bookings` **Create a manual booking** Creates a `confirmed` booking at `startsAt` for `partySize` guests, with the guest's contact. The server computes the end time and the price from the offering, else the product. On a site entering prices without VAT, the price adds VAT at the merchant country's rate. A product with offerings requires `offeringId`. When the product books from several calendars, `resourceId` books that calendar and fails when it is full or closed. Without it, the first free calendar is assigned. Fires the `reservation.booked` webhook. The guest is emailed a confirmation. No terms acceptance is recorded. A caller without `reservations.view` receives a short acknowledgement. Errors (422): `NOT_BOOKABLE`, `OFFERING_REQUIRED`, `OFFERING_NOT_FOUND`, `RESOURCE_NOT_IN_POOL`, `PARTY_SIZE_OUT_OF_RANGE`, `BOOKING_TAX_DISABLED`, `TAX_RATE_UNAVAILABLE`, `SLOT_UNAVAILABLE`, `CAPACITY_EXCEEDED`. Returns 404 for an unknown product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `productId` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `startsAt` | string | Yes | Required. Start datetime (ISO 8601) | | `offeringId` | string | No | Reservation offering identifier (roff_ prefixed id). Max 64 characters | | `resourceId` | string | No | Reservation calendar identifier (bres_ prefixed id); omit it to let the server assign a free calendar. 1-200 characters | | `partySize` | integer (1 to 100000) | Yes | Required. Number of guests included in the reservation | | `guestName` | string | Yes | Required. Guest name captured for the reservation. 1-200 characters | | `guestEmail` | string | Yes | Required. Guest email captured for the reservation. Valid email address. Max 320 characters | | `guestPhone` | string | No | Optional guest phone captured for the reservation. Max 40 characters | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List a bookable product's bookings **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:productId/bookings` **List a bookable product's bookings** Lists the bookings on the product's calendars. Filter by `status` and a start-date range. A calendar shared with other products also lists the bookings made through them. `settlementSummary`, the amount captured for the booking, is present when online payments are available on the site. Errors: 422 `NOT_BOOKABLE` for a product without reservations. Returns 404 for an unknown product. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `productId` | path | string | Yes | Product identifier (prod_ prefixed id) | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `status` | query | "pending" \| "confirmed" \| "cancelled" \| "completed" \| "no_show" | No | One of: pending, confirmed, cancelled, completed, no_show | | `dateFrom` | query | string | No | Include entries on or after this calendar-local day (YYYY-MM-DD) | | `dateTo` | query | string | No | Include entries through this calendar-local day (YYYY-MM-DD) | | `sortBy` | query | "starts_at" \| "created_at" | No | One of: starts_at, created_at | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List orders **Published**: 2026-11-30 **Category**: Commerce ## `GET /commerce/orders` **List orders** Lists the site's orders, newest first. Filter by `status`, `paymentStatus`, `fulfillmentStatus` and a creation-date range. `q` matches an email substring or an exact order number. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `orders.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `status` | query | "pending" \| "confirmed" \| "completed" \| "cancelled" | No | One of: pending, confirmed, completed, cancelled | | `paymentStatus` | query | "pending" \| "paid" | No | One of: pending, paid | | `fulfillmentStatus` | query | "unfulfilled" \| "partially_fulfilled" \| "fulfilled" | No | One of: unfulfilled, partially_fulfilled, fulfilled | | `dateFrom` | query | string | No | Include rows created on or after this calendar day (YYYY-MM-DD) | | `dateTo` | query | string | No | Include rows created through this calendar day (YYYY-MM-DD) | | `q` | query | string | No | Match a buyer email substring or an exact numeric order number | | `sortBy` | query | "created_at" | No | One of: created_at | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Delete a product variant **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /products/:id/variants/:variantId` **Delete a product variant** Deletes the variant and frees its SKU. Fires the `product_variant.deleted` webhook. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `variantId` | path | string | Yes | Product variant identifier (var_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Upsert a calendar translation **Published**: 2026-11-30 **Category**: Commerce ## `PUT /reservation-calendars/:id/translations/:locale` **Upsert a calendar translation** Creates or replaces the calendar's name in one language and returns that language's entry, with 200 in both cases. `name` is required and cannot be blank: delete the translation to remove it. Accepts a shared calendar and the calendar a product's reservation configuration creates. Fires the `reservation_calendar.translated` webhook with `change: 'upserted'`. Errors (422): a `locale` that is the calendar's source language or is not enabled on the site, a missing or blank `name`. Returns 404 for an unknown calendar. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Reservation calendar identifier (bres_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string \| null | No | Display name | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Detach reservation calendars from a product **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /products/:id/reservation-calendar` **Detach reservation calendars from a product** Detaches every calendar from the product, or only the one named by `calendarId`. The calendars themselves are kept. Returns 204 even when nothing was attached. Returns 404 for an unknown product, or a `calendarId` of another site. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `calendarId` | query | string | No | Reservation calendar identifier (bres_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Attach a reservation calendar to a product **Published**: 2026-11-30 **Category**: Commerce ## `POST /products/:id/reservation-calendar` **Attach a reservation calendar to a product** Adds the calendar sent as `calendarId` to the calendars the product books from. `id` in the path is the product, which must be bookable. Errors: 422 on `kind` for a product that is not bookable, 422 on `calendarId` when the calendar is already attached. Returns 404 for an unknown product or calendar. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `calendarId` | string | Yes | Required. Reservation calendar identifier (bres_ prefixed id). Min 1 character | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Update a reservation calendar exception **Published**: 2026-11-30 **Category**: Commerce ## `PUT /reservation-calendars/:id/exceptions/:exceptionId` **Update a reservation calendar exception** Updates the fields sent. The result must still be a closed day without times, or an open day with both times, else 422. Sending the stored values again changes nothing. Returns 404 for an unknown calendar or exception. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `reservations.manage` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Reservation calendar identifier (bres_ prefixed id) | | `exceptionId` | path | string | Yes | Availability exception UUID | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `date` | string | No | Calendar-local date affected by this availability exception (YYYY-MM-DD) | | `isClosed` | boolean | No | Whether this exception closes the calendar for the entire day | | `startTime` | string \| null | No | Local opening time (HH:MM); required with endTime for an open exception and omitted or null for a closed day | | `endTime` | string \| null | No | Local closing time (HH:MM); required with startTime for an open exception and omitted or null for a closed day | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Get Core Web Vitals **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/cwv` **Get Core Web Vitals** Returns the 75th percentile of each Core Web Vital measured by visitors' browsers over the period (LCP, FID, CLS, TTFB, INP), with its rating and sample count. Times are in milliseconds, CLS is unitless. A metric with no sample has a `null` value and rating. Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `entry_page`. There is no `compare`. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks Core Web Vitals monitoring. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/cwv?period=30d" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "lcp": { "value": 2100, "rating": "good", "sampleCount": 4820 }, "fid": { "value": null, "rating": null, "sampleCount": 0 }, "cls": { "value": 0.08, "rating": "good", "sampleCount": 4820 }, "ttfb": { "value": 640, "rating": "good", "sampleCount": 4820 }, "inp": { "value": 240, "rating": "needs-improvement", "sampleCount": 3990 } } } ``` --- --- # Get engagement metrics **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/engagement` **Get engagement metrics** Returns engagement event counts for the period, with the top 20 outbound links, file downloads, rage clicks, dead clicks and copied texts. Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `entry_page`. `compare=previous` (the same length just before) or `compare=yoy` (the same dates a year earlier) adds a `compare` block with the summary counts of that period. Events older than your plan's analytics retention are no longer kept, so they are missing from those counts. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks engagement analytics. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/engagement?period=30d&compare=previous" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "summary": { "outboundLinks": 342, "fileDownloads": 87, "emailClicks": 23, "phoneClicks": 11, "rageClicks": 19, "deadClicks": 8, "copyEvents": 64 }, "outboundLinks": [ { "url": "https://partner.example.com/offer", "clicks": 120 } ], "fileDownloads": [ { "fileName": "whitepaper-2026", "fileExtension": "pdf", "fileUrl": "https://cdn.example.com/files/whitepaper-2026.pdf", "downloads": 45 } ], "rageClicks": [ { "pagePath": "/checkout", "elementTag": "button", "elementId": "submit-order", "elementText": "Place order", "occurrences": 12 } ], "deadClicks": [ { "pagePath": "/pricing", "elementTag": "span", "elementText": "Compare plans", "occurrences": 6 } ], "copyEvents": [ { "pagePath": "/contact", "copiedText": "support@example.com", "copies": 41 } ], "compare": { "outboundLinks": 298, "fileDownloads": 73, "emailClicks": 19, "phoneClicks": 14, "rageClicks": 25, "deadClicks": 10, "copyEvents": 58 } } } ``` --- --- # Get real-time visitors **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/realtime` **Get real-time visitors** Returns live visitor activity. `activeVisitors` counts visitors whose tracker reported activity in the last 5 minutes. The lists cover the last hour: up to 50 visitors, most recent first, and the top 10 pages, referrers, countries and cities. Takes no query parameters. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks real-time analytics. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/realtime" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "activeVisitors": 12, "visitors": [ { "visitorId": "a1b2c3d4...", "currentPage": "/pricing", "referrer": "search.example.com", "deviceType": "desktop", "countryCode": "FR", "city": "Paris", "isActive": true, "lastActivity": "2026-06-07T14:32:08.000+02:00" }, { "visitorId": "9f8e7d6c...", "currentPage": "/blog/getting-started", "referrer": null, "deviceType": "mobile", "countryCode": "DE", "city": "Berlin", "isActive": false, "lastActivity": "2026-06-07T13:58:41.000+02:00" } ], "topPages": [ { "page": "/pricing", "visitors": 8 }, { "page": "/blog/getting-started", "visitors": 5 } ], "topReferrers": [ { "referrer": "search.example.com", "visitors": 6 } ], "devices": { "desktop": 9, "mobile": 7, "tablet": 1 }, "countries": [ { "countryCode": "FR", "visitors": 7 }, { "countryCode": "DE", "visitors": 4 } ], "cities": [ { "city": "Paris", "countryCode": "FR", "visitors": 5 } ] } } ``` --- --- # Delete a site block **Published**: 2026-11-30 **Category**: Core CMS ## `DELETE /site-blocks/:slug` **Delete a site block** Permanently deletes a site block and its revisions. Pass `locale` to delete one translation. Returns 204, or 404 when no block matches. Deleting the master row returns 400 while other translations exist: delete them first. Required permissions: `site_blocks.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | > **Notes:** - Without `locale`, the call targets the master row: the one in the site's default locale when several exist, otherwise the oldest. ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/site-blocks/sidebar \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Get a redirect **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /redirects/:id` **Get a redirect** Returns a single redirect with its configuration. Required permissions: `redirects.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/redirects/a6525a30-f045-53e2-95f6-c0d425c6086c \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "a6525a30-f045-53e2-95f6-c0d425c6086c", "sourcePath": "/old-blog", "targetPath": "/blog", "statusCode": "301", "isRegex": false, "isActive": true, "preserveQueryString": true, "createdAt": "2025-02-01T10:00:00.000Z", "updatedAt": "2025-02-01T10:00:00.000Z" } } ``` --- --- # Get sessions heatmap **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/sessions/heatmap` **Get sessions heatmap** Returns how many sessions started in each hour of each weekday over the period, in the site's timezone. Only cells with at least one session are returned. Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `path` and `language`. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks session analytics. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | > **Notes:** - `day` is the weekday, from 0 (Sunday) to 6 (Saturday). `hour` runs > from 0 to 23. ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/sessions/heatmap?period=30d" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "day": 0, "hour": 9, "count": 42 }, { "day": 1, "hour": 14, "count": 91 }, { "day": 5, "hour": 20, "count": 33 } ] } ``` --- --- # Create a sitemap source **Published**: 2026-11-30 **Category**: SEO & Analytics ## `POST /sitemap/sources` **Create a sitemap source** Registers a sitemap hosted elsewhere by its `name` and `url`. While at least one source is enabled, `sitemap.xml` is a sitemap index listing the site's own sitemap, then each enabled source by `displayOrder`. Lynkow never reads the source itself. `isEnabled` defaults to true and `displayOrder` to 0. Errors: 422 for a URL that is not a public `http(s)` address, such as localhost, a private IP range or a sensitive port. 402 `SUBSCRIPTION_QUOTA_EXCEEDED` at the plan's source limit. Required permissions: `sitemap.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Required. Display name. 1-255 characters | | `url` | string | Yes | Required. Valid URL | | `isEnabled` | boolean | No | Whether the external sitemap is listed in the `sitemap.xml` index. Defaults to `true` on create | | `displayOrder` | number | No | Sort position: in ascending order, lower values come first | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST "https://api.lynkow.com/v1/sitemap/sources" \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Documentation sitemap", "url": "https://docs.example.com/sitemap.xml", "isEnabled": true, "displayOrder": 0 }' ``` ### Response Example ```json { "data": { "id": "b8e3c2a1-4f6d-4a1e-9c2b-1d7e5a8f3c90", "siteId": "f1a2b3c4-d5e6-4789-a012-3456789abcde", "name": "Documentation sitemap", "url": "https://docs.example.com/sitemap.xml", "isEnabled": true, "displayOrder": 0, "createdAt": "2026-05-12T09:14:03.221+00:00", "updatedAt": "2026-05-12T09:14:03.221+00:00" } } ``` --- --- # Get one part of the XML sitemap **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /seo/:sitemapPart.xml` **Get one part of the XML sitemap** Returns one part of the site's own sitemap as an XML ``, at `/seo/sitemap-1.xml`, `/seo/sitemap-2.xml` and so on. The site's own URLs, in the order of `/seo/sitemap-content.xml`, are cut into parts of at most 50,000 URLs and 50 MB uncompressed. A site within both limits has one part, so `sitemap-1.xml` returns its whole ``. `/seo/sitemap.xml` lists the parts only when there are several. External sitemap sources never appear in a part. Returns 404 for part 0, a number with a leading zero, or a number above the part count. A change shows within 5 minutes, most within seconds. Required permissions: `sitemap.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `sitemapPart` | path | string | Yes | File name of a sitemap part without `.xml`: `sitemap-` then the part number, from 1 (`sitemap-1`) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash # Returns XML - pipe to file or parse with xmllint curl https://api.lynkow.com/v1/seo/sitemap-2.xml \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ``` https://www.example.com/blog/getting-started 2026-05-30 weekly 0.8 ``` --- --- # Export sitemap entries as CSV **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /sitemap/entries/export` **Export sitemap entries as CSV** Downloads every manual sitemap entry of the site as a CSV file, newest first, with the columns `url`, `is_external`, `priority`, `changefreq`, `title` and `last_modified`. The file carries no `locale` or `hreflang_group_id` column, and an import ignores `last_modified`. Required permissions: `sitemap.export` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/sitemap/entries/export" \ -H "Authorization: Bearer $API_TOKEN" \ -o sitemap-entries.csv ``` ### Response Example ``` url,is_external,priority,changefreq,title,last_modified /pricing,false,0.8,monthly,Pricing Page,2025-04-01T00:00:00.000+00:00 ``` --- --- # Preview auto-generated sitemap URLs **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /sitemap/preview` **Preview auto-generated sitemap URLs** Returns the URLs the sitemap generates from the site's published articles, article categories, pages, products, product categories and collections, with the priority and change frequency the sitemap gives each. Only the types enabled in the SEO settings are listed, and a noindexed record is left out. Manual entries and external sitemap sources are not listed, and neither is a generated URL a manual entry already covers. On a multi-language site a URL appears once per locale it is served in. `meta` counts the listed URLs per type and in total, so a product listed in two locales counts twice. Required permissions: `sitemap.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/sitemap/preview \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "url": "/blog/getting-started", "title": "Getting started", "type": "content", "priority": 0.8, "changefreq": "weekly", "lastModified": "2025-04-05T08:12:00.000Z", "status": "published", "categorySlug": "guides" }, { "url": "/about", "title": "About", "type": "page", "priority": 0.6, "changefreq": "monthly", "lastModified": "2025-03-20T14:00:00.000Z", "status": "published", "categorySlug": null }, { "url": "/products/linen-shirt", "title": "Linen shirt", "type": "product", "priority": 0.5, "changefreq": "weekly", "lastModified": "2025-04-02T16:45:00.000Z", "status": null, "categorySlug": null } ], "meta": { "blogUrlMode": "flat", "blogPrefix": "blog", "totalCategories": 0, "totalContents": 1, "totalPages": 1, "totalProducts": 1, "totalProductCategories": 0, "totalProductCollections": 0, "total": 3 } } ``` --- --- # Update SEO settings **Published**: 2026-11-30 **Category**: SEO & Analytics ## `PUT /seo/settings` **Update SEO settings** Updates the site's SEO settings. Only the fields you send change, except `commercePrefixTranslations`, whose map replaces the stored one (`{}` clears it). Switching `searchEnabled`, `indexNowEnabled` or `googleIndexingEnabled` on, or a `jsonLdGraph` node the stored graph lacks, returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks that feature. Stored values sent back, and stored nodes removed or reordered, are accepted. Enabling IndexNow generates a key when the stored one is missing or not 32 lowercase hex characters, and a key change clears `indexNowLastVerifiedAt`. The response carries the full `indexNowKey` and a `redirects` object counting the automatic 301 redirect rules the save created, deleted and skipped. Sending `searchEnabled: true` reindexes the site search. Fires the `seo.updated` webhook with the fields that changed. Returns 422 when a URL prefix you send, `blogPrefix` included, starts with a language code of the site (`fr/news` on a site serving `fr`), or equals or nests with another prefix (`shop` against `shop/items`). A prefix sent with its stored value is not checked. Required permissions: `seo.update` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `robotsRules` | object[] | No | robots.txt groups, each a userAgent with its path rules (path, allow). Replaces the stored list | | `robotsSitemapLink` | boolean | No | When true, robots.txt ends with a Sitemap line for the site sitemap | | `defaultPriority` | number (0 to 1) | No | Sitemap priority, from 0 to 1, of a URL nothing else sets one for | | `defaultChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" | No | One of: always, hourly, daily, weekly, monthly, yearly, never | | `includeContentsInSitemap` | boolean | No | Include published articles in the sitemap | | `includePagesInSitemap` | boolean | No | Include published pages in the sitemap | | `includeCategoriesInSitemap` | boolean | No | Include article category archives in the sitemap | | `includeProductsInSitemap` | boolean | No | Include published products in the sitemap | | `includeProductCategoriesInSitemap` | boolean | No | Include visible product categories that hold at least one published product in the sitemap | | `includeProductCollectionsInSitemap` | boolean | No | Include product collections that hold at least one published product in the sitemap | | `nestProductsUnderCategory` | boolean | No | Place a product's URL under its category's (/{productCategoryPrefix}/{categorySlug}/{slug}) instead of /{productPrefix}/{slug}; a product with no visible category keeps the flat URL | | `productPrefix` | string | No | URL prefix of products (e.g. "products"): lowercase slug segments joined by "/", no leading or trailing slash. It must not start with a language code of the site, nor equal or nest with another commerce prefix or blogPrefix. Max 100 characters | | `productCategoryPrefix` | string | No | URL prefix of product categories (e.g. "product-categories"): lowercase slug segments joined by "/", no leading or trailing slash. It must not start with a language code of the site, nor equal or nest with another commerce prefix or blogPrefix. Max 100 characters | | `productCollectionPrefix` | string | No | URL prefix of product collections (e.g. "collections"): lowercase slug segments joined by "/", no leading or trailing slash. It must not start with a language code of the site, nor equal or nest with another commerce prefix or blogPrefix. Max 100 characters | | `commercePrefixTranslations` | object | No | Commerce URL segments per enabled non-default language: { "fr": { "productPrefix": "produits" } } gives /fr/produits/{slug}. A segment left out or empty uses the base prefix. Replaces the stored map | | `contentPathPrefixes` | object | No | URL path prefixes for content types | | `contentTypePriorities` | object | No | Sitemap priority from 0 to 1 per content type, also keyed product, product_category or product_collection | | `indexNowEnabled` | boolean | No | When true, published URL changes are submitted to IndexNow. Enabling it generates a key when the stored one is missing or malformed | | `indexNowKey` | string | No | IndexNow key: exactly 32 lowercase hexadecimal characters | | `googleIndexingEnabled` | boolean | No | When true, published URL changes are submitted to the Google Indexing API while Google Search Console is connected | | `blogUrlMode` | "flat" \| "nested" | No | One of: flat, nested | | `blogPrefix` | string \| null | No | URL prefix for blog (e.g. "blog"); its first segment must not be a language code of the site | | `llmsTxtEnabled` | boolean | No | When true, the site serves llms.txt, llms-full.txt and the Markdown renderings of its articles and pages | | `llmsSiteDescription` | string \| null | No | Site description for LLM crawlers | | `searchEnabled` | boolean | No | When true, the site search is on. Sending true reindexes the site | | `searchIncludeCommerce` | boolean | No | When true, the site search also indexes published products, visible product categories and collections holding a published product, without price or stock. Off by default | | `defaultAuthorName` | string \| null | No | Site-wide default author name for Article structured data when a content has no author override | | `defaultAuthorUrl` | string \| null | No | Site-wide default author profile URL for Article structured data when a content has no author override | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | > **Notes:** - A `blogPrefix` or `blogUrlMode` change, or both in one save, creates one automatic 301 redirect rule per blog URL that moves, counted in `redirects.created`. > > - A category page sits at its full category path with nested blog URLs and at its slug alone with flat blog URLs, so one at the same URL under both gets no rule. > - Redirect rules are written once the settings are saved, and a failure to write them never fails the save. > - Automatic rules aimed at a URL that moves are repointed to its new URL. Automatic rules whose source becomes a content or category URL are deleted: `redirects.deleted` counts them. Hand-written redirects are never changed. > - A change to a commerce prefix, a per-language segment or `nestProductsUnderCategory` also redirects the old commerce URLs. > - Automatic rules count toward the limit of 10000 automatic redirect rules per site, separate from manual rules. Rules past it are not created and are counted in `redirects.skipped`; the save still succeeds. ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/seo/settings \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "blogUrlMode": "nested", "blogPrefix": "blog", "indexNowEnabled": true, "llmsTxtEnabled": true, "llmsSiteDescription": "Our company blog and knowledge base." }' ``` ### Response Example ```json { "data": { "id": 1, "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "robotsRules": [ { "userAgent": "*", "rules": [ { "path": "/", "allow": true }, { "path": "/admin", "allow": false }, { "path": "/api", "allow": false } ] } ], "robotsSitemapLink": true, "defaultPriority": 0.5, "defaultChangefreq": "weekly", "includeContentsInSitemap": true, "includePagesInSitemap": true, "includeCategoriesInSitemap": false, "includeProductsInSitemap": true, "includeProductCategoriesInSitemap": true, "includeProductCollectionsInSitemap": true, "nestProductsUnderCategory": false, "productPrefix": "products", "productCategoryPrefix": "product-categories", "productCollectionPrefix": "collections", "commercePrefixTranslations": { "fr": { "productPrefix": "produits" } }, "contentPathPrefixes": {}, "contentTypePriorities": {}, "blogUrlMode": "nested", "blogPrefix": "blog", "defaultAuthorName": "Editorial Team", "defaultAuthorUrl": null, "indexNowKey": "3f9a1c7e5b2d4f8a6c0e1b3d5f7a9c2e", "indexNowEnabled": true, "indexNowLastVerifiedAt": "2025-04-01T10:00:00.000Z", "googleIndexingEnabled": false, "llmsTxtEnabled": true, "llmsSiteDescription": "Our company blog and knowledge base.", "searchEnabled": true, "searchIncludeCommerce": false, "jsonLdGraph": [], "createdAt": "2025-01-01T00:00:00.000Z", "updatedAt": "2025-04-06T11:00:00.000Z", "redirects": { "created": 2, "deleted": 0, "skipped": 0 } } } ``` --- --- # List automatic redirects **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /redirects/automatic` **List automatic redirects** Lists the locale redirects the site computes from its language settings and translations, 25 per page by default. They are never stored, so they cannot be edited or deleted, and they change with the settings and the translations. Three kinds: - `default_prefix`: a URL under the default locale's segment answers the same URL without it (`/fr/{path}` to `/{path}` on a French-default site). - `non_enabled_locale`: a URL under a locale the site does not enable answers the same item in the default locale. - `translated_slug`: the URL of a content, category, page, product, product category or collection at its source slug under a locale answers its translated URL there. The two pattern kinds come first, with brace placeholders. `overridden` is true when an active stored redirect answers the same source, since a stored rule always wins. Required permissions: `redirects.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | integer (min 1) | No | Page number, starting at 1 | | `limit` | query | integer (1 to 100) | No | Number of items per page, 25 by default | | `kind` | query | "default_prefix" \| "non_enabled_locale" \| "translated_slug" | No | Keep only the automatic redirects of this kind, each described in the operation | | `search` | query | string | No | Keep only the automatic redirects whose source or target contains this text, ignoring case. A `translated_slug` redirect matches on its source path or translated slug | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | --- --- # Get a site block **Published**: 2026-11-30 **Category**: Core CMS ## `GET /site-blocks/:slug` **Get a site block** Returns a site block by slug. Pass `locale` to read a translation. Returns 404 when no block matches. Required permissions: `site_blocks.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | > **Notes:** - Without `locale`, you get the master row: the one in the site's default locale when several exist, otherwise the oldest. Other slug endpoints use the same row. ### Examples ```bash curl https://api.lynkow.com/v1/site-blocks/header \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "1bf25a69-6c23-58eb-bf2c-b79f5a451625", "name": "Header", "slug": "header", "type": "global", "status": "published", "locale": "en", "schema": { "fields": [ { "key": "logo", "type": "image", "label": "Logo" }, { "key": "navLinks", "type": "array", "label": "Navigation Links" } ] }, "data": { "logo": { "url": "https://cdn.lynkow.com/sites/abc123/logo.svg", "alt": "Company Logo" }, "navLinks": [ { "label": "Home", "url": "/" }, { "label": "Blog", "url": "/blog" }, { "label": "Contact", "url": "/contact" } ] }, "createdAt": "2025-01-05T09:00:00.000Z", "updatedAt": "2025-03-20T11:00:00.000Z" } } ``` --- --- # Update block data **Published**: 2026-11-30 **Category**: Core CMS ## `PUT /site-blocks/:slug/data` **Update block data** Replaces the field values of a site block. `data` is required and is validated against the block schema, so send every field. The optional `name`, `path`, `llmContent`, `seo` and JSON-LD fields change only when sent. `path` applies to `page` blocks and is ignored on a global block. Adds a revision when a value changes. Fires the `site_block.updated` webhook. A `jsonLdGraph` or `jsonLdExclusions` entry the stored list lacks returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks advanced JSON-LD. A token without `site_blocks.view` receives an acknowledgement instead of the block. Required permissions: `site_blocks.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `data` | object | Yes | Every field value of the block, validated against its schema | | `name` | string | No | New name of this translation | | `path` | string | No | New URL path of this translation, `page` blocks only | | `locale` | string | No | Locale of the translation to update. Defaults to the master row | | `seo` | object \| null | No | SEO metadata for the block: meta title/description, keywords, Open Graph, Twitter Card, canonical URL, noindex, and sitemap priority/changefreq | | `jsonLdConfig` | object \| null | No | JSON-LD structured-data configuration: enabled flag, schema type (WebPage, AboutPage, ContactPage, FAQPage, CollectionPage), include organization/breadcrumb flags, and custom fields | | `jsonLdGraph` | object[] \| null | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] \| null | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | | `llmContent` | string \| null | No | Markdown content for the page surfaced to LLM crawlers (e.g. llms.txt) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | The data does not match the block schema, the `name` or the `path` is
invalid, or the `path` is already used by another page. Nothing is
changed.
| | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | The change conflicts with an existing block at save time, such as a
path claimed concurrently. The message is always
`The change conflicts with an existing block`. Nothing is changed.
| | `422` | Validation error on `seo`, `jsonLdConfig`, `jsonLdGraph`, `jsonLdExclusions` or `llmContent`, such as an unknown `seo.sitemapChangefreq` or a non-numeric `seo.sitemapPriority`, unless it is the value already stored, or that `seo` key, sent back unchanged. Nothing is changed. | > **Notes:** - `null` on `seo`, `jsonLdConfig`, `jsonLdGraph`, `jsonLdExclusions` or `llmContent` clears that field. A stored value sent back unchanged is accepted, as is each `seo` key sent back unchanged. > > - DataSource fields are not validated: they are resolved at read time. > - A `richtext` value is a TipTap document (`{"type": "doc", "content": [...]}`) or `""` to clear it. Anything else returns 400, unless it is the stored value sent back unchanged. > - Without `locale`, the call targets the master row: the one in the site's default locale when several exist, otherwise the oldest. ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/site-blocks/header/data \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "data": { "tagline": "Build faster with Lynkow", "navLinks": [ {"label": "Home", "url": "/"}, {"label": "Blog", "url": "/blog"} ] } }' ``` ### Response Example ```json { "data": { "id": "e45f244c-9aed-529e-a4e5-ef676252699f", "name": "Header", "slug": "header", "type": "global", "status": "published", "data": { "logo": { "url": "https://cdn.lynkow.com/sites/abc123/logo.svg", "alt": "Company Logo" }, "tagline": "Build faster with Lynkow", "navLinks": [ { "label": "Home", "url": "/" }, { "label": "Blog", "url": "/blog" } ] }, "updatedAt": "2025-04-06T14:30:00.000Z" } } ``` --- --- # Get form analytics **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/forms-analytics` **Get form analytics** Returns the form interactions the tracker recorded on your pages: a summary, the top 20 forms, the 30 fields visitors spend longest on, the top 20 field errors, and abandons grouped by how much of the form was filled in. Completion values are percentages of the form filled in. When your plan lacks advanced form analytics, `advancedAvailable` is `false` and `fieldAnalytics`, `formErrors` and `abandonmentByCompletion` are empty. Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `entry_page`. `compare=previous` or `compare=yoy` adds a `compare` block with the summary of that period. Events older than your plan's analytics retention are no longer kept, so they are missing from that summary. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/forms-analytics?period=30d&compare=previous" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "summary": { "formStarts": 1240, "formSubmits": 868, "formAbandons": 372, "formErrors": 145, "conversionRate": 70, "avgCompletionRate": 82 }, "forms": [ { "formId": "contact-form", "formName": "Contact us", "starts": 540, "submits": 410, "abandons": 130, "conversionRate": 75.9, "avgCompletion": 88 } ], "fieldAnalytics": [ { "formId": "contact-form", "formName": "Contact us", "fieldName": "message", "fieldType": "textarea", "avgTimeMs": 18400, "interactions": 512 } ], "formErrors": [ { "formId": "contact-form", "formName": "Contact us", "fieldName": "email", "errorMessage": "Invalid email address", "occurrences": 84 } ], "abandonmentByCompletion": [ { "range": "0-25%", "count": 96 }, { "range": "25-50%", "count": 140 } ], "advancedAvailable": true, "compare": { "formStarts": 1180, "formSubmits": 792, "formAbandons": 388, "formErrors": 162, "conversionRate": 67.1, "avgCompletionRate": 79 } } } ``` --- --- # Create a redirect **Published**: 2026-11-30 **Category**: SEO & Analytics ## `POST /redirects` **Create a redirect** Creates a redirect rule. `targetPath` is a site-relative path (`/...`) or an absolute http(s) URL. A plain `sourcePath` may hold up to 10 `*` wildcards; with `isRegex: true` it is a regular expression. `statusCode` defaults to `301`, `preserveQueryString` and `isActive` to true. Fires the `redirect.created` webhook. Errors: 409 when another rule has the same `sourcePath`. 422 for an unsafe pattern, or when the site already holds 1000 manual redirect rules (automatic ones do not count). 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` for a regex rule on a plan without regex redirects, 402 `SUBSCRIPTION_QUOTA_EXCEEDED` at the plan's limit of manual rules. Required permissions: `redirects.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `sourcePath` | string | Yes | Required. 1-2048 characters | | `targetPath` | string | Yes | Required. 1-2048 characters | | `statusCode` | "301" \| "302" \| "307" \| "308" | No | One of: 301, 302, 307, 308 | | `isRegex` | boolean | No | Treats `sourcePath` as a regular expression matched against the path, with `$1` in `targetPath` for a capture group. Matches only on plans with regex redirects | | `preserveQueryString` | boolean | No | Tells the front end serving the redirect to append the visitor's query string to the target. Defaults to `true` on create | | `isActive` | boolean | No | Whether the redirect is applied. An inactive redirect is kept but never matched | | `note` | string | No | Max 500 characters | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan lacks this feature, its quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/redirects \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sourcePath": "/old-page", "targetPath": "/new-page", "statusCode": "301", "preserveQueryString": true }' ``` ### Response Example ```json { "data": { "id": "8b177810-2913-55f7-9da1-ddf0a402289a", "sourcePath": "/old-page", "targetPath": "/new-page", "statusCode": "301", "isRegex": false, "isActive": true, "preserveQueryString": true, "createdAt": "2025-04-06T11:45:00.000Z" } } ``` --- --- # Update a sitemap entry **Published**: 2026-11-30 **Category**: SEO & Analytics ## `PUT /sitemap/entries/:id` **Update a sitemap entry** Updates the fields you send and leaves the others unchanged. A new `url` is normalized as on create. Send `null` to clear `lastModified`, `locale` or `hreflangGroupId`. An entry left with a group must keep a locale. Fires the `sitemap_entry.updated` webhook. Errors: 404 when the entry does not exist. 409 when the new URL belongs to another entry. 422 `VALIDATION_FIELD_INVALID` for a `lastModified` that is not an ISO 8601 date, a locale the site does not enable, a group without a locale, or a group that already has another entry in that locale. Required permissions: `sitemap.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `url` | string | No | 1-2048 characters | | `isExternal` | boolean | No | Whether `url` is an absolute address on another site, listed as written. Detected from `url` when omitted on create | | `priority` | number (0 to 1) | No | Sitemap priority of this URL. Defaults to `0.5` on create | | `changefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" | No | One of: always, hourly, daily, weekly, monthly, yearly, never | | `lastModified` | string \| null | No | Last modification datetime (ISO 8601). `null` clears it | | `title` | string | No | Display title. Max 255 characters | | `locale` | string \| null | No | BCP 47 locale code (e.g. "en", "fr") | | `hreflangGroupId` | string \| null | No | UUID you choose to link the translations of one page as hreflang alternates. Each member needs a `locale`, unique in the group; `null` leaves the group | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Response Example ```json { "data": { "id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890", "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "url": "/pricing", "isExternal": false, "priority": 0.9, "changefreq": "weekly", "lastModified": "2025-04-06T00:00:00.000Z", "title": "Pricing Page", "locale": null, "hreflangGroupId": null, "createdAt": "2025-02-10T09:00:00.000Z", "updatedAt": "2025-04-06T11:30:00.000Z" } } ``` --- --- # Get Google Indexing API logs **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /seo/google-indexing/logs` **Get Google Indexing API logs** Lists the site's Google Indexing API submissions of the last 12 months, newest first, 20 per page by default. Submissions happen only while Google Indexing is enabled in the SEO settings and Google Search Console is connected. A failed submission carries Google's `httpStatus` and its error text in `errorMessage`. Required permissions: `seo.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | integer (min 1) | No | Page number, from 1. | | `limit` | query | integer (1 to 100) | No | Rows per page, 20 by default. | | `success` | query | boolean | No | Only successful (`true`) or failed (`false`) submissions. | | `source` | query | "publish" \| "unpublish" \| "bulk" | No | Only submissions of this source. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/seo/google-indexing/logs?success=false" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "b1bf0986-67bf-5c0c-8f66-5991aacde8b2", "url": "https://www.example.com/blog/getting-started", "source": "publish", "success": true, "httpStatus": 200, "errorMessage": null, "createdAt": "2025-04-05T11:00:00.000Z" }, { "id": "adb7066e-5959-5eaa-8dd7-f3cf649f768a", "url": "https://www.example.com/products/linen-shirt", "source": "unpublish", "success": true, "httpStatus": 200, "errorMessage": null, "createdAt": "2025-04-04T15:00:00.000Z" } ], "meta": { "total": 85, "perPage": 20, "currentPage": 1, "lastPage": 5 } } ``` --- --- # Delete a sitemap rule **Published**: 2026-11-30 **Category**: SEO & Analytics ## `DELETE /sitemap/rules/:id` **Delete a sitemap rule** Deletes a sitemap rule and fires the `sitemap_rule.deleted` webhook with the deleted rule. The URLs it matched take their values from the next matching rule or their other sources. Returns 404 when the rule does not exist. Required permissions: `sitemap.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/sitemap/rules/a9c4a8b8-941b-5322-b164-01cf45a6a490 \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # List visitor sessions **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/sessions` **List visitor sessions** Returns the visitor sessions started in the period, newest first, paginated with `page` (default 1) and `limit` (default 20, at most 100). `excludeBounce=true` leaves out single-page sessions. Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `path` and `language`. Your plan shows only the site's most recent sessions, up to a number it sets. `meta.capped` is `true` when older matching sessions were left out for that reason. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks session analytics. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/sessions?period=30d&page=1&limit=20&excludeBounce=true" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "7a2b9c1d-3e4f-5a6b-7c8d-9e0f1a2b3c4d", "visitorId": "3f9a1c2e", "entryPage": "/", "exitPage": "/pricing", "pageCount": 4, "durationSeconds": 186, "deviceType": "desktop", "browser": "Chrome", "os": "Windows", "countryCode": "FR", "city": "Paris", "trafficSource": "organic", "referrerDomain": "search.example.com", "isBounce": false, "isNewVisitor": true, "startedAt": "2026-05-30T14:22:10.000Z", "visitCount": 1 } ], "meta": { "total": 1542, "page": 1, "limit": 20, "capped": false } } ``` --- --- # Get page as markdown **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /markdown/pages/:slug` **Get page as markdown** Returns a published page as Markdown: its SEO title or name, its SEO description as a quote, then its text. The slug may end in `.md`. Every translation of a page shares its slug: the one in the site's default locale is returned, otherwise the oldest published one. Returns 404 `RESOURCE_NOT_FOUND` when llms.txt is disabled for the site or no published page has the slug. Required permissions: `seo.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/markdown/pages/about \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ``` # About Us > Who we are and what we build. We build tools for the modern web. ``` --- --- # Create a product **Published**: 2026-11-30 **Category**: Commerce ## `POST /products` **Create a product** Creates a product as a draft: publish it with `POST /products/{id}/status`. Its currency is the site currency. Without `slug`, the slug is derived from the title. A slug another product already holds, in any language, gets a `-2`, `-3` suffix instead of an error. `compareAtPriceCents` must exceed `priceCents`. `gallery`, `imageUrls` (send one of the two) and `ogImageUrl` take URLs of media files of the site. The deposit of a bookable product must reach the minimum amount the payment provider can charge. A non-empty `jsonLdGraph` or `jsonLdExclusions` returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks advanced JSON-LD. Fires the `product.created` webhook. Errors: 422 naming the refused field, a duplicate `sku` included. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `title` | string | Yes | Required. Display title. 1-500 characters | | `slug` | string | No | Source-language slug of the product (its text is written in the site default language). Unique per site among the other live products' base slugs and their translated slugs in every language; a deleted product frees its slug. Derived from the title when omitted. A taken slug, an explicit one included, is suffixed -2, -3, ... rather than refused, so read the slug from the response. Translated slugs are set with PUT /products/{id}/translations/{locale} | | `description` | string \| null | No | Description text | | `priceCents` | integer (0 to 99999999) | Yes | Required. Price in the smallest currency unit (cents) | | `imageUrls` | string[] | No | Ordered URLs of media files of the site, for the product gallery. Cannot be sent with `gallery` | | `gallery` | object[] | No | Ordered product images, each a URL of a media file of the site with optional alternative text and caption | | `sku` | string \| null | No | Stock keeping unit, unique per site; an empty string stores none | | `compareAtPriceCents` | integer (0 to 99999999) \| null | No | Reference price in cents, such as the price before a discount; must exceed the price, null removes it | | `stockQuantity` | integer (0 to 2000000000) \| null | No | Units in stock; null means stock is not tracked | | `weightGrams` | integer (1 to 1000000) \| null | No | Shipping weight in whole grams, read when a shipping label is created; null clears it. A variant's weight overrides the product's | | `seoTitle` | string \| null | No | Search-engine title override | | `seoDescription` | string \| null | No | Search-engine description override | | `keywords` | string \| null | No | Comma-separated SEO keywords | | `canonicalUrl` | string \| null | No | Canonical URL override | | `ogTitle` | string \| null | No | Open Graph title used when the page is shared on social networks | | `ogDescription` | string \| null | No | Open Graph description used when the page is shared on social networks | | `ogImageUrl` | string \| null | No | Open Graph image URL; must be a media file of the current site's media library, or null to remove the image | | `ogImageAlt` | string \| null | No | Alternative text of the Open Graph image | | `twitterCard` | "summary" \| "summary_large_image" \| "app" \| "player" \| null | No | Card type used when the page is shared on social networks (summary, summary_large_image, app or player) | | `noIndex` | boolean | No | When true, asks search engines not to index the page (robots noindex) | | `noFollow` | boolean | No | When true, asks search engines not to follow the links of the page (robots nofollow) | | `sitemapPriority` | number (0 to 1) \| null | No | Sitemap priority (0.0-1.0) | | `sitemapChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" \| null | No | Sitemap change frequency (always, hourly, daily, weekly, monthly, yearly or never) | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | | `brand` | string \| null | No | Brand name of the product | | `gtin` | string \| null | No | Global Trade Item Number: 8, 12, 13 or 14 digits with a valid check digit | | `mpn` | string \| null | No | Manufacturer Part Number | | `metadata` | object | No | Custom key-value metadata | | `kind` | "standard" \| "bookable" | No | Product kind: standard or bookable. One of: standard, bookable | | `depositType` | "none" \| "percent" \| "fixed" | No | How the deposit charged at booking is computed; a new product has `none`. One of: none, percent, fixed | | `depositPercent` | integer (1 to 100) \| null | No | Deposit as a percentage of the price, sent with `depositType: percent` only | | `depositValueCents` | integer (1 to 99999999) \| null | No | Fixed deposit in cents, sent with `depositType: fixed` only | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/products \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Classic T-Shirt", "description": "100% organic cotton t-shirt", "priceCents": 2900 }' ``` --- --- # Bulk delete redirects **Published**: 2026-11-30 **Category**: SEO & Analytics ## `POST /redirects/bulk-delete` **Bulk delete redirects** Permanently deletes the redirect rules listed in `ids`. Identifiers of other sites or unknown ones are ignored, and `count` gives the number deleted. Fires the `redirect.deleted` webhook with the deleted ids, and none when nothing was deleted. Required permissions: `redirects.delete` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `ids` | string[] | Yes | Required | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/redirects/bulk-delete \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"ids": ["b069bbd4-7635-5dca-ab76-626b56fce8c2", "d4a529ae-3a10-5a74-921c-522bf8b15913"]}' ``` ### Response Example ```json { "data": { "message": "2 redirects deleted successfully", "count": 2 } } ``` --- --- # Get device, browser and OS breakdown **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/devices` **Get device, browser and OS breakdown** Returns visits by device type, and pageviews by browser and by operating system, over the period. `limit` caps the browser and operating system lists (default 50, at most 100). Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `entry_page`. With `compare=previous` or `compare=yoy`, each entry carries a `trend` percentage. It is `null` when the comparison period starts before your plan's analytics retention. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/devices?period=30d&limit=50" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "devices": [ { "deviceType": "desktop", "count": 5210, "percentage": 58.4 }, { "deviceType": "mobile", "count": 3120, "percentage": 35 }, { "deviceType": "tablet", "count": 590, "percentage": 6.6 } ], "browsers": [ { "browser": "Chrome", "count": 5840 }, { "browser": "Safari", "count": 2110 } ], "operatingSystems": [ { "os": "Windows", "count": 4120 }, { "os": "iOS", "count": 2240 } ] } } ``` --- --- # Create a sitemap rule **Published**: 2026-11-30 **Category**: SEO & Analytics ## `POST /sitemap/rules` **Create a sitemap rule** Creates a rule that sets `priority` and `changefreq` on the generated sitemap URLs it matches. `sourceType` decides what `sourceValue` is compared to: - `content_type`: the article's content type, `post`. - `category`: the slug of one of the article's categories. - `tag`: the slug of one of the article's tags. - `path_pattern`: the URL path, with or without its locale prefix, where `*` matches any characters (`/docs/*`). The only type that also applies to pages, products, product categories and collections. The first matching rule wins: highest `ruleOrder`, then newest. An article's own sitemap values override the rule, and the rule overrides its category's values. A page or commerce URL takes from the rule only the values it does not set itself. Fires the `sitemap_rule.created` webhook. Errors: 409 when a rule with the same `sourceType` and `sourceValue` exists, 402 `SUBSCRIPTION_QUOTA_EXCEEDED` at the plan's rule limit. Required permissions: `sitemap.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `sourceType` | "content_type" \| "category" \| "tag" \| "path_pattern" | Yes | Required. One of: content_type, category, tag, path_pattern | | `sourceValue` | string | Yes | Required. 1-255 characters | | `priority` | number (0 to 1) | Yes | Required. Priority given to the URLs matching the rule when they carry none of their own | | `changefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" | Yes | Required. One of: always, hourly, daily, weekly, monthly, yearly, never | | `ruleOrder` | number | No | Rank among the rules matching the same URL: the highest applies, and the newest rule wins a tie. Defaults to `0` on create | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/sitemap/rules \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "sourceType": "path_pattern", "sourceValue": "/docs/*", "priority": 0.7, "changefreq": "weekly", "ruleOrder": 10 }' ``` ### Response Example ```json { "data": { "id": "9e8b75e8-3ad9-5f06-a59b-4f773b512c44", "siteId": "a1b2c3d4-e5f6-4890-abcd-ef1234567890", "sourceType": "path_pattern", "sourceValue": "/docs/*", "priority": 0.7, "changefreq": "weekly", "ruleOrder": 10, "createdAt": "2025-04-06T12:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # Render page markdown **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /:path` **Render page markdown** Returns the Markdown of a published article, category index or page: append `.md` to its path on your site. Pages accept a locale prefix (`/v1/fr/about.md`). Returns 404 `PATH_NOT_FOUND` when the path does not end in `.md` or matches no published article, category or page. 404 `RESOURCE_NOT_FOUND` when llms.txt is disabled for the site. Required permissions: `seo.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `path` | path | string | Yes | Path of a published article, category or page of your site, followed by `.md`. Send its slashes unencoded: `%2F` returns 404 | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | > **Notes:** - Content type: `text/markdown; charset=utf-8`. Sets `X-Robots-Tag: noindex, nofollow`. > > - A path that is also a `/v1` route, such as `/contents/{id}`, reaches that route. Fetch such a page from `GET /storefront/{siteId}/{path}`. ### Examples ```bash # Returns Markdown text - not JSON curl https://api.lynkow.com/v1/blog/launch-recap.md \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ``` # Launch recap **Publié le** : 2026-05-01 **Catégorie** : News **Tags** : release, product ## Highlights Markdown rendering is available for every published article and page. ``` --- --- # Get a product **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:id` **Get a product** Returns one product of the site, whatever its status. A deleted product returns 404. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/products/$PRODUCT_ID \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # List product options **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:id/options` **List product options** Lists the product's options, each with its values. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Delete a product variant translation **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /products/:id/variants/:variantId/translations/:locale` **Delete a product variant translation** Deletes a variant's title in one language, which is built from the translated option values again. Returns 204, also when none existed. A variant that does not belong to the product returns 404. Fires `product.translated`. The product's source language, or a language not enabled on the site, returns 422 on `locale`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `variantId` | path | string | Yes | Product variant identifier (var_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # List redirects **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /redirects` **List redirects** Returns the site's stored redirect rules, newest first, 50 per page by default and at most 100. Filter with `search` (found in the source, the target or the note), `is_active` and `status_code`. Sort with `sort_by` (`created_at` or `source_path`) and `sort_order`; any other `sort_by` returns 422. Locale redirects computed from the language settings are never stored: list them with `GET /redirects/automatic`. Required permissions: `redirects.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/redirects \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "ca45c907-624c-58f2-a523-e7a640154a28", "sourcePath": "/old-blog", "targetPath": "/blog", "statusCode": "301", "isRegex": false, "isActive": true, "preserveQueryString": true, "createdAt": "2025-02-01T10:00:00.000Z" }, { "id": "a7b71798-5937-57d2-8e82-c9741d9ef5fd", "sourcePath": "/products/(.*)", "targetPath": "/shop/$1", "statusCode": "301", "isRegex": true, "isActive": true, "preserveQueryString": false, "createdAt": "2025-03-15T14:00:00.000Z" } ], "meta": { "total": 24, "perPage": 15, "currentPage": 1, "lastPage": 2 } } ``` --- --- # Delete a sitemap entry **Published**: 2026-11-30 **Category**: SEO & Analytics ## `DELETE /sitemap/entries/:id` **Delete a sitemap entry** Deletes a manual sitemap entry and fires the `sitemap_entry.deleted` webhook with the deleted entry. Returns 404 when the entry does not exist. Required permissions: `sitemap.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/sitemap/entries/8c1b6360-3237-5c6f-ae80-04b43896f3ae \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Get full site content as text **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /llms-full.txt` **Get full site content as text** Returns all the site's published content in one Markdown file, with no pagination, so it can be large. On a site with a product catalog, one block between the articles and the pages lists the products, product categories and collections, each linked to its page with its description when it has one, and never a price or a stock. Entries marked noindex are left out. `?locale=` and the 404 cases work as on `GET /llms.txt`. Required permissions: `seo.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/llms-full.txt \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ``` # My Website > A headless CMS platform. --- # Getting Started with Lynkow **Publié le** : 2025-04-05 **Catégorie** : Guides Learn how to set up your first headless CMS with Lynkow. --- # About Us > Who we are and what we build. We build tools for the modern web. ``` --- --- # List sitemap sources **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /sitemap/sources` **List sitemap sources** Returns the site's external sitemap sources, unpaginated, by `displayOrder` then newest first. A source is a sitemap hosted elsewhere, such as a shop or a documentation site, that `sitemap.xml` lists beside the site's own sitemap while the source is enabled. Required permissions: `sitemap.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/sitemap/sources" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "b8e3c2a1-4f6d-4a1e-9c2b-1d7e5a8f3c90", "siteId": "f1a2b3c4-d5e6-4789-a012-3456789abcde", "name": "Documentation sitemap", "url": "https://docs.example.com/sitemap.xml", "isEnabled": true, "displayOrder": 0, "createdAt": "2026-05-12T09:14:03.221+00:00", "updatedAt": "2026-05-12T09:14:03.221+00:00" }, { "id": "c9f4d3b2-5a7e-4b2f-8d3c-2e8f6b9a4d01", "siteId": "f1a2b3c4-d5e6-4789-a012-3456789abcde", "name": "Shop sitemap", "url": "https://shop.example.com/sitemap.xml", "isEnabled": false, "displayOrder": 1, "createdAt": "2026-05-10T17:42:55.108+00:00", "updatedAt": "2026-05-11T08:01:12.640+00:00" } ] } ``` --- --- # List site blocks **Published**: 2026-11-30 **Category**: Core CMS ## `GET /site-blocks` **List site blocks** Returns the site's blocks, ordered by type then display order, with the locales each block is translated into. Filter with the `type` (`global` or `page`), `locale` and `tag` query parameters. The list is not paginated. Required permissions: `site_blocks.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/site-blocks \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "1ad1b2e2-d625-5133-8e5c-37a3b44aaa99", "type": "global", "slug": "header", "name": "Header", "path": null, "locale": "en", "isMaster": true, "status": "published", "tags": [], "publishedAt": "2025-03-20T11:00:00.000Z", "updatedAt": "2025-03-20T11:00:00.000Z", "translations": { "translationGroupId": "0c3f6a8e-1d2b-5c4e-9f7a-2b8d4e6f1a3c", "available": [ "en", "fr" ], "missing": [] } }, { "id": "8f7a2eb9-58e2-5f5a-a6ce-29ce19bbbfd3", "type": "page", "slug": "about", "name": "About Page", "path": "/about", "locale": "en", "isMaster": true, "status": "published", "tags": [ "about" ], "publishedAt": "2025-04-01T08:30:00.000Z", "updatedAt": "2025-04-01T08:30:00.000Z", "translations": { "translationGroupId": "5e9b2c7d-4a1f-5b3e-8c6d-7f2a9e4b1c5d", "available": [ "en" ], "missing": [ "fr" ] } }, { "id": "69841dba-82b2-5264-a435-872d13149201", "type": "global", "slug": "footer", "name": "Footer", "path": null, "locale": "en", "isMaster": true, "status": "draft", "tags": [], "publishedAt": null, "updatedAt": "2025-02-15T10:00:00.000Z", "translations": { "translationGroupId": "a7d4e1b8-2c5f-5e9a-b3d6-4f8c1e7a2b9d", "available": [ "en" ], "missing": [ "fr" ] } } ] } ``` --- --- # Get growing pages **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /integrations/google/growing-pages` **Get growing pages** Returns the pages whose average position improved the most compared with the previous period of the same length. Answers an empty list when the site has no Search Console data. Data older than the plan's analytics retention is not returned, the previous period included, and `data.period` gives the dates used. `meta.capped` is true when rows exist beyond the 1000-row ceiling. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks the Search Console integration or query trend analysis. Required permissions: `analytics.gsc` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `period` | query | "7d" \| "30d" \| "90d" \| "3m" \| "6m" \| "12m" | No | Window ending 3 days before today, `30d` by default. Ignored when both dates are sent. | | `startDate` | query | string | No | First day of the window. Used only together with `endDate`. | | `endDate` | query | string | No | Last day of the window. Used only together with `startDate`. | | `limit` | query | integer (1 to 1000) | No | Rows returned, 10 by default. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Response Example ```json { "data": { "period": { "startDate": "2026-05-01", "endDate": "2026-05-30" }, "growingPages": [ { "page": "https://www.example.com/blog/getting-started", "currentPosition": 6.3, "previousPosition": 8.1, "positionChange": 1.8, "currentClicks": 450, "currentImpressions": 8200, "clicksChange": 80, "impressionsChange": 1100 } ] }, "meta": { "capped": false } } ``` --- --- # Import sitemap entries **Published**: 2026-11-30 **Category**: SEO & Analytics ## `POST /sitemap/entries/import` **Import sitemap entries** Creates manual sitemap entries in bulk. Send `multipart/form-data` with a CSV in `file`, or JSON with an `entries` array. CSV columns: `url` (required), `is_external`, `priority`, `changefreq`, `title`, `locale`, `hreflang_group_id`. A CSV row without `url` is ignored, an invalid one is counted in `errors`, and `is_external` is false unless the cell is `true`. An invalid JSON entry fails the request with 422. Paths are normalized as on create. A URL already stored or repeated in the import is skipped. Nothing is written when a row has a locale the site does not enable, a group without a locale, or a group locale already taken: 422 `VALIDATION_FIELD_INVALID`. Nor when the new entries exceed the plan's entry limit: 402 `SUBSCRIPTION_QUOTA_EXCEEDED`. A malformed CSV, or one without a data row, returns 400. A file that is not `.csv`, is over 10 MB or has over 1000 header columns returns 422. Required permissions: `sitemap.import` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `entries` | object[] | Yes | Required | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/sitemap/entries/import \ -H "Authorization: Bearer $API_TOKEN" \ -F "file=@sitemap-entries.csv" ``` ### Response Example ```json { "data": { "message": "Import completed", "imported": 8, "skipped": 1, "errors": 0, "errorDetails": [] } } ``` --- --- # Update a sitemap source **Published**: 2026-11-30 **Category**: SEO & Analytics ## `PUT /sitemap/sources/:id` **Update a sitemap source** Updates the fields you send. Set `isEnabled` to false to drop the source from `sitemap.xml` without deleting it. Errors: 404 for an unknown source, 422 for a new `url` that is not a public `http(s)` address. Required permissions: `sitemap.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-255 characters | | `url` | string | No | Valid URL | | `isEnabled` | boolean | No | Whether the external sitemap is listed in the `sitemap.xml` index. Defaults to `true` on create | | `displayOrder` | number | No | Sort position: in ascending order, lower values come first | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X PUT "https://api.lynkow.com/v1/sitemap/sources/b8e3c2a1-4f6d-4a1e-9c2b-1d7e5a8f3c90" \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Docs sitemap (renamed)", "isEnabled": false, "displayOrder": 2 }' ``` ### Response Example ```json { "data": { "id": "b8e3c2a1-4f6d-4a1e-9c2b-1d7e5a8f3c90", "siteId": "f1a2b3c4-d5e6-4789-a012-3456789abcde", "name": "Docs sitemap (renamed)", "url": "https://docs.example.com/sitemap.xml", "isEnabled": false, "displayOrder": 2, "createdAt": "2026-05-12T09:14:03.221+00:00", "updatedAt": "2026-06-07T11:30:48.512+00:00" } } ``` --- --- # Update a sitemap rule **Published**: 2026-11-30 **Category**: SEO & Analytics ## `PUT /sitemap/rules/:id` **Update a sitemap rule** Updates the fields you send and leaves the others unchanged. Fires the `sitemap_rule.updated` webhook. Errors: 404 when the rule does not exist. 409 when another rule has the same `sourceType` and `sourceValue`. Required permissions: `sitemap.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `sourceType` | "content_type" \| "category" \| "tag" \| "path_pattern" | No | One of: content_type, category, tag, path_pattern | | `sourceValue` | string | No | 1-255 characters | | `priority` | number (0 to 1) | No | Priority given to the URLs matching the rule when they carry none of their own | | `changefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" | No | One of: always, hourly, daily, weekly, monthly, yearly, never | | `ruleOrder` | number | No | Rank among the rules matching the same URL: the highest applies, and the newest rule wins a tie. Defaults to `0` on create | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Response Example ```json { "data": { "id": "578ad888-8d92-5f92-b4d2-e1e6303e8566", "siteId": "a1b2c3d4-e5f6-4890-abcd-ef1234567890", "sourceType": "category", "sourceValue": "guides", "priority": 0.8, "changefreq": "monthly", "ruleOrder": 5, "createdAt": "2025-02-01T10:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # Get Google Indexing API statistics **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /seo/google-indexing/stats` **Get Google Indexing API statistics** Counts the site's Google Indexing API submissions of the last 12 months: `total`, `success` and `failed`. `last30Days` and `last7Days` give the total and successful counts over those windows. Required permissions: `seo.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/seo/google-indexing/stats \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "total": 85, "success": 78, "failed": 7, "last30Days": { "total": 30, "success": 28 }, "last7Days": { "total": 9, "success": 8 } } } ``` --- --- # List referrers and traffic sources **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/referrers` **List referrers and traffic sources** Returns the top referring domains and the visitor split by traffic source over the period. `limit` caps the referrers (default 20, at most 100). Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `entry_page`. With `compare=previous` or `compare=yoy`, each referrer carries a `trend` percentage and each traffic source a `prevVisitors` count. Both are `null` when the comparison period starts before your plan's analytics retention: the count is unknown. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/referrers?period=30d&limit=20" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "referrers": [ { "referrerDomain": "search.example.com", "trafficSource": "organic", "visitors": 1820, "pageviews": 2410, "bounceRate": 38 }, { "referrerDomain": "social.example.com", "trafficSource": "social", "visitors": 640, "pageviews": 810, "bounceRate": 52 } ], "trafficSources": [ { "source": "organic", "visitors": 2410, "percentage": 48.2 }, { "source": "direct", "visitors": 1500, "percentage": 30 }, { "source": "social", "visitors": 810, "percentage": 16.2 } ] } } ``` --- --- # Update analytics settings **Published**: 2026-11-30 **Category**: SEO & Analytics ## `PUT /analytics/settings` **Update analytics settings** Updates the tracking toggle and the excluded paths and IP addresses, then returns the settings as the GET does. Omitted fields keep their value. A list you send replaces the stored one. With `tracking_enabled: false`, events sent by the tracker are discarded. An excluded IPv4 entry also matches a visitor whose IPv6 address maps it (`::ffff:10.0.0.7`). Retention cannot be changed here: `raw_events_retention_days` and `aggregated_retention_days` are ignored. Errors: 422 for an invalid body, such as a list over 200 entries or an IP entry in none of the accepted forms (a lone `*`, `10.0.*.1`). Required permissions: `analytics.settings` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `tracking_enabled` | boolean | No | Set `false` to stop recording visits: the storefront still answers `204` to events and discards them | | `excluded_paths` | string[] | No | Page paths excluded from tracking: at most 200 entries of up to 500 characters each. An entry matches that exact path, or, ending with *, every path starting with the text before it (/admin*). Replaces the stored list | | `excluded_ips` | string[] | No | Visitor IP addresses excluded from tracking: at most 200 entries of up to 64 characters each. Each entry is an exact IPv4 or IPv6 address, an IPv4 address whose last one to three octets are * (10.0.0.*, 10.0.*.*, 10.*.*.*), or a CIDR range (10.0.0.0/24, 2001:db8::/32); any other entry returns 422. Replaces the stored list | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/settings" \ -X PUT \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "tracking_enabled": true, "excluded_paths": ["/admin", "/preview"], "excluded_ips": ["203.0.113.10", "198.51.100.*", "192.0.2.0/24"] }' ``` ### Response Example ```json { "data": { "id": "a814a7e3-27c4-5630-9ab0-5451ba1d62c7", "siteId": "9f1c2d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f", "trackingEnabled": true, "rawEventsRetentionDays": 365, "aggregatedRetentionDays": 1825, "excludedPaths": [ "/admin", "/preview" ], "excludedIps": [ "203.0.113.10", "198.51.100.*", "192.0.2.0/24" ] } } ``` --- --- # Delete a redirect **Published**: 2026-11-30 **Category**: SEO & Analytics ## `DELETE /redirects/:id` **Delete a redirect** Permanently deletes a redirect rule and fires the `redirect.deleted` webhook. 404 for an unknown redirect. Required permissions: `redirects.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/redirects/b069bbd4-7635-5dca-ab76-626b56fce8c2 \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Delete a product option translation **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /products/:id/options/:optionId/translations/:locale` **Delete a product option translation** Deletes the translated title and value labels of a product option in one language, which then falls back to its base title and labels. Returns 204, also when nothing was translated. An option that does not belong to the product returns 404. Fires `product.translated`. The product's source language, or a language not enabled on the site, returns 422 on `locale`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `optionId` | path | string | Yes | Product option UUID | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Create or update a product option translation **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id/options/:optionId/translations/:locale` **Create or update a product option translation** Writes the title of a product option and the labels of its values in one language, then returns the product's translation in that language, with 200 in both cases. Send `title`, `values` or both. `values` maps a value id to its label; stored labels of values not sent are kept. A blank title or label returns 422. An option or value that does not belong to the product returns 404. Fires `product.translated`. The product's source language, or a language not enabled on the site, returns 422 on `locale`. A caller without `products.view` receives an acknowledgement instead of the translation. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `optionId` | path | string | Yes | Product option UUID | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `title` | string \| null | No | Display title | | `values` | object | No | Value labels in this language, keyed by value id. An unsent value keeps its label, and an untranslated one shows the source label | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List sitemap rules **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /sitemap/rules` **List sitemap rules** Returns every sitemap rule of the site, unpaginated, in the order they apply: highest `ruleOrder` first, then newest first. When several rules match a generated URL, the first one in this list sets its priority and change frequency. Required permissions: `sitemap.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/sitemap/rules \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "a53c5341-1f4a-5f67-a83d-f9dcb8a383d3", "siteId": "a1b2c3d4-e5f6-4890-abcd-ef1234567890", "sourceType": "path_pattern", "sourceValue": "/docs/*", "priority": 0.7, "changefreq": "weekly", "ruleOrder": 10, "createdAt": "2025-02-01T10:00:00.000Z", "updatedAt": "2025-02-01T10:00:00.000Z" } ] } ``` --- --- # Hide a product in markets **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id/market-visibility` **Hide a product in markets** Replace the list of markets the product is hidden in with `hiddenMarkets`, the identifiers of this site's markets, and answer the stored list. An empty list shows the product in every market. A product hidden in a market cannot be ordered for delivery to an address in that market. Sending the stored list again changes nothing. A change sends a `product.updated` webhook event. Errors: `422` on `hiddenMarkets` when a market is unknown, `404` when the product is unknown. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `hiddenMarkets` | string[] | Yes | Required. Identifiers (mkt_ prefixed id) of this site's markets the product is hidden in, at most 100. Replaces the stored list; an empty list shows the product in every market | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | The product does not exist on this site, or markets are not available on this site. | | `422` | A market identifier is malformed, unknown, or belongs to another site. The error names `hiddenMarkets`. | ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/products/$PRODUCT_ID/market-visibility \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "hiddenMarkets": ["mkt_01hx3k8z5q2r7t9v4w6y8a0c2e"] }' ``` --- --- # Get IndexNow statistics **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /seo/indexnow/stats` **Get IndexNow statistics** Counts the site's IndexNow submissions of the last 12 months: `total`, `success` and `failed`. `last30Days` and `last7Days` give the total and successful counts over those windows. Required permissions: `seo.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/seo/indexnow/stats \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "total": 150, "success": 142, "failed": 8, "last30Days": { "total": 45, "success": 43 }, "last7Days": { "total": 12, "success": 12 } } } ``` --- --- # Update a product option **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id/options/:optionId` **Update a product option** Updates an option. A `values` list replaces its values; removing a value a variant still uses returns 422. Fires `product_option.updated` when something changed. A caller without `products.view` receives an acknowledgement instead of the option. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `optionId` | path | string | Yes | Product option UUID | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `title` | string | No | Display title. 1-255 characters | | `position` | integer (0 to 1000000) | No | Display position among sibling resources | | `metadata` | object | No | Custom key-value metadata | | `values` | object[] | No | Replaces the value list, matched by `value`: an unlisted value is deleted, or 422 while a variant uses it | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Create a product option **Published**: 2026-11-30 **Category**: Commerce ## `POST /products/:id/options` **Create a product option** Adds an option, such as size or color, with its values to a product. A product holds at most 3 options, each title once. Add options before creating variants: a product that already has variants, or a bookable product, returns 422. Fires the `product_option.created` webhook. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.create` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `title` | string | Yes | Required. Display title. 1-255 characters | | `position` | integer (0 to 1000000) | No | Display position among sibling resources | | `metadata` | object | No | Custom key-value metadata | | `values` | object[] | No | The option's values in display order; an entry without `position` takes its index in the list | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Get IndexNow submission logs **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /seo/indexnow/logs` **Get IndexNow submission logs** Lists the site's IndexNow submissions of the last 12 months, newest first, 20 per page by default. A batch submission is one row: `url` is its first URL and `urlCount` the number of URLs sent. A failed submission carries the IndexNow `httpStatus` and an `errorMessage`. Required permissions: `seo.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | integer (min 1) | No | Page number, from 1. | | `limit` | query | integer (1 to 100) | No | Rows per page, 20 by default. | | `success` | query | boolean | No | Only successful (`true`) or failed (`false`) submissions. | | `source` | query | string | No | Only submissions of this source, `update` for one URL or `bulk` for a batch. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/seo/indexnow/logs?success=false" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "2dc7285d-f9e3-50e0-9581-1c38ed824dc0", "url": "https://www.example.com/blog/getting-started", "urlCount": 1, "source": "update", "success": true, "httpStatus": 200, "errorMessage": null, "createdAt": "2025-04-05T10:30:00.000Z" }, { "id": "20ede0f4-779b-552a-8796-37d545073acf", "url": "https://www.example.com/blog/new-features", "urlCount": 12, "source": "bulk", "success": true, "httpStatus": 202, "errorMessage": null, "createdAt": "2025-04-04T14:00:00.000Z" } ], "meta": { "total": 150, "perPage": 20, "currentPage": 1, "lastPage": 8 } } ``` --- --- # Create or update a product variant translation **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id/variants/:variantId/translations/:locale` **Create or update a product variant translation** Sets a variant's title in one language with `titleOverride`, which replaces the title built from the translated option values, then returns the product's translation in that language with 200. A blank `titleOverride` returns 422. A variant that does not belong to the product returns 404. Fires `product.translated`. The product's source language, or a language not enabled on the site, returns 422 on `locale`. A caller without `products.view` receives an acknowledgement instead of the translation. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `variantId` | path | string | Yes | Product variant identifier (var_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `titleOverride` | string | Yes | Required. Max 255 characters | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Get llms.txt **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /llms.txt` **Get llms.txt** Returns an index of your site's content in the `llms.txt` format: the published articles and pages, each linked to its Markdown rendering (its URL with a `.md` suffix). On a site with a product catalog, the index also carries the sections `## Products`, `## Product categories` and `## Collections`, whose lines link to the page itself, with no `.md` suffix, and never carry a price or a stock. Articles, pages, products, product categories and collections marked noindex are left out. On a multi-language site, `?locale=` selects the language; a locale the site does not enable returns 404. 404 `RESOURCE_NOT_FOUND` when llms.txt is disabled for the site. Required permissions: `seo.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash # Returns Markdown text - not JSON curl https://api.lynkow.com/v1/llms.txt \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ``` # My Website > A headless CMS platform. ## Sitemap - [Sitemap XML](https://www.example.com/sitemap.xml) ## Blog - [Getting Started with Lynkow](https://www.example.com/blog/getting-started.md) - [Advanced Configuration](https://www.example.com/blog/advanced-configuration.md) ## Products - [Linen Shirt](https://www.example.com/products/linen-shirt) ## Pages - [About](https://www.example.com/about.md) ``` --- --- # Test IndexNow configuration **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /seo/indexnow/test` **Test IndexNow configuration** Checks that IndexNow is live: fetches `https://{domain}/{key}.txt` from the site and compares its content with the stored key. One https redirect between the domain and its `www` form is followed. On success, the check time is stored in `indexNowLastVerifiedAt`. Errors (400): `INDEXNOW_DISABLED`, `INDEXNOW_NO_KEY`, `INDEXNOW_NO_DOMAIN`, `INDEXNOW_VERIFICATION_FAILED`. The last one covers any failed fetch or mismatched content, without upstream details. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks IndexNow. Required permissions: `seo.update` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | IndexNow is disabled, its key or the site domain is missing, or the live verification failed. The `code` tells which. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | > **Notes:** - Publish the key file on your site first. A token holding `seo.update` reads the full key from `GET /seo/settings`. ### Examples ```bash curl https://api.lynkow.com/v1/seo/indexnow/test \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "success": true, "message": "IndexNow configuration verified successfully", "verifiedAt": "2025-04-05T10:30:00.000Z" } } ``` --- --- # Replace a site block's tags **Published**: 2026-11-30 **Category**: Core CMS ## `PUT /site-blocks/:slug/tags` **Replace a site block's tags** Replaces the tag list of a site block with the `tags` array from the body. Nothing else on the block changes. Each tag is 1 to 50 lowercase letters, digits or hyphens, at most 10 per block, otherwise the call returns 422. The admin dashboard reads a page's category from its tags: `legal`, `privacy`, `terms`, `cookies`, `contact`, `about` or `faq`, at most one per page. Any other tag is free-form, and the public page listing filters by tag. Returns the block, or to a token without `site_blocks.view` an acknowledgement: `id`, `status`, `publishedAt`, `createdAt` and `updatedAt`. Returns 404 when no block matches the slug and locale. Required permissions: `site_blocks.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `tags` | string[] | Yes | The full tag list of the block, per locale: 1 to 50 lowercase letters, digits or hyphens each, at most 10. Replaces every existing tag, and an empty array clears them | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr"). 2-10 characters | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | > **Notes:** - Send the full list: a tag left out is removed, and `[]` clears every tag. > > - Tags are per locale. Pass `locale` to target a translation, otherwise the master row is used: the one in the site's default locale when several exist, otherwise the oldest. > - A change fires the `site_block.updated` webhook but adds no revision. Resending the current list does nothing. ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/site-blocks/legal-notice/tags \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "locale": "en", "tags": ["legal"] }' ``` ### Response Example ```json { "data": { "id": "5b7e2c1a-3d4f-4a6b-8c9d-0e1f2a3b4c5d", "name": "Legal notice", "slug": "legal-notice", "type": "page", "status": "published", "locale": "en", "tags": [ "legal" ], "updatedAt": "2025-04-06T14:45:00.000Z" } } ``` --- --- # List visitors by country **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/countries` **List visitors by country** Returns the top countries by visitors over the period. `limit` caps the list (default 50, at most 100). Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `path` and `language`. With `compare=previous` or `compare=yoy`, each country carries a `trend` percentage. With `content_locale` set, it is `null` when the comparison period starts before your plan's analytics retention. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/countries?period=30d&limit=50" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "countryCode": "FR", "countryName": "France", "visitors": 4120, "pageviews": 9870 }, { "countryCode": "US", "countryName": "United States", "visitors": 2310, "pageviews": 5440 }, { "countryCode": "DE", "countryName": "Germany", "visitors": 980, "pageviews": 2110 } ] } ``` --- --- # Hide or show a product in a language **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id/translations/:locale/visibility` **Hide or show a product in a language** Hides (`hidden: true`) or shows (`hidden: false`) the product in one language enabled on the site, its source language included. No translation is needed. Fires `product.translated` when the visibility changes. A language not enabled on the site returns 422 on `locale`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `hidden` | boolean | Yes | Whether the product is hidden in this language. Any language enabled on the site is accepted, the source language included, and no translation is needed | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Get content-only XML sitemap **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /seo/sitemap-content.xml` **Get content-only XML sitemap** Returns the site's own sitemap, without the external sitemap sources. While its URLs fit in one part (50,000 URLs and 50 MB uncompressed), it is one XML ``, the same one `GET /seo/sitemap-1.xml` returns. Otherwise it is a `` listing `https://{domain}/sitemap-1.xml` to `https://{domain}/sitemap-{N}.xml`. On a multi-language site each `` carries `xhtml:link` hreflang alternates for its translations. A change shows within 5 minutes, most within seconds. Required permissions: `sitemap.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash # Returns XML - pipe to file or parse with xmllint curl https://api.lynkow.com/v1/seo/sitemap-content.xml \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ``` https://www.example.com/blog/getting-started 2026-05-30 weekly 0.8 https://www.example.com/about 2026-04-18 monthly 0.5 ``` --- --- # Delete a product translation **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /products/:id/translations/:locale` **Delete a product translation** Deletes the product's translation in one language, with the option titles, value labels and variant titles of that language. The product then serves its base text there. Returns 204, also when no translation existed. On a published product with its own translated slug, a 301 redirect is created from that URL to the base-slug URL in the same language. Fires `product.translated`. The product's source language, or a language not enabled on the site, returns 422 on `locale`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Get SEO settings **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /seo/settings` **Get SEO settings** Returns the site's SEO settings: robots rules, sitemap defaults and per-type toggles, blog and commerce URL prefixes, IndexNow, Google Indexing, llms.txt, search and the site JSON-LD graph. A site that never saved them gets the defaults. `commercePrefixTranslations` maps an enabled language other than the default to its own commerce URL segments: `{ "fr": { "productPrefix": "produits" } }` gives `/fr/produits/{slug}`. A segment it leaves out uses the base prefix of the same name. `indexNowKey` is masked to a short prefix plus an ellipsis (`abc1…`) unless the token also holds `seo.update`. It is `null` when no key is set. Required permissions: `seo.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/seo/settings \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": 1, "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "robotsRules": [ { "userAgent": "*", "rules": [ { "path": "/", "allow": true }, { "path": "/admin", "allow": false }, { "path": "/api", "allow": false } ] } ], "robotsSitemapLink": true, "defaultPriority": 0.5, "defaultChangefreq": "weekly", "includeContentsInSitemap": true, "includePagesInSitemap": true, "includeCategoriesInSitemap": false, "includeProductsInSitemap": true, "includeProductCategoriesInSitemap": true, "includeProductCollectionsInSitemap": true, "nestProductsUnderCategory": false, "productPrefix": "products", "productCategoryPrefix": "product-categories", "productCollectionPrefix": "collections", "commercePrefixTranslations": { "fr": { "productPrefix": "produits" } }, "contentPathPrefixes": {}, "contentTypePriorities": {}, "blogUrlMode": "flat", "blogPrefix": null, "defaultAuthorName": "Editorial Team", "defaultAuthorUrl": null, "indexNowKey": "abc1…", "indexNowEnabled": true, "indexNowLastVerifiedAt": "2025-04-01T10:00:00.000Z", "googleIndexingEnabled": false, "llmsTxtEnabled": true, "llmsSiteDescription": "Lynkow is a headless CMS platform.", "searchEnabled": true, "searchIncludeCommerce": false, "jsonLdGraph": [], "createdAt": "2025-01-01T00:00:00.000Z", "updatedAt": "2025-04-05T14:30:00.000Z" } } ``` --- --- # Create or update a product translation **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id/translations/:locale` **Create or update a product translation** Creates or updates the product's translation in one language and returns it, with 200 in both cases. Every field is optional and null clears it, so the language falls back to the base text. `title` is required when the translation does not exist yet. Without `slug`, a new translation takes one derived from its title, suffixed `-2`, `-3` when taken, and an update keeps the stored one. An explicit `slug` another product holds, in any language, returns 409 on `slug`. `gallery` keys must be stored paths of the product's images. When the translated slug of a published product changes, a 301 redirect from its previous URL in that language is created and counted in the response. Fires `product.translated`. The product's source language, or a language not enabled on the site, returns 422 on `locale`. A caller without `products.view` receives an acknowledgement instead of the translation. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `title` | string | No | Display title. 1-500 characters | | `slug` | string | No | Slug of this translation, used in the URL in that language. It must be free among the other live products' base slugs and their translated slugs in that same language. When a new translation omits it (or sends it empty), it is derived from the translated label, else from the source slug, and suffixed -2, -3, ... when taken; an update that omits it keeps the stored slug. A slug sent explicitly and already taken is a 409 on slug and nothing is written | | `description` | string \| null | No | Description text | | `seoTitle` | string \| null | No | Search-engine title override | | `seoDescription` | string \| null | No | Search-engine description override | | `keywords` | string \| null | No | Comma-separated SEO keywords | | `canonicalUrl` | string \| null | No | Canonical URL override | | `ogTitle` | string \| null | No | Open Graph title used when the page is shared on social networks | | `ogDescription` | string \| null | No | Open Graph description used when the page is shared on social networks | | `ogImageAlt` | string \| null | No | Alternative text of the Open Graph image | | `gallery` | object \| null | No | Per-language alt text and caption of the product's images: an object keyed by the stored path of an image of the product's own gallery, each value carrying alt and caption (null clears one). It replaces the stored map; null clears it. At most 20 keys; a key that is not a path of the product's gallery is a 422 on gallery | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Get XML sitemap **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /seo/sitemap.xml` **Get XML sitemap** Returns the site's XML sitemap: the manual sitemap entries, then the published articles, article category archives, pages and commerce pages the SEO settings include. The site's own URLs are cut into parts of at most 50,000 URLs and 50 MB uncompressed. With one part and no external sitemap source enabled, the response is a ``. With one part and an enabled source, it is a `` listing `https://{domain}/sitemap-content.xml`, then the sources. With several parts, it is a `` listing `https://{domain}/sitemap-1.xml` to `https://{domain}/sitemap-{N}.xml`, then the sources. Read a part with `GET /seo/sitemap-{n}.xml`. A change shows within 5 minutes, most within seconds. Required permissions: `sitemap.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash # Returns XML - pipe to file or parse with xmllint curl https://api.lynkow.com/v1/seo/sitemap.xml \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ``` https://example.com/blog/getting-started 2025-04-05 weekly 0.8 ``` --- --- # Get robots.txt **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /seo/robots.txt` **Get robots.txt** Returns the site's robots.txt as plain text, built from `robotsRules`. With no rules set, it allows `/` and disallows `/admin` and `/api`. A `Sitemap: https://{domain}/sitemap.xml` line follows unless `robotsSitemapLink` is false. When llms.txt is enabled, Googlebot and Bingbot are also disallowed from `/llms.txt` and `/llms-full.txt`. Required permissions: `seo.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash # Returns plain text (Content-Type: text/plain) curl https://api.lynkow.com/v1/seo/robots.txt \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ``` User-agent: * Allow: / Disallow: /admin Disallow: /api Sitemap: https://www.example.com/sitemap.xml ``` --- --- # Copy review to another locale **Published**: 2026-11-30 **Category**: Forms & Reviews ## `POST /reviews/:id/copy-to-locale` **Copy review to another locale** Copies this review into `targetLocale` as a new translation of it. The copy keeps the author details, rating, content, title, product fields, custom fields and review date as they are, ready to translate. It starts as `pending` and not featured. Requires `reviews.create` and `reviews.view`. Fires the `review.created` and `review.translated` webhooks. Errors: 400 when the site is not multi-language or does not enable `targetLocale`, 409 `RESOURCE_ALREADY_EXISTS` when the review already has a translation in that locale. An unknown review returns 404. Required permissions: `reviews.create`, `reviews.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `targetLocale` | string | Yes | Required. BCP 47 locale code of the locale to copy into (e.g. "fr", "es"). Must be enabled on the site. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | The site is not multi-language, or does not enable the target locale. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | `RESOURCE_ALREADY_EXISTS`: the review already has a translation in the target locale. The message carries that translation's id. | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/reviews/812de5a8-d9dc-585a-8cf2-03c54d3a3141/copy-to-locale \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"targetLocale": "fr"}' ``` ### Response Example ```json { "data": { "id": "54d3fc48-2e70-5c5b-8cdd-95481d9d8f35", "authorName": "Marie Dupont", "locale": "fr", "slug": "excellent-platform", "status": "pending" } } ``` --- --- # Get a product translation **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:id/translations/:locale` **Get a product translation** Returns the product's translation in one language, with the translated option titles, value labels and variant titles. A language without a translation returns 200 with `status` `missing` and null fields. The product's source language, or a language not enabled on the site, returns 422 on `locale`. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | | `locale` | path | string | Yes | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Get review translation status **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /reviews/:id/translations` **Get review translation status** Returns the translation status of this review in every enabled site locale. Each entry carries `locale`, `exists` and `needsReview` (true when that translation was written against a default-language version of the review that has changed since). When the locale has a translation, the entry also carries its `id`, `title` (the author name when the review has no title), `status` and `updatedAt`. Required permissions: `reviews.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/reviews/95033a7d-1640-5e0b-aec8-61967c83d356/translations \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "translationGroupId": "8e0f5b4d-6a7c-4d9e-bf2a-3b4c5d6e7f80", "currentLocale": "en", "translations": [ { "locale": "en", "exists": true, "needsReview": false, "id": "95033a7d-1640-5e0b-aec8-61967c83d356", "title": "Excellent platform", "status": "approved", "updatedAt": "2025-03-20T08:15:00.000Z" }, { "locale": "fr", "exists": true, "needsReview": true, "id": "54d3fc48-2e70-5c5b-8cdd-95481d9d8f35", "title": "Marie Dupont", "status": "pending", "updatedAt": "2025-04-06T15:00:00.000Z" }, { "locale": "es", "exists": false, "needsReview": false } ] } } ``` --- --- # List a product's translations **Published**: 2026-11-30 **Category**: Commerce ## `GET /products/:id/translations` **List a product's translations** Returns the translation status of the product in every language enabled on the site except its source language, missing translations included. `needs_review` means the base text changed after the translation was written. An unknown product returns 404. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Response Example ```json { "data": { "sourceLocale": "en", "sourceHidden": false, "translations": [ { "locale": "fr", "status": "translated", "hidden": false, "slug": "t-shirt-classique", "updatedAt": "2025-04-07T09:30:00.000Z" }, { "locale": "es", "status": "missing", "hidden": false, "slug": null, "updatedAt": null } ] } } ``` --- --- # Get JSON sitemap **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /seo/sitemap.json` **Get JSON sitemap** Returns the URLs of the XML sitemap as one JSON list: manual entries first, then article category archives, articles, pages and commerce pages, each type behind its SEO settings toggle. Each URL carries the priority and change frequency the XML sitemap gives it. On a multi-language site each URL also carries its `locale` and the `alternates` of its translations. The list is never split into parts and leaves out external sitemap sources. It reflects a change at once, while the XML sitemap can take up to 5 minutes. Required permissions: `sitemap.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/seo/sitemap.json \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "domain": "www.example.com", "blogUrlMode": "flat", "multiLanguageEnabled": false, "defaultLocale": "en", "generatedAt": "2025-04-05T10:30:00.000Z", "urlCount": 4, "urls": [ { "url": "https://www.example.com/pricing", "lastModified": "2025-04-01T09:00:00.000Z", "changefreq": "monthly", "priority": 0.8, "source": "manual", "title": "Pricing" }, { "url": "https://www.example.com/blog/getting-started", "lastModified": "2025-04-05T08:12:00.000Z", "changefreq": "weekly", "priority": 0.8, "source": "cms", "title": "Getting started" }, { "url": "https://www.example.com/about", "lastModified": "2025-03-20T14:00:00.000Z", "changefreq": "monthly", "priority": 0.6, "source": "cms", "title": "About" }, { "url": "https://www.example.com/products/linen-shirt", "lastModified": "2025-04-02T16:45:00.000Z", "changefreq": "weekly", "priority": 0.5, "source": "cms", "title": "Linen shirt" } ] } } ``` --- --- # Set product status **Published**: 2026-11-30 **Category**: Commerce ## `POST /products/:id/status` **Set product status** Moves the product to `draft`, `published` or `archived`. Publishing needs the `products.publish` permission, the other targets `products.update`, else 403. Publishing returns 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the site has reached its plan's published-product limit, and 422 for a bookable product without weekly availability. It also removes the automatic redirects whose source is one of the product's URLs; your own redirects stay. Fires `product.published`, `product.archived`, or `product.updated` for `draft`. A caller without `products.view` receives an acknowledgement instead of the product. > **Note:** Available only on sites with e-commerce enabled. Required permissions (any one of): `products.publish`, `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `status` | "draft" \| "published" \| "archived" | Yes | Required. One of: draft, published, archived | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # Delete a product **Published**: 2026-11-30 **Category**: Commerce ## `DELETE /products/:id` **Delete a product** Soft-deletes the product with its variants and archives its reservation offerings. Its slug and the variants' SKUs become free for reuse. Fires the `product.deleted` webhook. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | --- --- # Update a product **Published**: 2026-11-30 **Category**: Commerce ## `PUT /products/:id` **Update a product** Updates the fields sent and keeps the others; null clears an optional field. A title change keeps the slug. A new `slug` another product already holds, in any language, gets a `-2`, `-3` suffix. `compareAtPriceCents` must exceed the resulting price. An `ogImageUrl` that replaces or removes the image, sent without `ogImageAlt`, clears the stored alternative text. Changing `kind` returns 422 while the product has live variants or reservation offerings, and a published product needs weekly availability before it turns bookable. When a published product's URL moves (new `slug`, or new `categoryId` while products nest under their category), a 301 redirect is created for each language whose URL moved, counted in `redirectsCreated` and `redirectsSkipped`. A `jsonLdGraph` or `jsonLdExclusions` entry the stored list lacks returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks advanced JSON-LD. Fires `product.updated` when something changed. A caller without `products.view` receives an acknowledgement instead of the product. Errors: 422 naming the refused field, a duplicate `sku` included. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Product identifier (prod_ prefixed id) | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `title` | string | No | Display title. 1-500 characters | | `slug` | string | No | Source-language slug of the product. Unique per site among the other live products' base slugs and their translated slugs in every language; a deleted product frees its slug. Omit it to keep the current slug (a title change never re-slugs). A taken slug is suffixed -2, -3, ... rather than refused, so read the slug from the response. Translated slugs are set with PUT /products/{id}/translations/{locale} | | `description` | string \| null | No | Description text | | `priceCents` | integer (0 to 99999999) | No | Price in the smallest currency unit (cents) | | `imageUrls` | string[] | No | Ordered URLs of media files of the site, for the product gallery. Cannot be sent with `gallery` | | `gallery` | object[] | No | Ordered product images, each a URL of a media file of the site with optional alternative text and caption | | `sku` | string \| null | No | Stock keeping unit, unique per site; an empty string stores none | | `compareAtPriceCents` | integer (0 to 99999999) \| null | No | Reference price in cents, such as the price before a discount; must exceed the price, null removes it | | `stockQuantity` | integer (0 to 2000000000) \| null | No | Units in stock; null means stock is not tracked | | `weightGrams` | integer (1 to 1000000) \| null | No | Shipping weight in whole grams, read when a shipping label is created; null clears it. A variant's weight overrides the product's | | `seoTitle` | string \| null | No | Search-engine title override | | `seoDescription` | string \| null | No | Search-engine description override | | `keywords` | string \| null | No | Comma-separated SEO keywords | | `canonicalUrl` | string \| null | No | Canonical URL override | | `ogTitle` | string \| null | No | Open Graph title used when the page is shared on social networks | | `ogDescription` | string \| null | No | Open Graph description used when the page is shared on social networks | | `ogImageUrl` | string \| null | No | Open Graph image URL; must be a media file of the current site's media library, or null to remove the image | | `ogImageAlt` | string \| null | No | Alternative text of the Open Graph image | | `twitterCard` | "summary" \| "summary_large_image" \| "app" \| "player" \| null | No | Card type used when the page is shared on social networks (summary, summary_large_image, app or player) | | `noIndex` | boolean | No | When true, asks search engines not to index the page (robots noindex) | | `noFollow` | boolean | No | When true, asks search engines not to follow the links of the page (robots nofollow) | | `sitemapPriority` | number (0 to 1) \| null | No | Sitemap priority (0.0-1.0) | | `sitemapChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" \| null | No | Sitemap change frequency (always, hourly, daily, weekly, monthly, yearly or never) | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | | `brand` | string \| null | No | Brand name of the product | | `gtin` | string \| null | No | Global Trade Item Number: 8, 12, 13 or 14 digits with a valid check digit | | `mpn` | string \| null | No | Manufacturer Part Number | | `metadata` | object | No | Custom key-value metadata | | `kind` | "standard" \| "bookable" | No | Product kind: standard or bookable. One of: standard, bookable | | `depositType` | "none" \| "percent" \| "fixed" | No | How the deposit charged at booking is computed; a new product has `none`. One of: none, percent, fixed | | `depositPercent` | integer (1 to 100) \| null | No | Deposit as a percentage of the price, sent with `depositType: percent` only | | `depositValueCents` | integer (1 to 99999999) \| null | No | Fixed deposit in cents, sent with `depositType: fixed` only | | `collectionId` | string \| null | No | Product collection identifier (col_ prefixed id) | | `categoryId` | string \| null | No | Product category identifier (pcat_ prefixed id) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | --- --- # List products **Published**: 2026-11-30 **Category**: Commerce ## `GET /products` **List products** Lists the site's products, 20 per page by default and at most 100. Filter by `status`, `collectionId` or `categoryId`, or match `search` against the title and slug. `categoryId` matches the directly assigned category only: products of its subcategories are left out. Deleted products are never listed. > **Note:** Available only on sites with e-commerce enabled. Required permissions: `products.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `status` | query | "draft" \| "published" \| "archived" | No | One of: draft, published, archived | | `collectionId` | query | string | No | Product collection identifier (col_ prefixed id) | | `categoryId` | query | string | No | Product category identifier (pcat_ prefixed id) | | `sortBy` | query | "title" \| "price_cents" \| "status" \| "created_at" \| "updated_at" | No | One of: title, price_cents, status, created_at, updated_at | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl "https://api.lynkow.com/v1/products?status=published&page=1&limit=10" \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Restore a block revision **Published**: 2026-11-30 **Category**: Core CMS ## `POST /site-blocks/:slug/revisions/:revisionId/restore` **Restore a block revision** Restores the data, SEO and JSON-LD configuration of a revision. The schema is not restored. The restore adds a revision and fires the `site_block.updated` webhook. A token without `site_blocks.view` receives an acknowledgement instead of the block. Required permissions: `site_blocks.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | | `revisionId` | path | string | Yes | Revision ID | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | The revision belongs to another block, or `revisionId` is not a valid UUID. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | No block with this slug exists in the requested locale
(`Block not found`), or no revision has this id (`Revision not found`).
| > **Notes:** - Without `locale`, the call targets the master row: the one in the site's default locale when several exist, otherwise the oldest. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/site-blocks/header/revisions/4d8e70a4-83e3-5432-9948-0293367cdef2/restore \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "89043468-ea1a-59a4-91c1-cf20a668ec33", "name": "Header", "slug": "header", "type": "global", "status": "published", "locale": "en", "data": { "logo": { "url": "https://cdn.lynkow.com/sites/abc123/logo.svg", "alt": "Company Logo" }, "navLinks": [ { "label": "Home", "url": "/" }, { "label": "Blog", "url": "/blog" }, { "label": "Contact", "url": "/contact" } ] }, "createdAt": "2025-01-05T09:00:00.000Z", "updatedAt": "2025-04-06T16:00:00.000Z" } } ``` --- --- # List block revisions **Published**: 2026-11-30 **Category**: Core CMS ## `GET /site-blocks/:slug/revisions` **List block revisions** Returns the paginated revision history of a site block, newest first. Use `page` and `limit` to page through it. Required permissions: `site_blocks.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | > **Notes:** - Without `locale`, the call targets the master row: the one in the site's default locale when several exist, otherwise the oldest. ### Examples ```bash curl https://api.lynkow.com/v1/site-blocks/header/revisions \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "d7bd22c9-5796-5151-857e-896d6a515758", "siteBlockId": "db6d9edb-286d-52d9-b7f2-1163f789cb62", "changes": [ { "field": "data.tagline", "from": null, "to": "Build faster with Lynkow" } ], "createdAt": "2025-04-06T14:30:00.000Z", "author": { "id": "aa1e1d51-f3e1-5161-8673-e76ecda550af", "fullName": "Jane Doe" } }, { "id": "61da1d6b-07db-5688-addf-87882104edff", "siteBlockId": "db6d9edb-286d-52d9-b7f2-1163f789cb62", "changes": [ { "field": "data.navLinks", "from": "3 items", "to": "2 items" } ], "createdAt": "2025-03-20T11:00:00.000Z", "author": { "id": "aa1e1d51-f3e1-5161-8673-e76ecda550af", "fullName": "Jane Doe" } } ] } ``` --- --- # Get block translation status **Published**: 2026-11-30 **Category**: Core CMS ## `GET /site-blocks/:slug/translations` **Get block translation status** Returns one entry per enabled locale telling whether the block is translated into it. `needsReview` is true when a translation was written against source text that has changed since. An existing translation also carries its `id`, `status` and `isMaster`. Required permissions: `site_blocks.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | > **Notes:** - The call targets the master row: the one in the site's default locale when several exist, otherwise the oldest. ### Examples ```bash curl https://api.lynkow.com/v1/site-blocks/header/translations \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "translationGroupId": "9b1d2e3f-4a5b-6c7d-8e9f-0a1b2c3d4e5f", "currentLocale": "en", "translations": [ { "locale": "en", "exists": true, "current": true, "id": "3c2a8f3b-1c2a-4d5e-6f70-8a9b0c1d2e3f", "status": "published", "isMaster": true, "needsReview": false }, { "locale": "fr", "exists": true, "current": false, "id": "7d4e1a2b-5c6f-4a8b-9c0d-1e2f3a4b5c6d", "status": "published", "isMaster": false, "needsReview": true }, { "locale": "es", "exists": false, "current": false, "needsReview": false } ] } } ``` --- --- # Set a site block's status **Published**: 2026-11-30 **Category**: Core CMS ## `POST /site-blocks/:slug/status` **Set a site block's status** Sets the block status to `published` (visible on the public site) or `draft` (hidden, data kept). Fires the `site_block.published` or `site_block.unpublished` webhook. A token without `site_blocks.view` receives an acknowledgement instead of the block. Required permissions: `site_blocks.publish` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `status` | "draft" \| "published" | Yes | Required. One of: draft, published | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | > **Notes:** - Without `locale`, the call targets the master row: the one in the site's default locale when several exist, otherwise the oldest. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/site-blocks/sidebar/status \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"status": "published"}' ``` ### Response Example ```json { "data": { "id": "243a9fd4-f1a3-561d-ac3b-2193f643de4d", "name": "Sidebar", "slug": "sidebar", "type": "global", "status": "published", "locale": "en", "updatedAt": "2025-04-06T15:00:00.000Z" } } ``` --- --- # Update block schema **Published**: 2026-11-30 **Category**: Core CMS ## `PUT /site-blocks/:slug/schema` **Update block schema** Replaces the field schema of a site block. Send `schema.fields` as an array. Existing data is kept: values for fields missing from the new schema stay stored but are no longer validated. Translations share the master schema, and each one gets a new revision. Fires the `site_block.schema_updated` webhook. Returns 400 for an invalid schema. Adding a data source field, or changing the source of one, returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks data source fields; the existing ones can stay. Required permissions: `site_blocks.schema` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `schema` | object | Yes | The new block schema. A missing `fields` array returns 400 | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | > **Notes:** - A schema holds at most 250 fields per level and 5 nesting levels. > > - A `reviews` dataSource returns approved reviews only: omit `config.status` or set `"approved"`. A stored value sent back unchanged is accepted. > - A `reviews` or `contents` dataSource sorts by public fields only. The 400 message lists the accepted `config.sort.field` values. A stored value sent back unchanged is accepted. > - The call targets the master row: the one in the site's default locale when several exist, otherwise the oldest. ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/site-blocks/header/schema \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "schema": { "fields": [ {"key": "logo", "type": "image", "label": "Logo"}, {"key": "tagline", "type": "string", "label": "Tagline"}, {"key": "navLinks", "type": "array", "label": "Navigation Links", "fields": [{"key": "label", "type": "string", "label": "Label"}, {"key": "url", "type": "url", "label": "URL"}]} ] } }' ``` ### Response Example ```json { "data": { "message": "Schema updated successfully" } } ``` --- --- # Create a site block **Published**: 2026-11-30 **Category**: Core CMS ## `POST /site-blocks` **Create a site block** Creates a site block in the site's default locale, as a draft. Send `name`, `slug`, `type` (`global` or `page`) and a `schema`. `data`, `tags`, `seo`, `llmContent` and the JSON-LD fields are optional. A `page` block takes a `path` for its URL, which defaults to `/{slug}`. Fires the `site_block.created` webhook. Returns 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the plan's site-block limit is reached, and 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` for a data source field, `jsonLdGraph` or `jsonLdExclusions` the site's plan does not include. Required permissions: `site_blocks.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | "global" \| "page" | Yes | Required. Resource type. One of: global, page | | `slug` | string | Yes | Required. URL-friendly identifier, unique per site and locale. 1-100 characters | | `name` | string | Yes | Required. Display name. 1-255 characters | | `path` | string \| null | No | Storefront URL path with a `.md` suffix. Any path that resolves to a published content or page can be appended with `.md` to receive the Markdown rendering. | | `schema` | object | Yes | Required. Field schema definition | | `data` | object | No | Resource data object | | `tags` | string[] | No | Tags of the block, per locale: 1 to 50 lowercase letters, digits or hyphens each, at most 10. The admin dashboard reads a page category from legal, privacy, terms, cookies, contact, about or faq (one per page) | | `seo` | object | No | SEO metadata for the block: meta title/description, keywords, Open Graph, Twitter Card, canonical URL, noindex, and sitemap priority/changefreq | | `jsonLdConfig` | object | No | JSON-LD structured-data configuration: enabled flag, schema type (WebPage, AboutPage, ContactPage, FAQPage, CollectionPage), include organization/breadcrumb flags, and custom fields | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | | `llmContent` | string \| null | No | Markdown content for the page surfaced to LLM crawlers (e.g. llms.txt) | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | The schema or the data is invalid, the slug is already used by another
block, in any locale (translate it with `copy-to-locale` instead), or
the page path is invalid or already used by another page. Nothing is
created.
| | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan lacks this feature, its quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `409` | The change conflicts with an existing block at save time, such as a
concurrent create of the same slug. Nothing is created.
| | `422` | Validation error | > **Notes:** - A `richtext` value in `data` is a TipTap document (`{"type": "doc", "content": [...]}`) or `""` to leave it empty. Anything else returns 400. > > - A `reviews` dataSource returns approved reviews only: omit `config.status` or set `"approved"`. > - A `reviews` or `contents` dataSource sorts by public fields only. The 400 message lists the accepted `config.sort.field` values. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/site-blocks \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Sidebar", "slug": "sidebar", "type": "global", "schema": { "fields": [ {"key": "title", "type": "string", "label": "Title"}, {"key": "links", "type": "array", "label": "Links", "fields": [{"key": "label", "type": "string", "label": "Label"}, {"key": "url", "type": "url", "label": "URL"}]} ] } }' ``` ### Response Example ```json { "data": { "id": "769c27f3-fc61-530c-8074-2f41a39fd895", "name": "Sidebar", "slug": "sidebar", "type": "global", "status": "draft", "locale": "en", "schema": { "fields": [ { "key": "title", "type": "string", "label": "Title" }, { "key": "links", "type": "array", "label": "Links" } ] }, "data": {}, "createdAt": "2025-04-06T12:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # Get link data **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /integrations/google/links` **Get link data** Returns the 10 sites that link to the property most often and the 10 pages with the most external links, as reported by Google Search Console. Takes no parameters and answers empty lists when the site has no Search Console data. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks the Search Console integration. Required permissions: `analytics.gsc` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/integrations/google/links" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "topLinkingSites": [ { "domain": "blog.example.org", "linkCount": 42 }, { "domain": "news.example.net", "linkCount": 28 } ], "topLinkedPages": [ { "page": "https://www.example.com/blog/getting-started", "externalLinks": 42, "internalLinks": 156 }, { "page": "https://www.example.com/about", "externalLinks": 12, "internalLinks": 89 } ] } } ``` --- --- # Get declining pages **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /integrations/google/declining-pages` **Get declining pages** Returns the pages whose average position dropped the most compared with the previous period of the same length. Answers an empty list when the site has no Search Console data. Data older than the plan's analytics retention is not returned, the previous period included, and `data.period` gives the dates used. `meta.capped` is true when rows exist beyond the 1000-row ceiling. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks the Search Console integration or query trend analysis. Required permissions: `analytics.gsc` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `period` | query | "7d" \| "30d" \| "90d" \| "3m" \| "6m" \| "12m" | No | Window ending 3 days before today, `30d` by default. Ignored when both dates are sent. | | `startDate` | query | string | No | First day of the window. Used only together with `endDate`. | | `endDate` | query | string | No | Last day of the window. Used only together with `startDate`. | | `limit` | query | integer (1 to 1000) | No | Rows returned, 10 by default. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Response Example ```json { "data": { "period": { "startDate": "2026-05-01", "endDate": "2026-05-30" }, "decliningPages": [ { "page": "https://www.example.com/blog/old-tutorial", "currentPosition": 28.1, "previousPosition": 21.4, "positionLost": 6.7, "currentClicks": 30, "currentImpressions": 1500, "clicksLost": 25, "impressionsLost": 600 } ] }, "meta": { "capped": false } } ``` --- --- # Get declining search queries **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /integrations/google/lost-queries` **Get declining search queries** Returns the search queries whose average position dropped the most compared with the previous period of the same length. Answers an empty list when the site has no Search Console data. Data older than the plan's analytics retention is not returned, the previous period included, and `data.period` gives the dates used. `meta.capped` is true when rows exist beyond the 1000-row ceiling. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks the Search Console integration or query trend analysis. Required permissions: `analytics.gsc` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `period` | query | "7d" \| "30d" \| "90d" \| "3m" \| "6m" \| "12m" | No | Window ending 3 days before today, `30d` by default. Ignored when both dates are sent. | | `startDate` | query | string | No | First day of the window. Used only together with `endDate`. | | `endDate` | query | string | No | Last day of the window. Used only together with `startDate`. | | `limit` | query | integer (1 to 1000) | No | Rows returned, 10 by default. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Response Example ```json { "data": { "period": { "startDate": "2026-05-01", "endDate": "2026-05-30" }, "lostQueries": [ { "query": "free cms", "currentPosition": 22.5, "previousPosition": 17.3, "positionLost": 5.2, "currentClicks": 50, "currentImpressions": 3200, "clicksLost": 35, "impressionsLost": 800 } ] }, "meta": { "capped": false } } ``` --- --- # Get growing search queries **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /integrations/google/growing-queries` **Get growing search queries** Returns the search queries whose average position improved the most compared with the previous period of the same length. Answers an empty list when the site has no Search Console data. Data older than the plan's analytics retention is not returned, the previous period included, and `data.period` gives the dates used. `meta.capped` is true when rows exist beyond the 1000-row ceiling. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks the Search Console integration or query trend analysis. Required permissions: `analytics.gsc` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `period` | query | "7d" \| "30d" \| "90d" \| "3m" \| "6m" \| "12m" | No | Window ending 3 days before today, `30d` by default. Ignored when both dates are sent. | | `startDate` | query | string | No | First day of the window. Used only together with `endDate`. | | `endDate` | query | string | No | Last day of the window. Used only together with `startDate`. | | `limit` | query | integer (1 to 1000) | No | Rows returned, 10 by default. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/integrations/google/growing-queries?period=30d" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "period": { "startDate": "2026-05-01", "endDate": "2026-05-30" }, "growingQueries": [ { "query": "headless cms", "currentPosition": 8.2, "previousPosition": 10.4, "positionChange": 2.2, "currentClicks": 320, "currentImpressions": 5400, "clicksChange": 45, "impressionsChange": 700 } ] }, "meta": { "capped": false } } ``` --- --- # Get GSC overview **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /integrations/google/stats` **Get GSC overview** Returns Google Search Console metrics for the connected property: totals, top queries and pages, a time series, a comparison with the previous period and a breakdown by search type. Answers `connected: false` with `stats: null` when the site has no active Search Console connection. Data older than the plan's analytics retention is not returned, and `data.period` gives the dates used. `meta.capped` is true when rows exist beyond the 1000-row ceiling. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks the Search Console integration. Required permissions: `analytics.gsc` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `period` | query | "7d" \| "30d" \| "90d" \| "3m" \| "6m" \| "12m" | No | Window ending 3 days before today, `30d` by default. Ignored when both dates are sent. | | `startDate` | query | string | No | First day of the window. Used only together with `endDate`. | | `endDate` | query | string | No | Last day of the window. Used only together with `startDate`. | | `limit` | query | integer (1 to 1000) | No | Rows returned in `topQueries` and `topPages`, 100 by default. | | `compare` | query | "previous" \| "yoy" | No | Adds trend values to each row and a `compareChartData` series, against the previous period or the same dates a year earlier. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/integrations/google/stats?period=30d" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "connected": true, "credential": { "id": 42, "siteId": "2d239c40-69eb-44d1-bc1a-c878cc9e6084", "propertyUrl": "https://www.example.com/", "isActive": true, "lastSyncAt": "2026-05-30T09:15:00.000Z", "lastSyncStatus": "completed", "lastSyncError": null, "reconnectRequired": false, "syncStatus": "completed", "syncProgress": 100, "syncStartedAt": "2026-05-30T09:10:00.000Z", "syncRowsImported": 4820, "createdAt": "2026-04-01T12:00:00.000Z", "updatedAt": "2026-05-30T09:15:00.000Z" }, "period": { "startDate": "2026-05-01", "endDate": "2026-05-30" }, "stats": { "totalClicks": 4250, "totalImpressions": 85000, "avgCtr": 0.05, "avgPosition": 12.3 }, "topQueries": [ { "query": "headless cms", "clicks": 320, "impressions": 5400, "ctr": 0.059, "position": 8.2 } ], "topPages": [ { "page": "https://www.example.com/blog/getting-started", "clicks": 450, "impressions": 8200, "ctr": 0.055, "position": 6.3 } ], "chartData": [], "comparison": null, "searchTypeBreakdown": [] }, "meta": { "capped": false } } ``` --- --- # Get scroll depth data **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/heatmap/scroll` **Get scroll depth data** Returns the scroll events recorded over the period, counted by depth (a percentage of the page height), and the share of those events at or past 25, 50, 75 and 100 percent. `page` restricts them to one exact page path; without it, every page counts. Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `entry_page`. `device` is the device type here. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks heatmaps. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/heatmap/scroll?period=30d&page=/pricing" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "scrollDepths": [ { "depth": 25, "count": 1200 }, { "depth": 50, "count": 940 }, { "depth": 75, "count": 610 }, { "depth": 100, "count": 280 } ], "scrollReach": [ { "depth": 25, "reached": 3030, "percentage": 100 }, { "depth": 50, "reached": 1830, "percentage": 60 }, { "depth": 75, "reached": 890, "percentage": 29 }, { "depth": 100, "reached": 280, "percentage": 9 } ] } } ``` --- --- # Get click heatmap data **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/heatmap` **Get click heatmap data** Returns the clicks recorded on one page over the period, for drawing a heatmap. `page` is the exact page path. Without it, the response is the 50 most clicked pages instead: `{ "data": { "pages": [{ "pagePath", "clicks" }] } }`. `x` is a percentage of the viewport width, `y` the pixel offset in the viewport. At most 2000 clicks are returned. `totalClicks` counts every click on the page. `elementClicks` holds the 30 most clicked elements. Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `entry_page`. Here `device` has its own meaning, described in the notes. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks heatmaps. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | `device` is not exactly one of `mobile`, `tablet`, `desktop` or `laptop` (case-insensitive), a comma-separated list included. | > **Notes:** - `device` is the viewport class the clicks were made at: `mobile` > (under 768px wide), `tablet` (768 to 1023px) or `desktop` (1024px and > wider). `laptop` counts as `desktop`. One case-insensitive value only. > > - `device` narrows the page list, `clicks`, `totalClicks` and > `elementClicks`. `viewportDistribution` always covers every class. ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/heatmap?period=30d&page=/pricing&device=desktop" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "pagePath": "/pricing", "totalClicks": 1342, "clicks": [ { "x": 48, "y": 320, "viewportWidth": 1440, "viewportHeight": 900 } ], "heatmapGrid": [], "elementClicks": [ { "tag": "button", "id": "buy-pro", "className": "btn btn-primary", "text": "Buy Pro", "clicks": 210 } ], "viewportDistribution": [ { "device": "desktop", "clicks": 1342 }, { "device": "mobile", "clicks": 410 }, { "device": "tablet", "clicks": 96 } ] } } ``` --- --- # Get session detail **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/sessions/:sessionId` **Get session detail** Returns one session with its events in time order and the form submissions linked to it. `visits` repeats this for each session of the same visitor, newest first. Only the sessions your plan shows are returned: the site's most recent ones, up to a number the plan sets. `visits` is limited the same way. Errors: 400 for a `sessionId` that is not a UUID, 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks session analytics, 404 for an unknown session or one your plan no longer shows. Required permissions: `analytics.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `sessionId` | path | string | Yes | Analytics session ID | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Unknown session, or one older than the most recent sessions your plan shows. | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/sessions/7a2b9c1d-3e4f-5a6b-7c8d-9e0f1a2b3c4d" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "session": { "id": "7a2b9c1d-3e4f-5a6b-7c8d-9e0f1a2b3c4d", "visitorId": "3f9a1c2e", "entryPage": "/", "exitPage": "/pricing", "pageCount": 4, "durationSeconds": 186, "deviceType": "desktop", "browser": "Chrome", "os": "Windows", "countryCode": "FR", "city": "Paris", "trafficSource": "organic", "referrerDomain": "search.example.com", "isBounce": false, "isNewVisitor": true, "startedAt": "2026-05-30T14:22:10.000Z", "endedAt": "2026-05-30T14:25:16.000Z", "visitCount": 2 }, "events": [ { "eventType": "pageview", "pagePath": "/", "pageTitle": "Home", "eventTime": "2026-05-30T14:22:10.000Z", "scrollDepth": 65, "timeOnPage": 48000, "isEntry": true, "isExit": false, "clickElement": null, "clickText": null, "clickUrl": null }, { "eventType": "click", "pagePath": "/", "pageTitle": "Home", "eventTime": "2026-05-30T14:22:58.000Z", "scrollDepth": null, "timeOnPage": null, "isEntry": false, "isExit": false, "clickElement": "a", "clickText": "Pricing", "clickUrl": "https://example.com/pricing" } ], "formSubmissions": [ { "id": "c4d5e6f7-1a2b-3c4d-5e6f-7a8b9c0d1e2f", "formName": "Contact", "formSlug": "contact", "status": "pending", "createdAt": "2026-05-30T14:24:40.000Z" } ], "visits": [ { "session": { "id": "7a2b9c1d-3e4f-5a6b-7c8d-9e0f1a2b3c4d", "visitorId": "3f9a1c2e", "entryPage": "/", "exitPage": "/pricing", "pageCount": 4, "durationSeconds": 186, "deviceType": "desktop", "browser": "Chrome", "os": "Windows", "countryCode": "FR", "city": "Paris", "trafficSource": "organic", "referrerDomain": "search.example.com", "isBounce": false, "isNewVisitor": true, "startedAt": "2026-05-30T14:22:10.000Z", "endedAt": "2026-05-30T14:25:16.000Z", "visitCount": 2 }, "events": [ { "eventType": "pageview", "pagePath": "/", "pageTitle": "Home", "eventTime": "2026-05-30T14:22:10.000Z", "scrollDepth": 65, "timeOnPage": 48000, "isEntry": true, "isExit": false, "clickElement": null, "clickText": null, "clickUrl": null } ], "formSubmissions": [ { "id": "c4d5e6f7-1a2b-3c4d-5e6f-7a8b9c0d1e2f", "formName": "Contact", "formSlug": "contact", "status": "pending", "createdAt": "2026-05-30T14:24:40.000Z" } ] } ] } } ``` --- --- # Get analytics settings **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/settings` **Get analytics settings** Returns the site's tracking settings. A site that never saved any gets the defaults: tracking on, nothing excluded. The two retention fields are read-only. `rawEventsRetentionDays` is how many days detailed analytics events are kept: your plan's value, at most 1095. A report trend whose comparison period starts before that window can be `null`. `aggregatedRetentionDays` is informational. Required permissions: `analytics.settings` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/settings" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "cc5ffc6a-28bb-5405-bb63-69f7ac43b2f0", "siteId": "9f1c2d3e-4b5a-6c7d-8e9f-0a1b2c3d4e5f", "trackingEnabled": true, "rawEventsRetentionDays": 365, "aggregatedRetentionDays": 1825, "excludedPaths": [ "/admin", "/preview" ], "excludedIps": [ "203.0.113.10" ] } } ``` --- --- # List visitors by city **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/cities` **List visitors by city** Returns the top cities by visitors over the period. `limit` caps the list (default 50, at most 100). Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `path` and `language`. With `compare=previous` or `compare=yoy`, each city carries a `trend` percentage. With `content_locale` set, it is `null` when the comparison period starts before your plan's analytics retention. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/cities?period=30d&limit=50" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "city": "Paris", "countryCode": "FR", "visitors": 2210, "pageviews": 5120, "latitude": 48.8566, "longitude": 2.3522 }, { "city": "Berlin", "countryCode": "DE", "visitors": 540, "pageviews": 1190, "latitude": null, "longitude": null } ] } ``` --- --- # List visitors by screen size **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/devices/screens` **List visitors by screen size** Returns the top screen resolutions by visitors over the period. `limit` caps the list (default 50, at most 100). Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview, except `entry_page`. With `compare=previous` or `compare=yoy`, each entry carries a `trend` percentage. It is `null` when the comparison period starts before your plan's analytics retention. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/devices/screens?period=30d&limit=50" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "resolution": "1920x1080", "width": 1920, "height": 1080, "count": 3120 }, { "resolution": "390x844", "width": 390, "height": 844, "count": 1840 } ] } ``` --- --- # Get page analytics **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/pages` **Get page analytics** Returns the site's pages ranked by pageviews over the period, paginated with `page` (default 1) and `limit` (default 20, at most 100). Takes `period`, `start_date`, `end_date` and the dimension filters, as listed on Get analytics overview. With `compare=previous` or `compare=yoy`, each page carries a `trend` percentage. It is `null` when the comparison period starts before your plan's analytics retention. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/pages?period=30d&page=1&limit=20&compare=previous" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "path": "/", "title": "Home", "pageviews": 5230, "uniqueVisitors": 3890, "entrances": 2410, "exits": 1980, "bounceRate": 41, "avgTimeOnPage": 78, "trend": 12 }, { "path": "/blog/getting-started", "title": "Getting Started Guide", "pageviews": 1840, "uniqueVisitors": 1502, "entrances": 980, "exits": 760, "bounceRate": 55, "avgTimeOnPage": 142, "trend": -8 } ], "meta": { "total": 87, "page": 1, "limit": 20 } } ``` --- --- # Get analytics overview **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/overview` **Get analytics overview** Returns the site's key metrics for the period, the same metrics for a comparison period, and a `trends` block of rounded percentage changes. Takes the period and filter query parameters listed in the notes, shared by the other analytics reports. `compare` picks the comparison period: `previous` (the default, the same length just before) or `yoy` (the same dates a year earlier). A trend is `null` when the comparison period starts before your plan's analytics retention and has to be read from detailed events: always with a dimension filter, otherwise only when it has no daily totals. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | > **Notes:** - `period`: `7d`, `30d` (default), `90d`, `3m`, `6m` or `12m`, ending > today in the site's timezone. Any other value reads as `30d`. > > - `start_date` and `end_date`: `YYYY-MM-DD`, inclusive, in the site's > timezone. Both valid and in order, they replace `period`; a span over > 2 years keeps its last 2 years. > - Dimension filters, each an exact value or a comma-separated list: > `browser`, `os`, `device` (device type), `country` (ISO code), `city`, > `path`, `entry_page`, `referrer`, `traffic_source`, `utm_source`, > `utm_medium`, `utm_campaign`, `language`, `content_locale`. > - `language` is the visitor's browser language. `content_locale` is the > language of the page viewed, one of the site's locales. ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/overview?period=30d&compare=previous" \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Get pageviews per minute **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /analytics/realtime/pageviews` **Get pageviews per minute** Returns the pageview count of each minute over the last hour, oldest first, the current minute included. `minute` is `HH:mm` in the site's timezone, and a minute without pageviews reads 0. Takes no query parameters. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks real-time analytics. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/realtime/pageviews" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "minute": "13:34", "pageviews": 4 }, { "minute": "13:35", "pageviews": 7 }, { "minute": "13:36", "pageviews": 2 } ] } ``` --- --- # Update a redirect **Published**: 2026-11-30 **Category**: SEO & Analytics ## `PUT /redirects/:id` **Update a redirect** Updates a redirect rule with the fields you send. A write that changes the pattern or re-enables the rule returns 422 when the pattern is unsafe. A rule left active and regex returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` on a plan without regex redirects. Fires the `redirect.updated` webhook. An automatic redirect, one written for you when a URL moved (a renamed content, category or product), becomes yours once a write changes its `sourcePath`, `targetPath` or `isRegex`: later automatic writes no longer repoint, overwrite or delete it. That write returns 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the site already holds its plan's number of manual redirects, and 422 when it holds 1000. Switching it on or off, or editing only its `note`, keeps it automatic. 409 when another rule has the new `sourcePath`. 404 for an unknown redirect. Required permissions: `redirects.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `sourcePath` | string | No | 1-2048 characters | | `targetPath` | string | No | 1-2048 characters | | `statusCode` | "301" \| "302" \| "307" \| "308" | No | One of: 301, 302, 307, 308 | | `isRegex` | boolean | No | Treats `sourcePath` as a regular expression matched against the path, with `$1` in `targetPath` for a capture group. Matches only on plans with regex redirects | | `preserveQueryString` | boolean | No | Tells the front end serving the redirect to append the visitor's query string to the target. Defaults to `true` on create | | `isActive` | boolean | No | Whether the redirect is applied. An inactive redirect is kept but never matched | | `note` | string | No | Max 500 characters | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan lacks this feature, its quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/redirects/7f23ce17-b593-514f-9f1d-b6239701a812 \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "targetPath": "/new-blog", "statusCode": "302" }' ``` ### Response Example ```json { "data": { "id": "7f23ce17-b593-514f-9f1d-b6239701a812", "sourcePath": "/old-blog", "targetPath": "/new-blog", "statusCode": "302", "isRegex": false, "isActive": true, "preserveQueryString": true, "createdAt": "2025-02-01T10:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # Import redirects from CSV **Published**: 2026-11-30 **Category**: SEO & Analytics ## `POST /redirects/import` **Import redirects from CSV** Imports redirect rules from a CSV `file` (at most 10 MB) or a JSON `redirects` array, with the fields of `POST /redirects`. CSV headers may use the export's names (`source_path`) or aliases such as `from`, `to` and `code`, so an exported file imports back unchanged. A row whose `sourcePath` already exists is skipped. An invalid row is counted in `errors` and the other rows are still imported; `errorDetails` lists up to ten of them. 402 `SUBSCRIPTION_QUOTA_EXCEEDED`, with nothing imported, when the new rules exceed the plan's limit of manual rules. 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` for regex rules on a plan without regex redirects. Required permissions: `redirects.import` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `redirects` | object[] | Yes | Required | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan lacks this feature, its quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | > **Notes:** - A site holds at most 1000 manual redirect rules, and automatic ones do not count toward it: a batch of more rows returns 422, and rows past the limit become row errors. > > - A CSV header row of more than 1000 cells returns 422 on `file`, and a file ending inside an open quote returns 400. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/redirects/import \ -H "Authorization: Bearer $API_TOKEN" \ -F "file=@redirects.csv" ``` ### Response Example ```json { "data": { "message": "Import completed", "imported": 18, "skipped": 2, "errors": 0, "errorDetails": [] } } ``` --- --- # Export redirects as CSV **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /redirects/export` **Export redirects as CSV** Downloads the site's stored redirect rules as a CSV file, newest first. Pass `is_active=true` or `false` to export only active or inactive rules. The file imports back unchanged through `POST /redirects/import`. Required permissions: `redirects.export` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/redirects/export" \ -H "Authorization: Bearer $API_TOKEN" \ -o redirects.csv ``` ### Response Example ``` source_path,target_path,status_code,is_regex,preserve_query_string,is_active,note /old-blog,/blog,301,false,true,true,Legacy blog redirect ``` --- --- # Copy block to another locale **Published**: 2026-11-30 **Category**: Core CMS ## `POST /site-blocks/:slug/copy-to-locale` **Copy block to another locale** Copies the master block into the `targetLocale` sent in the body, with the same schema, data, tags and SEO, as a draft translation of the same block. Fires the `site_block.translation_created` webhook. Requires both `site_blocks.create` and `site_blocks.view`. Returns 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the plan's site-block limit is reached. Required permissions: `site_blocks.create`, `site_blocks.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `targetLocale` | string | Yes | Required. BCP 47 locale code of the locale to copy into (e.g. "fr", "es"). Must be enabled on the site.. 2-10 characters | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | The target locale is invalid or not enabled on the site, a
translation already exists in it, or the page path is already in use
in it.
| | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | Another block already uses the same slug in the target locale, or the
copy conflicts with an existing block at save time.
| | `422` | Validation error | > **Notes:** - The call targets the master row: the one in the site's default locale when several exist, otherwise the oldest. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/site-blocks/header/copy-to-locale \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"targetLocale": "fr"}' ``` ### Response Example ```json { "data": { "id": "2573f862-2232-5b2c-8f58-df92cf7ec7c6", "name": "Header", "slug": "header", "type": "global", "status": "draft", "locale": "fr", "schema": { "fields": [ { "key": "logo", "type": "image", "label": "Logo" }, { "key": "navLinks", "type": "array", "label": "Navigation Links" } ] }, "data": { "logo": { "url": "https://cdn.lynkow.com/sites/abc123/logo.svg", "alt": "Company Logo" }, "navLinks": [ { "label": "Home", "url": "/" }, { "label": "Blog", "url": "/blog" } ] }, "createdAt": "2025-04-06T15:00:00.000Z", "updatedAt": "2025-04-06T15:00:00.000Z" } } ``` --- --- # Test redirect matching **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /redirects/match` **Test redirect matching** Returns the redirect a visitor requesting `path` would get, or 404 when none applies. Stored rules win. Exact rules come first, then wildcard, then regex rules, and within a class the most specific rule (the oldest on a tie). Regex rules are skipped on a plan without regex redirects. A rule whose resolved target is unsafe, or that would loop with a default-locale redirect, is ignored. With no stored match, a locale redirect is computed from the language settings and translations (see `GET /redirects/automatic`). It is always a 301 with `preserveQueryString: true`: append the visitor's query string to the target. The answer is always the final URL, in one hop. A default-locale segment (`/en` on an English-default site) is ignored when matching exact and wildcard rules, and dropped from the target. Required permissions: `redirects.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `path` | query | string | Yes | Source URL path to test against the site's active redirect rules. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | The required `path` query parameter is missing, empty, or not a string. | | `401` | Unauthorized, invalid or missing API token | | `403` | Forbidden, insufficient permissions | | `404` | No safe active stored redirect matches the supplied path, and no locale redirect is synthesized for it. | ### Examples ```bash curl "https://api.lynkow.com/v1/redirects/match?path=/old-page" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "source": "/old-page", "target": "/new-page", "statusCode": 301, "preserveQueryString": true } } ``` --- --- # Delete a sitemap source **Published**: 2026-11-30 **Category**: SEO & Analytics ## `DELETE /sitemap/sources/:id` **Delete a sitemap source** Deletes an external sitemap source, which `sitemap.xml` then stops listing. Returns 404 when the source does not exist. Required permissions: `sitemap.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE "https://api.lynkow.com/v1/sitemap/sources/b8e3c2a1-4f6d-4a1e-9c2b-1d7e5a8f3c90" \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Create a sitemap entry **Published**: 2026-11-30 **Category**: SEO & Analytics ## `POST /sitemap/entries` **Create a sitemap entry** Adds a manual URL to the sitemap: a path on the site or an absolute `http://` or `https://` URL. A path is stored with a leading slash and no trailing slash, so `about` and `/about/` both become `/about`. Omitted fields default to `priority` 0.5 and `changefreq` `weekly`. `isExternal` defaults to true for an absolute URL. To link language versions, give each entry its `locale` and the same `hreflangGroupId`, a UUID you choose. The sitemap lists the entries of a group as hreflang alternates of each other. Fires the `sitemap_entry.created` webhook. Errors: 409 when the URL already exists on the site. 422 `VALIDATION_FIELD_INVALID` for a `lastModified` that is not an ISO 8601 date, a locale the site does not enable, a group without a locale, or a group that already has an entry in that locale. 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the plan's entry limit is reached. Required permissions: `sitemap.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `url` | string | Yes | Required. 1-2048 characters | | `isExternal` | boolean | No | Whether `url` is an absolute address on another site, listed as written. Detected from `url` when omitted on create | | `priority` | number (0 to 1) | No | Sitemap priority of this URL. Defaults to `0.5` on create | | `changefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" | No | One of: always, hourly, daily, weekly, monthly, yearly, never | | `lastModified` | string \| null | No | Last modification datetime (ISO 8601). `null` stores no date | | `title` | string | No | Display title. Max 255 characters | | `locale` | string \| null | No | BCP 47 locale code (e.g. "en", "fr") | | `hreflangGroupId` | string \| null | No | UUID you choose to link the translations of one page as hreflang alternates. Each member needs a `locale`, unique in the group | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/sitemap/entries \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "/pricing", "priority": 0.8, "changefreq": "monthly", "title": "Pricing Page" }' ``` ### Response Example ```json { "data": { "id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890", "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "url": "/pricing", "isExternal": false, "priority": 0.8, "changefreq": "monthly", "title": "Pricing Page", "locale": null, "hreflangGroupId": null, "createdAt": "2025-04-06T11:00:00.000Z", "updatedAt": "2025-04-06T11:00:00.000Z" } } ``` --- --- # List sitemap entries **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /sitemap/entries` **List sitemap entries** Returns the site's manual sitemap entries, newest first, 20 per page by default and at most 100. Filter with `search` and `is_external`. URLs the sitemap generates from your articles, pages and products are not listed here: see `GET /sitemap/preview`. Required permissions: `sitemap.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `search` | query | string | No | Text matched against `url` and `title`, ignoring case. | | `is_external` | query | "true" \| "false" | No | `true` returns the entries whose `isExternal` is true, `false` the others. | | `page` | query | integer (min 1, default 1) | No | Page number, starting at 1. | | `limit` | query | integer (1 to 100, default 20) | No | Entries per page. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/sitemap/entries?search=pricing" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "f1a2b3c4-d5e6-7890-abcd-ef1234567890", "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "url": "/pricing", "isExternal": false, "priority": 0.8, "changefreq": "monthly", "lastModified": "2025-04-01T00:00:00.000Z", "title": "Pricing Page", "locale": null, "hreflangGroupId": null, "createdAt": "2025-02-10T09:00:00.000Z", "updatedAt": "2025-04-01T12:00:00.000Z" }, { "id": "a2b3c4d5-e6f7-8901-bcde-f12345678901", "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "url": "https://partner-site.com/our-listing", "isExternal": true, "priority": 0.5, "changefreq": "yearly", "title": "Partner Listing", "locale": null, "hreflangGroupId": null, "createdAt": "2025-03-05T14:00:00.000Z", "updatedAt": "2025-03-05T14:00:00.000Z" } ], "meta": { "total": 12, "perPage": 20, "currentPage": 1, "lastPage": 1 } } ``` --- --- # Get content as markdown **Published**: 2026-11-30 **Category**: SEO & Analytics ## `GET /markdown/content/:slug` **Get content as markdown** Returns a published article as Markdown: its title, publication date, category and tags, then its body. The slug may end in `.md`. Articles in several locales can share a slug: the one in the site's default locale is returned, otherwise the oldest published one. Returns 404 `RESOURCE_NOT_FOUND` when llms.txt is disabled for the site or no published article has the slug. Required permissions: `seo.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/markdown/content/getting-started-with-lynkow \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ``` # Getting Started with Lynkow **Publié le** : 2025-04-05 **Catégorie** : Guides Learn how to set up your first headless CMS with Lynkow. ``` --- --- # Upload a file **Published**: 2026-11-30 **Category**: Media & Files ## `POST /media/upload` **Upload a file** Uploads an image as `multipart/form-data` in the `file` field: JPEG, PNG, GIF, WebP, AVIF or SVG, up to 10 MB. Animated PNG is refused. Set `folderId` to file it in a folder. Fires the `media.uploaded` webhook. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the site has reached its media file count or storage quota, 404 for an unknown `folderId`, 422 for a file that fails the checks below. Required permissions: `media.upload` ### Request Body Content-Type: `multipart/form-data` | Field | Type | Required | Description | | --- | --- | --- | --- | | `file` | string | Yes | Required | | `alt` | string | No | Alternative text for the media (accessibility and SEO) | | `preset` | "fast" \| "optimized" \| "quality" | No | Resize and compression preset: `fast` (1280 px, quality 80), `optimized` (1920 px, quality 80, the default) or `quality` (3840 px, quality 90). One of: fast, optimized, quality | | `maxWidth` | integer (100 to 4000) | No | Longest side in pixels the image is scaled down to, overriding the preset. A smaller image is never enlarged | | `quality` | integer (50 to 100) | No | Whole number from 50 to 100: WebP quality, overriding the preset | | `folderId` | string | No | Media folder UUID. UUID format | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | > **Notes:** - JPEG, PNG, WebP and AVIF are stored as WebP, resized so neither side > exceeds 1920 px by default. `preset` and `maxWidth` change that size. > > - An image still over 2 MB after compression returns 422. > - A GIF keeps its format and is only resized. > - An SVG is sanitized, and returns 422 when its markup exceeds 1 MB or > cannot be sanitized. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/media/upload \ -H "Authorization: Bearer $API_TOKEN" \ -F "file=@photo.jpg" \ -F "alt=A beautiful sunset" \ -F "folderId=uuid-of-folder" ``` ### Response Example ```json { "data": { "id": "b2c3d4e5-f6a7-4901-bcde-f12345678901", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "uploadedBy": null, "folderId": "f1a2b3c4-d5e6-4890-abcd-ef1234567890", "filename": "3f8a1c2d-4e5b-4a6c-9d7e-8f9a0b1c2d3e.webp", "originalFilename": "photo.webp", "path": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/3f8a1c2d-4e5b-4a6c-9d7e-8f9a0b1c2d3e.webp", "mimeType": "image/webp", "size": 185320, "metadata": { "width": 1600, "height": 900, "format": "webp", "alt": "A beautiful sunset", "uploadedViaApiToken": "Content pipeline" }, "url": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/3f8a1c2d-4e5b-4a6c-9d7e-8f9a0b1c2d3e.webp", "variants": { "thumbnail": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/3f8a1c2d-4e5b-4a6c-9d7e-8f9a0b1c2d3e.webp?w=150", "card": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/3f8a1c2d-4e5b-4a6c-9d7e-8f9a0b1c2d3e.webp?w=400", "content": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/3f8a1c2d-4e5b-4a6c-9d7e-8f9a0b1c2d3e.webp?w=800", "medium": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/3f8a1c2d-4e5b-4a6c-9d7e-8f9a0b1c2d3e.webp?w=1200" }, "createdAt": "2025-04-06T11:30:00.000Z", "updatedAt": "2025-04-06T11:30:00.000Z", "deletedAt": null } } ``` --- --- # Copy tag to another locale **Published**: 2026-11-30 **Category**: Core CMS ## `POST /tags/:id/copy-to-locale` **Copy tag to another locale** Creates a copy of this tag in `targetLocale`. Content assignments that were waiting for that locale are restored. Requires both `tags.create` and `tags.view`. A site at its plan's tag limit gets 402 `SUBSCRIPTION_QUOTA_EXCEEDED`. Required permissions: `tags.create`, `tags.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `targetLocale` | string | Yes | Required. BCP 47 locale code of the locale to copy into (e.g. "fr", "es"). Must be enabled on the site. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | The target locale or copy operation is invalid. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | A tag in this translation group already exists in the target locale. | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/tags/d9207eb4-14b1-555b-a25b-04b901f35010/copy-to-locale \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"targetLocale": "fr"}' ``` ### Response Example ```json { "data": { "id": "cbfee952-07ce-5c63-98ef-257b15ffdae5", "name": "JavaScript", "slug": "javascript", "locale": "fr", "createdAt": "2025-04-06T15:00:00.000Z", "updatedAt": "2025-04-06T15:00:00.000Z" } } ``` --- --- # Restore a content revision **Published**: 2026-11-30 **Category**: Core CMS ## `POST /contents/:id/revisions/:revisionId/restore` **Restore a content revision** Restores a content's title, slug, excerpt, body, custom data and meta from a revision, with its SEO fields when the revision holds them. The current state is saved as a new revision first. The status, categories and tags do not change. A revision whose JSON-LD holds an entry the current one lacks returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks advanced JSON-LD. A restored slug must be free under the slug rule of an update, else 409 and nothing is restored. When the restore moves a published content to another URL, an automatic 301 redirect rule is created from the URL it had to its new URL, as on an update, counted in `redirectsCreated` and `redirectsSkipped`. Hand-written redirects are never changed, and a redirect that cannot be written never fails the restore. A caller without `contents.view` receives an acknowledgement with the same counts. Required permissions: `contents.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | | `revisionId` | path | string | Yes | Revision ID | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | The revision's slug is now used by another content, or is no longer a valid slug (code `VALIDATION_FIELD_INVALID`). Nothing is restored. | > **Notes:** - `redirectsSkipped` counts the rules not written because the site holds its limit of 10000 automatic redirect rules, which manual rules do not count toward. > > - Some moves write no rule, for example when another page or record already serves the old URL. They are counted in neither field. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/contents/a50b3357-6978-5701-a336-69e3c2a79f21/revisions/8478369a-1219-50f1-aaa4-5703ed236a6c/restore \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "a50b3357-6978-5701-a336-69e3c2a79f21", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "type": "post", "status": "published", "excerpt": "Learn how to set up your first headless CMS.", "bodyHtml": "

Welcome

Original content restored.

", "locale": "en", "createdAt": "2025-03-14T08:00:00.000Z", "updatedAt": "2025-04-06T15:00:00.000Z", "redirectsCreated": 0, "redirectsSkipped": 0 } } ``` --- --- # Create a content **Published**: 2026-11-30 **Category**: Core CMS ## `POST /contents` **Create a content** Creates a content, in `draft` status unless you send `status`. Creating it as `published` or `scheduled` requires `contents.publish`. Send the body as Markdown in `bodyMarkdown`, or as a rich-text document in `body` (`{"type": "doc", "content": [...]}`, or `{}` for an empty body). Any other `body` shape is a 422. The `slug` must be unused by the site's other contents. With nested blog URLs and `categoryIds`, it must be unused in the first category and in the same locale. On a multi-language site, the translations of one `translationGroupId` may share a slug. Fires the `content.created` webhook. Errors: 403 `AUTHZ_INSUFFICIENT_PERMISSIONS`, 400 for a locale not enabled on the site, 404 for a category or tag of another site, 409 for a slug in use or a `translationGroupId` that already holds that locale, 402 at the content quota, and 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` for a non-empty `jsonLdGraph` or `jsonLdExclusions` when the plan lacks advanced JSON-LD. Required permissions: `contents.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | "post" | Yes | Required. Resource type. One of: post | | `title` | string | Yes | Required. Display title. 1-500 characters | | `slug` | string | Yes | URL-friendly identifier of this article, the last segment of its path. It cannot contain /, *, ?, #, a backslash, whitespace or a control character | | `excerpt` | string \| null | No | Short summary for previews; null clears it | | `body` | object | No | Rich text content as TipTap JSON | | `bodyMarkdown` | string | No | Content as Markdown (converted to TipTap JSON on save) | | `status` | "draft" \| "published" \| "archived" \| "scheduled" | No | One of: draft, published, archived, scheduled | | `featuredImage` | string \| null | No | Featured image URL; null clears it | | `featuredImageAlt` | string \| null | No | Alternative text of the featured image, for accessibility and search engines; null clears it | | `scheduledAt` | string | No | Scheduled publication datetime (ISO 8601) | | `metaTitle` | string \| null | No | Custom meta title for SEO | | `metaDescription` | string \| null | No | Meta description for search engines | | `keywords` | string \| null | No | Comma-separated SEO keywords | | `canonicalUrl` | string \| null | No | Canonical URL override | | `ogImage` | string \| null | No | Open Graph image URL for social sharing | | `ogImageAlt` | string \| null | No | Alternative text of the Open Graph image | | `noIndex` | boolean | No | When true, asks search engines not to index the page (robots noindex) | | `noFollow` | boolean | No | When true, asks search engines not to follow the links of the page (robots nofollow) | | `ogTitle` | string \| null | No | Open Graph title used when the page is shared on social networks | | `ogDescription` | string \| null | No | Open Graph description used when the page is shared on social networks | | `twitterCard` | "summary" \| "summary_large_image" \| "app" \| "player" \| null | No | Card type used when the page is shared on social networks (summary, summary_large_image, app or player) | | `sitemapPriority` | number (0 to 1) \| null | No | Sitemap priority of this article from 0.0 to 1.0 with at most one decimal place (0.8, not 0.85), or null to use the site default | | `sitemapChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" \| null | No | Sitemap change frequency (always, hourly, daily, weekly, monthly, yearly or never) | | `authorName` | string \| null | No | Display name of the author | | `authorUrl` | string \| null | No | Author profile or website URL | | `meta` | object | No | Additional metadata | | `categoryIds` | string[] | No | Categories to assign, by id. With nested URLs, the first one sets the URL path of the content | | `tagIds` | string[] | No | Tags to assign, by id. An id that is not a tag of the site returns 404 | | `customData` | object \| null | No | Custom fields data (structured content) | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr") | | `translationGroupId` | string | No | Translation group UUID (links translations across locales). UUID format | | `faqSettings` | object | No | FAQ detection and JSON-LD settings | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | | `displayOrder` | number | No | Sort position: in ascending order, lower values come first | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan lacks this feature, its quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `409` | The slug is in use, or the `translationGroupId` already holds a content in this locale. Nothing is created. | | `422` | Validation error | > **Notes:** - `scheduledAt` is required with `status: "scheduled"` and must be in the future, else 422. > > - When the first category holds structured content, `customData` is required and validated against its schema, and only one category is allowed. > - A content created as `published` deletes the automatic redirect rules whose source is one of its URLs. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/contents \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "type": "post", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "bodyMarkdown": "# Welcome\n\nThis is your first article.", "status": "draft", "categoryIds": ["uuid-of-category"] }' ``` ### Response Example ```json { "data": { "id": "cb4298e7-5070-566e-b257-138546caaeda", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "type": "post", "status": "draft", "excerpt": null, "bodyHtml": "

Welcome

This is your first article.

", "locale": "en", "featuredImage": null, "categories": [ { "id": "cca96c04-431f-57f7-816b-aec34a68f550", "name": "Tutorials", "slug": "tutorials" } ], "tags": [], "meta": { "metaTitle": null, "metaDescription": null, "canonicalUrl": null, "ogImage": null }, "author": { "id": "725253c6-9ee6-57ad-a8c8-a1e1ee269b62", "fullName": "Jane Doe" }, "publishedAt": null, "createdAt": "2025-04-06T12:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # Delete a review **Published**: 2026-11-30 **Category**: Forms & Reviews ## `DELETE /reviews/:id` **Delete a review** Permanently deletes a review. Its other translations are kept. Fires the `review.deleted` webhook. An unknown review returns 404. Required permissions: `reviews.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/reviews/1e2d2fb5-90fa-512f-9bc9-5c00ef96526b \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Bulk delete reviews **Published**: 2026-11-30 **Category**: Forms & Reviews ## `POST /reviews/bulk-delete` **Bulk delete reviews** Permanently deletes several reviews at once. Send `ids`, a non-empty array of review UUIDs. Ids matching no review of the site are ignored, and `count` is the number of reviews deleted. Fires one bulk `review.deleted` webhook whose `productIds` lists the products the deleted reviews were linked to. Required permissions: `reviews.delete` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `ids` | string[] | Yes | Required | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/reviews/bulk-delete \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"ids": ["76b8c526-3b5f-56cc-98d8-1707d4932edb", "7af5a769-1709-5d14-9794-e5efcf5b4e66"]}' ``` ### Response Example ```json { "data": { "message": "2 reviews deleted successfully", "count": 2 } } ``` --- --- # Set content status **Published**: 2026-11-30 **Category**: Core CMS ## `POST /contents/:id/status` **Set content status** Changes a content's status. `scheduled` needs a future `scheduledAt` (422 otherwise); any other status clears the date. Moving to `published` or `scheduled` requires `contents.publish`. Other moves require `contents.update`, or `contents.publish` when taking the content out of `published` or `scheduled`. Otherwise the call returns 403 `AUTHZ_INSUFFICIENT_PERMISSIONS`. A publish deletes the automatic redirect rules whose source is one of the content's URLs; taking a content out of `published` writes no automatic redirect. A content with `noIndex` is not submitted to search engines on publish. Asking for the status the content already holds changes nothing and returns 200. Fires `content.published`, `content.unpublished`, `content.scheduled` or `content.archived`. A caller without `contents.view` receives an acknowledgement. Required permissions (any one of): `contents.publish`, `contents.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `status` | "draft" \| "published" \| "archived" \| "scheduled" | Yes | Required. One of: draft, published, archived, scheduled | | `scheduledAt` | string | No | Scheduled publication datetime (ISO 8601) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | `RESOURCE_CONFLICT`: another request changed the status meanwhile. Nothing is changed: reload the content before retrying. | | `422` | Validation error | ### Examples ```bash # Schedule a publication curl -X POST https://api.lynkow.com/v1/contents/b857bb88-9d15-5a2e-8863-ce1ee99482d6/status \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"status": "scheduled", "scheduledAt": "2026-06-01T09:00:00Z"}' ``` ```bash # Archive curl -X POST https://api.lynkow.com/v1/contents/b857bb88-9d15-5a2e-8863-ce1ee99482d6/status \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"status": "archived"}' ``` ### Response Example ```json { "data": { "id": "b857bb88-9d15-5a2e-8863-ce1ee99482d6", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "status": "scheduled", "scheduledAt": "2026-06-01T09:00:00.000Z", "publishedAt": null } } ``` --- --- # Get a review **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /reviews/:id` **Get a review** Returns one review in any status, with its `rejectionReason`, which the storefront never returns. An unknown review returns 404. Required permissions: `reviews.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/reviews/ce44c9e8-9e32-56aa-8570-b2e3e9ff2519 \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "ce44c9e8-9e32-56aa-8570-b2e3e9ff2519", "title": "Excellent platform", "content": "Lynkow made managing our website content incredibly easy.", "rating": 5, "productId": "prod_01j9zq7m4k2x8v3n6p5r0t1w2w", "status": "approved", "rejectionReason": null, "authorName": "Marie Dupont", "authorEmail": "marie@example.com", "authorCompany": "Acme Corp", "authorCity": "Paris", "isFeatured": true, "locale": "en", "createdAt": "2025-04-01T14:22:00.000Z", "updatedAt": "2025-04-05T09:00:00.000Z" } } ``` --- --- # Get review settings **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /reviews/settings` **Get review settings** Returns the site's review settings. A site that never saved them gets the defaults: auto-approval on for 5-star ratings, public submission on, email optional, every author field shown, no custom fields. Required permissions: `reviews.settings` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/reviews/settings \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "autoApproveEnabled": false, "autoApproveMinRating": 5, "publicSubmissionEnabled": true, "requireEmail": false, "showAuthorPhoto": true, "showAuthorCompany": true, "showAuthorCity": true, "customFieldsSchema": [] } } ``` --- --- # Get a submission **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /forms/:id/submissions/:submissionId` **Get a submission** Returns one submission with its field values. Reading a `new` submission marks it `read`. An unknown form or submission id returns 404. Required permissions: `forms.submissions.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | | `submissionId` | path | string | Yes | Form submission ID | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/forms/5b6d425e-8106-5407-aa92-307272afa8b1/submissions/0064fe2e-b119-5521-82d1-e82474245f10 \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "0064fe2e-b119-5521-82d1-e82474245f10", "formId": "5b6d425e-8106-5407-aa92-307272afa8b1", "locale": "fr", "status": "read", "data": { "name": "Sophie Bernard", "email": "sophie@example.com", "message": "I would like to know more about your enterprise plan." }, "ipAddress": "0107c54f24c07a582b85e239ce80d2266bcf8e58080b05aa382015d22ace933d", "userAgent": "Mozilla/5.0", "createdAt": "2025-04-05T16:30:00.000Z" } } ``` --- --- # Create a category **Published**: 2026-11-30 **Category**: Core CMS ## `POST /categories` **Create a category** Creates a category. Send `name` and `slug` (lowercase letters, digits and hyphens). Set `parentId` to create it under an existing category. On a multi-language site a category tree holds one locale: the parent must be in the locale of the new category (`locale`, else the site's default locale), and a parent in another locale is rejected with 422 on `parentId`. An automatic redirect rule whose source is the new category's URL (left by an earlier URL change) is deleted, so it no longer shadows the category. Hand-written redirects are never touched. Errors: 409 when the slug is taken in that locale, 404 for an unknown parent, 422 for an invalid `schema` or for `schemaSource: inherit` without a structured-mode parent, 402 `SUBSCRIPTION_QUOTA_EXCEEDED` at the plan's category limit, 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` for structured mode, a data source field, `jsonLdGraph` or `jsonLdExclusions` the site's plan does not include. Required permissions: `categories.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Required. Display name. 1-255 characters | | `slug` | string | Yes | Required. URL-friendly identifier, unique per site and locale. 1-255 characters | | `description` | string \| null | No | Description text | | `image` | string \| null | No | Image URL | | `parentId` | string \| null | No | Parent resource ID | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr") | | `sitemapPriority` | number (0 to 1) \| null | No | Sitemap priority (0.0-1.0) | | `sitemapChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" \| null | No | Sitemap change frequency (always, hourly, daily, weekly, monthly, yearly or never) | | `contentMode` | "standard" \| "structured" | No | One of: standard, structured | | `schema` | object | No | Field schema definition | | `schemaSource` | "own" \| "inherit" | No | One of: own, inherit | | `displayOrder` | number | No | Sort position: in ascending order, lower values come first | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan lacks this feature, its quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error, including, on a multi-language site, a `parentId` naming a category in another locale than the new category's. Nothing is created. | > **Notes:** - A single-language site does not check the parent's locale. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/categories \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "API Guides", "slug": "api-guides", "description": "REST API integration tutorials", "parentId": "864d41d0-ec7a-50a6-89af-761f0423b42f" }' ``` ### Response Example ```json { "data": { "id": "32bccbb2-f1b2-5244-9abf-8837511d790a", "name": "API Guides", "slug": "api-guides", "description": "REST API integration tutorials", "parentId": "864d41d0-ec7a-50a6-89af-761f0423b42f", "locale": "en", "contentCount": 0, "createdAt": "2025-04-06T12:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # List form submissions **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /forms/:id/submissions` **List form submissions** Returns a form's submissions, newest first, 20 per page and at most 100. `search` matches the submitted values case-insensitively, never the field ids. `dateFrom` and `dateTo` filter on the submission date. An unknown form id returns 404. Required permissions: `forms.submissions.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `status` | query | "new" \| "read" \| "spam" \| "archived" | No | One of: new, read, spam, archived | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "created_at" \| "updated_at" \| "status" | No | One of: created_at, updated_at, status | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | | `ids` | query | string[] | No | Keeps only the items with these UUIDs | | `excludeIds` | query | string[] | No | Leaves out the items with these UUIDs | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl "https://api.lynkow.com/v1/forms/6302c089-7a47-570d-9af1-8f25e333ec5f/submissions?status=new&page=1" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "a7aa7bb4-a3d3-591e-985d-2e9de269a341", "formId": "6302c089-7a47-570d-9af1-8f25e333ec5f", "locale": "fr", "status": "new", "data": { "name": "Sophie Bernard", "email": "sophie@example.com", "message": "I would like to know more about your enterprise plan." }, "ipAddress": "0107c54f24c07a582b85e239ce80d2266bcf8e58080b05aa382015d22ace933d", "userAgent": "Mozilla/5.0", "createdAt": "2025-04-05T16:30:00.000Z" }, { "id": "98b2fdf7-a899-579e-82f9-39aee91e9624", "formId": "6302c089-7a47-570d-9af1-8f25e333ec5f", "locale": "en", "status": "read", "data": { "name": "Marc Leroy", "email": "marc@example.com", "message": "Can I schedule a demo?" }, "ipAddress": "5db8c6777c58044ad4a286c4dc6af4f93b941ac5635de63046eba6027d9a3aa7", "userAgent": "Mozilla/5.0", "createdAt": "2025-04-04T10:15:00.000Z" } ], "meta": { "total": 134, "perPage": 15, "currentPage": 1, "lastPage": 9 } } ``` --- --- # Get a form **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /forms/:id` **Get a form** Returns a form with its field schema, settings and `submissionsCount`. Webhook header values come back as `[REDACTED]` and the webhook URL as its origin only. An unknown id returns 404. Required permissions: `forms.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/forms/b10c2019-edce-5f39-ad5c-74013e622b78 \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "b10c2019-edce-5f39-ad5c-74013e622b78", "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "createdBy": "5e0c7a52-8f1d-4b6e-9a33-2d4f6c8b1e07", "name": "Contact Form", "slug": "contact-form", "description": "Questions about our plans or your account.", "schema": { "fields": [ { "id": "name", "type": "text", "label": "Full Name", "required": true, "placeholder": "Your name" }, { "id": "email", "type": "email", "label": "Email Address", "required": true, "placeholder": "you@example.com" }, { "id": "phone", "type": "tel", "label": "Phone", "required": false, "validation": { "pattern": "^[0-9 +]{6,20}$" }, "patternIsSafe": true }, { "id": "message", "type": "textarea", "label": "Message", "required": true, "placeholder": "How can we help?" }, { "id": "rating", "type": "rating", "label": "How would you rate us?", "required": false } ], "settings": { "submitLabel": "Send", "successMessage": "Thank you for your message!" }, "conditions": [] }, "settings": {}, "notifications": { "email": { "enabled": true, "to": [ "team@example.com" ], "subject": "New contact request" }, "webhook": { "url": "https://example.com", "headers": { "Authorization": "[REDACTED]" } } }, "honeypotEnabled": true, "recaptchaEnabled": true, "recaptchaVersion": "v3", "recaptchaMinScore": 0.5, "recaptchaSiteKey": "example-public-site-key", "status": "active", "locale": "en", "translationGroupId": "3f6b2a1c-9d8e-4f7a-b6c5-1e2d3c4b5a69", "createdAt": "2025-01-05T10:00:00.000Z", "updatedAt": "2025-03-20T08:15:00.000Z", "creator": { "id": "5e0c7a52-8f1d-4b6e-9a33-2d4f6c8b1e07", "fullName": "Camille Martin", "email": "camille@example.com", "avatarUrl": null }, "submissionsCount": 134 } } ``` --- --- # List forms **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /forms` **List forms** Returns the site's forms, newest first, 20 per page and at most 100, each with its `submissionsCount`. With `groupByTranslation=true` on a multi-language site, returns one row per translation group, preferring the default-language row, each with a `translations` array covering every enabled locale; `locale` is then ignored. Webhook header values come back as `[REDACTED]` and the webhook URL as its origin only. Required permissions: `forms.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `status` | query | "draft" \| "active" \| "closed" \| "archived" | No | One of: draft, active, closed, archived | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "created_at" \| "updated_at" \| "name" | No | One of: created_at, updated_at, name | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | | `slug` | query | string | No | URL-friendly identifier, unique per site and locale | | `slugs` | query | string[] | No | Keeps only the items whose slug is one of these | | `ids` | query | string[] | No | Keeps only the items with these UUIDs | | `excludeIds` | query | string[] | No | Leaves out the items with these UUIDs | | `groupByTranslation` | query | boolean | No | On a multi-language site, `true` lists one item per translation group, with its `translations`. `locale` is then ignored | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `translationGroupId` | query | string | No | Translation group UUID (links translations across locales). UUID format | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl https://api.lynkow.com/v1/forms \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "0e7da14e-d357-547b-baac-cf3fb74710d6", "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "createdBy": "5e0c7a52-8f1d-4b6e-9a33-2d4f6c8b1e07", "name": "Contact Form", "slug": "contact-form", "description": null, "schema": { "fields": [ { "id": "email", "type": "email", "label": "Email", "required": true }, { "id": "message", "type": "textarea", "label": "Message", "required": true } ], "settings": { "successMessage": "Thank you for reaching out!" }, "conditions": [] }, "settings": {}, "notifications": { "email": { "enabled": true, "to": [ "team@example.com" ] }, "webhook": { "url": "https://example.com", "headers": { "Authorization": "[REDACTED]" } } }, "honeypotEnabled": true, "recaptchaEnabled": false, "recaptchaVersion": "v2", "recaptchaMinScore": 0.5, "recaptchaSiteKey": null, "status": "active", "locale": "en", "translationGroupId": "3f6b2a1c-9d8e-4f7a-b6c5-1e2d3c4b5a69", "createdAt": "2025-01-05T10:00:00.000Z", "updatedAt": "2025-03-20T08:15:00.000Z", "creator": { "id": "5e0c7a52-8f1d-4b6e-9a33-2d4f6c8b1e07", "fullName": "Camille Martin", "email": "camille@example.com", "avatarUrl": null }, "submissionsCount": 134 }, { "id": "f5911a45-d664-5959-ace7-5f35dd2b41fe", "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "createdBy": null, "name": "Newsletter Signup", "slug": "newsletter-signup", "description": "Monthly product news.", "schema": { "fields": [ { "id": "email", "type": "email", "label": "Email", "required": true } ], "settings": { "submitLabel": "Subscribe" }, "conditions": [] }, "settings": {}, "notifications": { "email": null, "webhook": null }, "honeypotEnabled": true, "recaptchaEnabled": false, "recaptchaVersion": "v2", "recaptchaMinScore": 0.5, "recaptchaSiteKey": null, "status": "active", "locale": "en", "translationGroupId": "8c1d2e3f-4a5b-4c6d-9e7f-0a1b2c3d4e5f", "createdAt": "2025-01-10T14:00:00.000Z", "updatedAt": "2025-04-01T09:30:00.000Z", "creator": null, "submissionsCount": 892 } ], "meta": { "total": 2, "perPage": 20, "currentPage": 1, "lastPage": 1, "firstPage": 1, "firstPageUrl": "/?page=1", "lastPageUrl": "/?page=1", "nextPageUrl": null, "previousPageUrl": null } } ``` --- --- # Get review statistics **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /reviews/stats` **Get review statistics** Returns review counts for the site. `averageRating` and `ratingDistribution` cover approved reviews only. `featuredCount` counts featured reviews in any status, and `thisMonth` counts the reviews created since the first day of the current month. Required permissions: `reviews.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/reviews/stats \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "total": 67, "byStatus": { "pending": 8, "approved": 54, "rejected": 5 }, "averageRating": 4.35, "ratingDistribution": { "1": 2, "2": 3, "3": 8, "4": 17, "5": 24 }, "featuredCount": 6, "thisMonth": 12 } } ``` --- --- # Find content using this file **Published**: 2026-11-30 **Category**: Media & Files ## `GET /media/:id/references` **Find content using this file** Returns the contents whose featured image, Open Graph image or body uses this media file, by ID or URL, to check the impact of deleting it. The list holds only contents the caller may read: every one with `contents.view`, none without it. A trashed file returns 404. Required permissions: `media.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/media/a1b2c3d4-e5f6-7890-abcd-ef1234567890/references \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "mediaId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "references": { "contents": [ { "id": "59578d61-aa05-5c43-b6bd-14399b3b102b", "title": "Getting Started with Lynkow", "slug": "getting-started", "status": "published" }, { "id": "1d172c1b-6256-5976-ab3a-aa9903f74c50", "title": "Advanced Configuration", "slug": "advanced-configuration", "status": "published" } ] }, "totalReferences": 2 } } ``` --- --- # Update a folder **Published**: 2026-11-30 **Category**: Media & Files ## `PUT /media-folders/:id` **Update a folder** Renames a folder with `name`, and moves it with `parentId` as `POST /media-folders/{id}/move` does: under another folder, or to the root with `parentId: null`. Omit `parentId` to leave the folder where it is. Errors: 400 when the target is the folder itself or one of its subfolders, or when the move would nest folders deeper than 3 levels; 404 for an unknown target folder. A refused move renames nothing. Required permissions: `media.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-255 characters | | `parentId` | string \| null | No | Folder to move this one under; `null` moves it to the root, omit it to keep it in place | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/media-folders/f1a2b3c4-d5e6-4890-abcd-ef1234567890 \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "Hero Banners"}' ``` ### Response Example ```json { "data": { "id": "f1a2b3c4-d5e6-4890-abcd-ef1234567890", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "name": "Hero Banners", "parentId": null, "createdAt": "2025-01-15T09:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # List media files **Published**: 2026-11-30 **Category**: Media & Files ## `GET /media` **List media files** Returns a paginated list of the site's media files, newest first, without trashed files. Filter by folder (`folderId=null` for the root), by MIME type prefix (`image` or `image/png`), by filename search, by creation date and by size. With `locale`, each row also carries `alt`, `altLocale` and `altIsFallback`: the alt text in that locale when the site enables it, else in its base language, else in the site default locale. A locale the site does not enable falls back the same way. Without `locale`, the default-locale alt is `metadata.alt`. Required permissions: `media.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page, 50 by default | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "created_at" \| "updated_at" \| "filename" \| "size" | No | One of: created_at, updated_at, filename, size | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | | `mimeType` | query | string | No | MIME type (e.g. image/jpeg) | | `sizeMin` | query | number | No | Keeps only the files of at least this size, in bytes | | `sizeMax` | query | number | No | Keeps only the files of at most this size, in bytes | | `ids` | query | string[] | No | Keeps only the items with these UUIDs | | `excludeIds` | query | string[] | No | Leaves out the items with these UUIDs | | `folderId` | query | string | No | Media folder UUID | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash # List images in a specific folder curl "https://api.lynkow.com/v1/media?folderId=uuid-of-folder&mimeType=image" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "a1b2c3d4-e5f6-4890-abcd-ef1234567890", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "uploadedBy": null, "folderId": "f1a2b3c4-d5e6-4890-abcd-ef1234567890", "filename": "0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp", "originalFilename": "hero-banner.webp", "path": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp", "mimeType": "image/webp", "size": 245760, "metadata": { "width": 1920, "height": 1080, "format": "webp", "alt": "Homepage hero banner" }, "url": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp", "variants": { "thumbnail": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp?w=150", "card": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp?w=400", "content": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp?w=800", "medium": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp?w=1200" }, "createdAt": "2025-02-10T12:00:00.000Z", "updatedAt": "2025-02-10T12:00:00.000Z", "deletedAt": null } ], "meta": { "total": 156, "perPage": 50, "currentPage": 1, "lastPage": 4 } } ``` --- --- # Create a folder **Published**: 2026-11-30 **Category**: Media & Files ## `POST /media-folders` **Create a folder** Creates a media folder at the root, or under `parentId`. Folders nest at most 3 levels deep. Errors: 400 when the parent is already at the third level, 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the site has reached its plan's media folder count, 404 for an unknown `parentId`. Required permissions: `media.upload` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Required. Display name. 1-255 characters | | `parentId` | string | No | Parent resource ID. UUID format | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/media-folders \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "Product Photos", "parentId": null}' ``` ### Response Example ```json { "data": { "id": "f4d5e6f7-a8b9-4123-8efa-345678901234", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "name": "Product Photos", "parentId": null, "createdAt": "2025-04-06T11:00:00.000Z", "updatedAt": "2025-04-06T11:00:00.000Z" } } ``` --- --- # Get a tag **Published**: 2026-11-30 **Category**: Core CMS ## `GET /tags/:id` **Get a tag** Returns one tag. Responds 404 when the tag does not exist. Required permissions: `tags.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/tags/69b7fdea-41d6-5c52-8a78-1da08b08c5a9 \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "69b7fdea-41d6-5c52-8a78-1da08b08c5a9", "siteId": "4f1b5c3e-8a2d-5e6f-9b0c-1d2e3f4a5b6c", "name": "JavaScript", "slug": "javascript", "locale": "en", "translationGroupId": "6c8d3f2b-4e5a-4b7c-9d0e-1f2a3b4c5d6e", "createdAt": "2025-01-08T10:00:00.000Z", "updatedAt": "2025-01-08T10:00:00.000Z" } } ``` --- --- # List popular tags **Published**: 2026-11-30 **Category**: Core CMS ## `GET /tags/popular` **List popular tags** Returns the tags used by the most contents, most used first, with their `count`. `limit` runs from 1 to 100 and defaults to 10; a value outside that range returns 422. Without `locale` the list holds the tags of every locale, so a tag translated three times appears three times. `locale` filters to one language and never falls back. Required permissions: `tags.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `limit` | query | integer (1 to 100) | No | Number of tags to return, most used first, 10 by default | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Response Example ```json { "data": [ { "id": "2c2bfe0c-b001-5bda-ad90-d9e6aeced0a5", "name": "JavaScript", "slug": "javascript", "count": 15 } ] } ``` --- --- # Create a tag **Published**: 2026-11-30 **Category**: Core CMS ## `POST /tags` **Create a tag** Creates a tag. Send `name` and `slug` (lowercase letters, digits and hyphens). `locale` defaults to the site's default locale. The slug must be unique within its locale: the same slug may exist in another locale. Errors: 409 when the slug is taken in that locale, 400 for a locale the site does not enable, 402 `SUBSCRIPTION_QUOTA_EXCEEDED` at the plan's tag limit. Required permissions: `tags.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Required. Display name. 1-100 characters | | `slug` | string | Yes | Required. URL-friendly identifier, unique per site and locale. 1-100 characters | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/tags \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "TypeScript", "slug": "typescript" }' ``` ### Response Example ```json { "data": { "id": "c4efb292-cd0d-5530-8a00-a0c5b0c591bf", "siteId": "4f1b5c3e-8a2d-5e6f-9b0c-1d2e3f4a5b6c", "name": "TypeScript", "slug": "typescript", "locale": "en", "translationGroupId": null, "createdAt": "2025-04-06T12:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # List tags **Published**: 2026-11-30 **Category**: Core CMS ## `GET /tags` **List tags** Returns a paginated list of tags, 20 per page by default and 100 at most. Filter by `search`, `slug` or `ids`. Without `locale` the list holds the tags of every locale. `locale` is a strict filter: a locale with no tags returns an empty page, and a value that is not a locale code returns 422. Required permissions: `tags.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100, default 20) | No | Number of items per page | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "created_at" \| "updated_at" \| "name" \| "slug" (default "name") | No | One of: created_at, updated_at, name, slug | | `sortOrder` | query | "asc" \| "desc" (default "asc") | No | One of: asc, desc | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | | `slug` | query | string | No | URL-friendly identifier, unique per site and locale | | `slugs` | query | string[] | No | Keeps only the items whose slug is one of these | | `ids` | query | string[] | No | Keeps only the items with these UUIDs | | `excludeIds` | query | string[] | No | Leaves out the items with these UUIDs | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl https://api.lynkow.com/v1/tags \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "a499bb4e-d2cc-551b-ab55-bc0e3371500d", "name": "API", "slug": "api", "locale": "en", "translationGroupId": null }, { "id": "2c2bfe0c-b001-5bda-ad90-d9e6aeced0a5", "name": "JavaScript", "slug": "javascript", "locale": "en", "translationGroupId": "6c8d3f2b-4e5a-4b7c-9d0e-1f2a3b4c5d6e" }, { "id": "e7898726-5897-5894-a288-77b939ac0c24", "name": "Tutorial", "slug": "tutorial", "locale": "en", "translationGroupId": null } ], "meta": { "total": 18, "perPage": 20, "currentPage": 1, "lastPage": 2 } } ``` --- --- # Delete a category **Published**: 2026-11-30 **Category**: Core CMS ## `DELETE /categories/:id` **Delete a category** Deletes a category. Contents assigned to it are kept and lose this category. Required permissions: `categories.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Success | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | > **Notes:** - A category that still has child categories is refused with 400: move or delete its children first. A category in structured mode that still has contents is refused with 422. > > - Unlike other deletes, responds 200 with `{ data: { redirectsCreated, redirectsSkipped } }`. > - Each published content under the deleted category gets a 301 redirect (nested blog URLs only) to its main URL (the one under its first remaining category) or, when it is left with no category, to its URL without a category. > - `redirectsCreated` counts those rules. They count toward the limit of 10000 automatic redirect rules per site, separate from manual rules: once the site holds 10000, the others are not created and are counted in `redirectsSkipped`, and the deletion still succeeds. > - The redirects and the deletion are written together, so a deletion that fails leaves no redirect behind. The category page itself gets no automatic redirect. ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/categories/2756b9e9-b25f-533e-a87b-1c2efb2536c5 \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "redirectsCreated": 0, "redirectsSkipped": 0 } } ``` --- --- # Create a variable **Published**: 2026-11-30 **Category**: Core CMS ## `POST /variables` **Create a variable** Creates a variable. Send `key`, `label` and `value`. `type` is `text` (the default) or `calendar`, and `locale` defaults to the site's default locale. The `key` must be unique within its locale and is used in content as a `{{key}}` placeholder. A translation made with the copy call shares its source's key. For a `calendar` variable, `value` is a JSON string holding an `events` array of at most 200 events. Event descriptions are sanitized to the tags `p`, `strong`, `em`, `b`, `i`, `u` and `br`, with no attributes, and the 5000-character limit applies after sanitizing. Event dates must fall between the years 1900 and 2200. An invalid calendar value returns 400. Errors: 409 `VARIABLE_KEY_TAKEN`, 400 for a locale the site does not enable, 402 `SUBSCRIPTION_QUOTA_EXCEEDED` at the plan's variable limit. Required permissions: `variables.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | "text" \| "calendar" | No | Resource type. One of: text, calendar | | `key` | string | Yes | Required. 1-100 characters | | `label` | string | Yes | Required. Merchant-visible reservation offering label. 1-255 characters | | `value` | string | Yes | Required. Amount value. 1-100000 characters | | `description` | string | No | Description text. Max 500 characters | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/variables \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "key": "support_email", "label": "Support email", "value": "support@acme.com", "type": "text" }' ``` ### Response Example ```json { "data": { "id": "68302464-2459-50e6-8366-4c81bf568d0d", "key": "support_email", "value": "support@acme.com", "type": "text", "locale": "en", "createdAt": "2025-04-06T12:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # Get a category **Published**: 2026-11-30 **Category**: Core CMS ## `GET /categories/:id` **Get a category** Returns one category with its parent (when it has one), its direct children, its full `path` and its resolved sitemap settings. Responds 404 when the category does not exist. Required permissions: `categories.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/categories/6714734d-fe98-5306-9b01-205a94cfa0f4 \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "id": "6714734d-fe98-5306-9b01-205a94cfa0f4", "name": "Tutorials", "slug": "tutorials", "description": "Step-by-step guides and how-tos", "parentId": null, "locale": "en", "contentCount": 12, "parent": null, "contents": { "data": [ { "id": "29e24dc2-82ed-529f-8fca-625288daed12", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "status": "published" } ], "meta": { "total": 12, "perPage": 15, "currentPage": 1, "lastPage": 1 } }, "createdAt": "2025-01-10T09:00:00.000Z", "updatedAt": "2025-02-20T16:45:00.000Z" } ``` --- --- # Get tag translation status **Published**: 2026-11-30 **Category**: Core CMS ## `GET /tags/:id/translations` **Get tag translation status** Returns the translations that exist for this tag: one entry per existing translation, the requested tag included, flagged `current`. A locale with no translation has no entry, and the list is empty when the tag has no translation group. `needsReview` is true when that translation was written against a default-language version of the tag that has changed since. Required permissions: `tags.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/tags/e3fe29d5-1688-551b-8f36-a287a532e466/translations \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "translationGroupId": "6c8d3f2b-4e5a-4b7c-9d0e-1f2a3b4c5d6e", "currentLocale": "en", "translations": [ { "id": "e3fe29d5-1688-551b-8f36-a287a532e466", "locale": "en", "name": "JavaScript", "slug": "javascript", "current": true, "needsReview": false }, { "id": "cbfee952-07ce-5c63-98ef-257b15ffdae5", "locale": "fr", "name": "JavaScript", "slug": "javascript", "current": false, "needsReview": false } ] } } ``` --- --- # Copy category to another locale **Published**: 2026-11-30 **Category**: Core CMS ## `POST /categories/:id/copy-to-locale` **Copy category to another locale** Creates a copy of this category in `targetLocale`. When the parent has a translation in that locale, the copy is attached to it. Content assignments that were waiting for the locale are restored. An automatic redirect rule whose source is the copy's URL (left by an earlier URL change) is deleted, so it no longer shadows the copy. Hand-written redirects are never touched. Requires both `categories.create` and `categories.view`. A site at its plan's category limit gets 402 `SUBSCRIPTION_QUOTA_EXCEEDED`. Required permissions: `categories.create`, `categories.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `targetLocale` | string | Yes | Required. BCP 47 locale code of the locale to copy into (e.g. "fr", "es"). Must be enabled on the site. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | The target locale or copy operation is invalid. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | A category in this translation group already exists in the target locale. | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/categories/73f3c471-0fb5-581c-a3ed-2f822c4bb8b4/copy-to-locale \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"targetLocale": "fr"}' ``` ### Response Example ```json { "data": { "id": "8bec0447-6b77-5572-8cb4-4909fe02e7eb", "name": "Tutorials", "slug": "tutorials", "description": "Step-by-step guides and how-tos", "parentId": null, "locale": "fr", "createdAt": "2025-04-06T15:00:00.000Z", "updatedAt": "2025-04-06T15:00:00.000Z" } } ``` --- --- # Get a search profile **Published**: 2026-11-30 **Category**: Core CMS ## `GET /search/profiles/:id` **Get a search profile** Returns one search profile by ID for the current site, with the full internal configuration (scope, searchable fields, facets, sort, limits). 404 if the profile does not exist or belongs to another site. Required permissions: `search.profiles.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl "https://api.lynkow.com/v1/search/profiles/3f2b1c8a-9d4e-4a7f-8b21-5e6d7c8a9b01" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "3f2b1c8a-9d4e-4a7f-8b21-5e6d7c8a9b01", "siteId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "slug": "api-docs", "name": "API Docs", "description": "Search scoped to the API reference.", "isPublic": true, "isDefault": false, "scope": { "includeCategories": [ "api-reference" ], "includeLocales": [ "en" ] }, "searchableFields": [ "title", "excerpt", "body", "metaTitle" ], "displayedFields": [ "id", "title", "slug", "path", "excerpt" ], "facets": [ "categories.slug", "tags.slug" ], "sort": [ "publishedAt:desc" ], "defaultLimit": 20, "maxLimit": 50, "boostedContentIds": [], "featuredContentIds": [], "createdAt": "2026-06-07T10:32:14.512+00:00", "updatedAt": "2026-06-07T10:32:14.512+00:00" } } ``` --- --- # Get category tree **Published**: 2026-11-30 **Category**: Core CMS ## `GET /categories/tree` **Get category tree** Returns every category as a nested tree, sorted by name at each level. Each category carries its `children`. The tree is not paginated. Required permissions: `categories.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/categories/tree \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "6fdd481d-d9d8-5851-8aa0-803f75a428c0", "name": "Tutorials", "slug": "tutorials", "contentCount": 12, "children": [ { "id": "a562b6f5-0ab9-59f4-8eef-e99be0170e7a", "name": "API Guides", "slug": "api-guides", "contentCount": 5, "children": [] }, { "id": "fe1899e4-c531-554b-9d7b-c28a8a733cbb", "name": "Frontend", "slug": "frontend", "contentCount": 7, "children": [] } ] }, { "id": "fbbd0501-fee5-5702-a211-c552ac575efb", "name": "News", "slug": "news", "contentCount": 18, "children": [] } ] } ``` --- --- # Update submission status **Published**: 2026-11-30 **Category**: Forms & Reviews ## `PUT /forms/:id/submissions/:submissionId/status` **Update submission status** Sets a submission's status. A token without `forms.submissions.view` receives an acknowledgement instead of the submission. An unknown form or submission id returns 404. Required permissions: `forms.submissions.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | | `submissionId` | path | string | Yes | Form submission ID | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `status` | "new" \| "read" \| "spam" \| "archived" | Yes | Required. One of: new, read, spam, archived | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/forms/fd032eff-557d-5413-bb38-ca867837b72c/submissions/5d3991e2-db04-5ec2-97c6-9dc35b414d3d/status \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"status": "read"}' ``` ### Response Example ```json { "data": { "id": "5d3991e2-db04-5ec2-97c6-9dc35b414d3d", "formId": "fd032eff-557d-5413-bb38-ca867837b72c", "locale": "fr", "status": "read", "data": { "name": "Sophie Bernard", "email": "sophie@example.com", "message": "I would like to know more about your enterprise plan." }, "createdAt": "2025-04-05T16:30:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # Duplicate a content **Published**: 2026-11-30 **Category**: Core CMS ## `POST /contents/:id/duplicate` **Duplicate a content** Creates a `draft` copy of a content in the same locale, titled ` (Copy)` with the slug `<slug>-copy-<timestamp>`. The body, custom data, SEO fields, categories and tags are copied. Revisions are not: the copy starts with no history. Requires `contents.create` and `contents.view`. Returns 402 when the site's content quota is reached. Required permissions: `contents.create`, `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/contents/017324ab-05eb-5358-9f7b-150c4a5d0c0a/duplicate \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "3cdd6276-16c3-5f1d-aec6-2eb13daa7065", "title": "Getting Started with Lynkow (Copy)", "slug": "getting-started-with-lynkow-copy-1743951600000", "type": "post", "status": "draft", "excerpt": "Learn how to set up your first headless CMS.", "locale": "en", "categories": [ { "id": "bb50b8f5-e196-53a7-9661-505cc6938d1b", "name": "Tutorials", "slug": "tutorials" } ], "tags": [ { "id": "163054ca-5076-5958-b41d-0fe2f4aa16ac", "name": "Getting Started", "slug": "getting-started" } ], "publishedAt": null, "createdAt": "2025-04-06T15:00:00.000Z", "updatedAt": "2025-04-06T15:00:00.000Z" } } ``` --- --- # Delete a content **Published**: 2026-11-30 **Category**: Core CMS ## `DELETE /contents/:id` **Delete a content** Permanently deletes a content with its revisions. Its other translations are kept. To keep the content but take it offline, archive it with `POST /contents/{id}/status` instead. Fires the `content.deleted` webhook. Required permissions: `contents.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/contents/3b16c6e4-c690-5b86-98b7-2353846bdfbf \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Update a content **Published**: 2026-11-30 **Category**: Core CMS ## `PUT /contents/:id` **Update a content** Updates a content. Only the fields you send change, and each update saves a revision first. `body`, `bodyMarkdown` and a changed `slug` follow the rules of `POST /contents`. Moving the content to `published` or `scheduled`, or moving the date of a scheduled content, requires `contents.publish` (403 `AUTHZ_INSUFFICIENT_PERMISSIONS` otherwise). A URL change of a published content (a new `slug`, or with nested blog URLs a new category) creates automatic 301 redirect rules from the URLs it had to the ones it now has, counted in `redirectsCreated` and `redirectsSkipped`. Publishing a content deletes the automatic redirect rules whose source is one of its URLs. Hand-written redirects are never changed. Fires the `content.updated` webhook, also for each other translation whose categories or tags it changes. Errors: 404 for a category or tag of another site, 409 for a slug in use or a status changed meanwhile, 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` for a `jsonLdGraph` or `jsonLdExclusions` entry the stored list lacks when the site's plan lacks advanced JSON-LD. Required permissions: `contents.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `type` | "post" | No | Resource type. One of: post | | `title` | string | No | Display title. 1-500 characters | | `slug` | string | No | URL-friendly identifier of this article, the last segment of its path. It cannot contain /, *, ?, #, a backslash, whitespace or a control character; the stored slug sent back unchanged is always accepted | | `excerpt` | string \| null | No | Short summary for previews; null clears it | | `body` | object | No | Rich text content as TipTap JSON | | `bodyMarkdown` | string | No | Content as Markdown (converted to TipTap JSON on save) | | `status` | "draft" \| "published" \| "archived" \| "scheduled" | No | One of: draft, published, archived, scheduled | | `featuredImage` | string \| null | No | Featured image URL; null clears it | | `featuredImageAlt` | string \| null | No | Alternative text of the featured image, for accessibility and search engines; null clears it | | `scheduledAt` | string | No | Scheduled publication datetime (ISO 8601) | | `metaTitle` | string \| null | No | Custom meta title for SEO | | `metaDescription` | string \| null | No | Meta description for search engines | | `keywords` | string \| null | No | Comma-separated SEO keywords | | `canonicalUrl` | string \| null | No | Canonical URL override | | `ogImage` | string \| null | No | Open Graph image URL for social sharing | | `ogImageAlt` | string \| null | No | Alternative text of the Open Graph image | | `noIndex` | boolean | No | When true, asks search engines not to index the page (robots noindex) | | `noFollow` | boolean | No | When true, asks search engines not to follow the links of the page (robots nofollow) | | `ogTitle` | string \| null | No | Open Graph title used when the page is shared on social networks | | `ogDescription` | string \| null | No | Open Graph description used when the page is shared on social networks | | `twitterCard` | "summary" \| "summary_large_image" \| "app" \| "player" \| null | No | Card type used when the page is shared on social networks (summary, summary_large_image, app or player) | | `sitemapPriority` | number (0 to 1) \| null | No | Sitemap priority of this article from 0.0 to 1.0 with at most one decimal place (0.8, not 0.85), or null to use the site default | | `sitemapChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" \| null | No | Sitemap change frequency (always, hourly, daily, weekly, monthly, yearly or never) | | `authorName` | string \| null | No | Display name of the author | | `authorUrl` | string \| null | No | Author profile or website URL | | `meta` | object | No | Additional metadata | | `categoryIds` | string[] | No | Categories of the content, by id, replacing the current set. With nested URLs, the first one sets the URL path | | `tagIds` | string[] | No | Tags of the content, by id, replacing the current set. `[]` removes every tag, and an omitted value leaves them unchanged | | `customData` | object \| null | No | Custom fields data (structured content) | | `faqSettings` | object | No | FAQ detection and JSON-LD settings | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | | `displayOrder` | number | No | Sort position: in ascending order, lower values come first | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | The new slug is already in use (field `slug`), or another request, a scheduled publication included, changed the content's status during the update (code `RESOURCE_CONFLICT`: reload and retry). Nothing is changed. | | `422` | Validation error | > **Notes:** - A caller without `contents.view` receives an acknowledgement with the same counts. > > - Resending, reordering, removing or clearing stored `jsonLdGraph` or `jsonLdExclusions` entries is accepted on any plan. > - With nested blog URLs a content has one URL per category. Each URL that moves redirects to its new URL in the same category, else to the content's main URL. > - Automatic rules aimed at an old URL are repointed to the new one, so renaming a content back leaves no redirect loop. > - `redirectsSkipped` counts the rules not written because the site holds its limit of 10000 automatic redirect rules, which manual rules do not count toward. The update still succeeds. > - Some moves write no rule, for example when another page or record already serves the old URL. They are counted in neither field. > - `categoryIds` and `tagIds` also apply to the content's other translations, using the categories and tags of each one's language. A repeated ID returns 422. > - When the content is or becomes `scheduled`, a request sending `status` or `scheduledAt` needs a `scheduledAt`. Entering `scheduled` needs a future date, else 422. > - A `featuredImage` or `ogImage` replaced without its alt field (`featuredImageAlt`, `ogImageAlt`) clears that alt text. ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/contents/66b78336-a803-5a99-aa3a-7d2a2d71a8ff \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Updated Title", "excerpt": "Updated excerpt for the article." }' ``` ### Response Example ```json { "data": { "id": "66b78336-a803-5a99-aa3a-7d2a2d71a8ff", "title": "Updated Title", "slug": "getting-started-with-lynkow", "type": "post", "status": "published", "excerpt": "Updated excerpt for the article.", "bodyHtml": "<h1>Welcome</h1><p>This is your first article...</p>", "locale": "en", "categories": [ { "id": "33591f9b-9f9d-5671-bae5-e7e487492978", "name": "Tutorials", "slug": "tutorials" } ], "tags": [ { "id": "00818715-6c02-525f-9158-3f6a2066ae0d", "name": "Getting Started", "slug": "getting-started" } ], "author": { "id": "668b54cc-3758-5382-8c52-74631dc66936", "fullName": "Jane Doe" }, "publishedAt": "2025-03-15T10:30:00.000Z", "createdAt": "2025-03-14T08:00:00.000Z", "updatedAt": "2025-04-06T14:00:00.000Z", "redirectsCreated": 0, "redirectsSkipped": 0 } } ``` --- --- # Bulk publish contents **Published**: 2026-11-30 **Category**: Core CMS ## `POST /contents/bulk-publish` **Bulk publish contents** Publishes up to 100 contents by ID, whatever their status. A content already published is published again, with `publishedAt` set to now. IDs that match no content of the site are ignored. A content whose status another request changed meanwhile is left as is, and is neither returned nor counted. Fires one `content.bulk_published` webhook carrying the published IDs. Required permissions: `contents.publish` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `ids` | string[] | Yes | Required | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | > **Notes:** - Maximum 100 IDs per request. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/contents/bulk-publish \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"ids": ["b857bb88-9d15-5a2e-8863-ce1ee99482d6", "1f0c2a4e-6d3b-4c8a-9e7f-2b5d8a1c3e90"]}' ``` ### Response Example ```json { "data": [ { "id": "b857bb88-9d15-5a2e-8863-ce1ee99482d6", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "status": "published", "publishedAt": "2026-06-01T09:00:00.000Z" }, { "id": "1f0c2a4e-6d3b-4c8a-9e7f-2b5d8a1c3e90", "title": "Content Modeling Basics", "slug": "content-modeling-basics", "status": "published", "publishedAt": "2026-06-01T09:00:00.000Z" } ], "meta": { "message": "Successfully published 2 content(s)", "redirectsRemoved": 0 } } ``` --- --- # Update a form **Published**: 2026-11-30 **Category**: Forms & Reviews ## `PUT /forms/:id` **Update a form** Updates a form. An omitted field keeps its stored value. `name`, `description` and `schema` apply to this translation only; `slug`, `status`, `settings`, `notifications`, `honeypotEnabled` and the CAPTCHA fields apply to every translation of the form. Existing submissions are kept when the schema changes. Adding a notification destination requires `forms.submissions.view`, or the request returns 403 `AUTHZ_INSUFFICIENT_PERMISSIONS` and writes nothing. A caller without `forms.view` receives an acknowledgement instead of the form. Fires the `form.updated` webhook. Errors: 409 `RESOURCE_ALREADY_EXISTS` when another form uses the slug in the locale of any translation, 422 for invalid input. A rejected request writes nothing. Required permissions: `forms.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-255 characters | | `slug` | string | No | URL-friendly identifier, unique per site and locale. 1-255 characters | | `description` | string | No | Description text. Max 1000 characters | | `schema` | object | No | Field schema definition | | `settings` | object | No | Configuration settings | | `notifications` | object | No | Notification preferences | | `honeypotEnabled` | boolean | No | Whether a submission that fills the hidden decoy field is dropped. The sender still receives a success response | | `recaptchaEnabled` | boolean | No | Whether submissions must carry a reCAPTCHA token. It needs `recaptchaSiteKey` and `recaptchaSecretKey` | | `recaptchaVersion` | "v2" \| "v3" | No | Verification version: v2 challenge or v3 action and score verification. One of: v2, v3 | | `recaptchaMinScore` | number (0 to 1) | No | Minimum accepted v3 score between 0 and 1, default 0.5; authenticated configuration only | | `recaptchaSiteKey` | string | No | Max 255 characters | | `recaptchaSecretKey` | string | No | Max 255 characters | | `status` | "draft" \| "active" \| "closed" \| "archived" | No | One of: draft, active, closed, archived | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | A form with this slug already exists in the requested locale. | | `422` | Invalid input, such as CAPTCHA enabled without both keys, or a webhook header placeholder that cannot be resolved, repeated under another case or impossible to deliver. | > **Notes:** - Webhook header values read as `[REDACTED]`. Send the placeholder back to keep a stored value; a header you omit is removed. > > - A placeholder sent with a changed webhook URL, or for a header with no stored value, returns 422. The origin a read returned counts as an unchanged URL. > - Header names are matched case-insensitively and keep the casing you send. Two names that differ only by case return 422. > - A webhook header name must be an HTTP token. A value must be a string, number or boolean with no control character other than tab and no character beyond U+00FF. > - A CAPTCHA field you omit, or a blank key, keeps its stored value. CAPTCHA left enabled without both keys returns 422. > - A destination counts as added when an enabled email notification gains a recipient or reply-to address, or a webhook URL is new or newly enabled. > - `notifications.email.to` holds at most 10 addresses, with no duplicate when compared case-insensitively. The stored list sent back unchanged is accepted. > - The webhook URL must be a public `http` or `https` endpoint: a private, loopback or internal address returns 422. > - A `tel` field takes `phoneOptions` with both keys: `showCountryCode` shows the country-code selector, and `defaultCountryCode` is the dial code selected by default, such as `+33`. ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/forms/14902076-0669-5228-8ea4-c5873ade393e \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Contact Form v2", "status": "active", "schema": { "fields": [ {"id": "name", "type": "text", "label": "Full Name", "required": true}, {"id": "email", "type": "email", "label": "Email", "required": true}, {"id": "message", "type": "textarea", "label": "Message", "required": true} ], "settings": {"successMessage": "We will get back to you within 24h."} } }' ``` ### Response Example ```json { "data": { "id": "14902076-0669-5228-8ea4-c5873ade393e", "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "createdBy": "5e0c7a52-8f1d-4b6e-9a33-2d4f6c8b1e07", "name": "Contact Form v2", "slug": "contact-form", "description": null, "schema": { "fields": [ { "id": "name", "type": "text", "label": "Full Name", "required": true }, { "id": "email", "type": "email", "label": "Email", "required": true }, { "id": "message", "type": "textarea", "label": "Message", "required": true } ], "settings": { "successMessage": "We will get back to you within 24h." }, "conditions": [] }, "settings": {}, "notifications": { "email": null, "webhook": null }, "honeypotEnabled": true, "recaptchaEnabled": false, "recaptchaVersion": "v2", "recaptchaMinScore": 0.5, "recaptchaSiteKey": null, "status": "active", "locale": "en", "translationGroupId": "9d8c7b6a-5f4e-4d3c-8b2a-1f0e9d8c7b6a", "createdAt": "2025-01-05T10:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z", "creator": { "id": "5e0c7a52-8f1d-4b6e-9a33-2d4f6c8b1e07", "fullName": "Camille Martin", "email": "camille@example.com", "avatarUrl": null } } } ``` --- --- # Upload a base64-encoded media file **Published**: 2026-11-30 **Category**: Media & Files ## `POST /media/upload-base64` **Upload a base64-encoded media file** Uploads an image sent as base64 text in a JSON body, named by `filename`. Accepts the formats of `POST /media/upload` and processes the image the same way. The decoded image must match the extension of `filename`, and is capped at 10 MB. Send standard base64 without a `data:` prefix. Line breaks and tabs are ignored. Spaces, the URL-safe alphabet or misplaced padding return 422, with a message naming the cause. Fires the `media.uploaded` webhook. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the site has reached its media file count or storage quota, 404 for an unknown `folderId`, 413 for an oversized body. Required permissions: `media.upload` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `dataBase64` | string | Yes | Required. Raw base64-encoded image bytes without a data URL prefix. 1-13981016 characters | | `filename` | string | Yes | Required. Original media filename with a supported image extension and no path separators. 1-255 characters | | `alt` | string | No | Alternative text for the media (accessibility and SEO). Max 500 characters | | `folderId` | string | No | Media folder UUID. UUID format | | `preset` | "fast" \| "optimized" \| "quality" | No | Resize and compression preset: `fast` (1280 px, quality 80), `optimized` (1920 px, quality 80, the default) or `quality` (3840 px, quality 90). One of: fast, optimized, quality | | `maxWidth` | integer (100 to 4000) | No | Longest side in pixels the image is scaled down to, overriding the preset. A smaller image is never enlarged | | `quality` | integer (50 to 100) | No | Whole number from 50 to 100: WebP quality, overriding the preset | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `413` | The body exceeds 16 MB, or exceeds 1 MiB once its longest string value, normally `dataBase64`, is left out. Nothing is uploaded. | | `422` | Validation error | --- --- # Get a variable **Published**: 2026-11-30 **Category**: Core CMS ## `GET /variables/:id` **Get a variable** Returns one variable with its value. Responds 404 for an unknown or malformed id. Required permissions: `variables.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/variables/f4375c53-879f-5ecd-b0b6-10f26c1b197b \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "f4375c53-879f-5ecd-b0b6-10f26c1b197b", "key": "company_name", "value": "Acme Corp", "type": "text", "locale": "en", "createdAt": "2025-01-05T09:00:00.000Z", "updatedAt": "2025-01-05T09:00:00.000Z" } } ``` --- --- # Mark a search profile as default **Published**: 2026-11-30 **Category**: Core CMS ## `POST /search/profiles/:id/set-default` **Mark a search profile as default** Makes this profile the site's default, used by `GET /search`. The previous default profile stops being the default. 404 for an unknown profile. 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan does not include Instant Search. Required permissions: `search.profiles.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X POST "https://api.lynkow.com/v1/search/profiles/3f2b1c8a-9d4e-4a7f-8b21-5e6d7c8a9b01/set-default" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "3f2b1c8a-9d4e-4a7f-8b21-5e6d7c8a9b01", "siteId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "slug": "api-docs", "name": "API Reference", "description": "Search scoped to the API reference.", "isPublic": true, "isDefault": true, "scope": { "includeCategories": [ "api-reference" ], "includeLocales": [ "en" ] }, "searchableFields": [ "title", "excerpt", "body", "metaTitle" ], "displayedFields": [ "id", "title", "slug", "path", "excerpt" ], "facets": [ "categories.slug" ], "sort": [ "publishedAt:desc" ], "defaultLimit": 25, "maxLimit": 50, "boostedContentIds": [], "featuredContentIds": [], "createdAt": "2026-06-07T10:32:14.512+00:00", "updatedAt": "2026-06-07T11:08:02.741+00:00" } } ``` --- --- # Delete a submission **Published**: 2026-11-30 **Category**: Forms & Reviews ## `DELETE /forms/:id/submissions/:submissionId` **Delete a submission** Permanently deletes one submission. An unknown form or submission id returns 404. Required permissions: `forms.submissions.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | | `submissionId` | path | string | Yes | Form submission ID | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/forms/02736bc5-36de-50e0-a2e6-878eb7a82532/submissions/4d21935b-dcbb-51ac-bf54-19ebbc3833eb \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Get a folder **Published**: 2026-11-30 **Category**: Media & Files ## `GET /media-folders/:id` **Get a folder** Returns one folder with its breadcrumb `path` from the root, `childrenCount`, the number of its direct subfolders, and `mediaCount`, the number of media files directly inside it, trashed ones excluded. Required permissions: `media.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/media-folders/f3c4d5e6-f7a8-4012-8def-234567890123 \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "f3c4d5e6-f7a8-4012-8def-234567890123", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "name": "Thumbnails", "parentId": "f2b3c4d5-e6f7-4901-bcde-f12345678901", "createdAt": "2025-02-01T14:00:00.000Z", "updatedAt": "2025-03-10T14:00:00.000Z", "path": [ { "id": "f2b3c4d5-e6f7-4901-bcde-f12345678901", "name": "Blog Images" }, { "id": "f3c4d5e6-f7a8-4012-8def-234567890123", "name": "Thumbnails" } ], "childrenCount": 0, "mediaCount": 42 } } ``` --- --- # List folders **Published**: 2026-11-30 **Category**: Media & Files ## `GET /media-folders` **List folders** Returns the folders directly under `parentId`, sorted by name. Without `parentId`, or with `parentId=null`, returns the root folders. `search` filters on the folder name. Use `GET /media-folders/tree` for the whole hierarchy. Required permissions: `media.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `parentId` | query | string | No | Parent resource ID | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl https://api.lynkow.com/v1/media-folders \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "f1a2b3c4-d5e6-4890-abcd-ef1234567890", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "name": "Banners", "parentId": null, "createdAt": "2025-01-15T09:00:00.000Z", "updatedAt": "2025-01-15T09:00:00.000Z" }, { "id": "f2b3c4d5-e6f7-4901-bcde-f12345678901", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "name": "Blog Images", "parentId": null, "createdAt": "2025-01-15T09:05:00.000Z", "updatedAt": "2025-03-02T16:20:00.000Z" } ] } ``` --- --- # Move a file to the trash **Published**: 2026-11-30 **Category**: Media & Files ## `DELETE /media/:id` **Move a file to the trash** Moves a file to the trash. Its URL keeps working until the file is deleted for good, 30 days later or earlier with `DELETE /media/{id}/force`. Restore it with `POST /media/{id}/restore`. Fires the `media.trashed` webhook. A file already in the trash returns 404. Required permissions: `media.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/media/a1b2c3d4-e5f6-7890-abcd-ef1234567890 \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Get media details **Published**: 2026-11-30 **Category**: Media & Files ## `GET /media/:id` **Get media details** Returns one media file with its URL. A raster image also carries `variants`, URLs for several display sizes. A trashed file returns 404. With `locale`, the response also carries `alt`, `altLocale` and `altIsFallback`, resolved as in `GET /media`. Without `locale`, the default-locale alt is `metadata.alt`. Required permissions: `media.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/media/a1b2c3d4-e5f6-4890-abcd-ef1234567890 \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "a1b2c3d4-e5f6-4890-abcd-ef1234567890", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "uploadedBy": null, "folderId": "f1a2b3c4-d5e6-4890-abcd-ef1234567890", "filename": "0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp", "originalFilename": "hero-banner.webp", "path": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp", "mimeType": "image/webp", "size": 245760, "metadata": { "width": 1920, "height": 1080, "format": "webp", "alt": "Homepage hero banner" }, "url": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp", "variants": { "thumbnail": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp?w=150", "card": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp?w=400", "content": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp?w=800", "medium": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp?w=1200" }, "createdAt": "2025-02-10T12:00:00.000Z", "updatedAt": "2025-03-15T09:30:00.000Z", "deletedAt": null } } ``` --- --- # Empty trash **Published**: 2026-11-30 **Category**: Media & Files ## `DELETE /media/trash` **Empty trash** Permanently deletes every trashed file of the site. Their storage is freed as each file is removed from Lynkow media storage, shortly after the response. Fires no webhook. This cannot be undone. Required permissions: `media.delete` ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | > **Notes:** - Takes longer when many files are trashed. ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/media/trash \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Create a review **Published**: 2026-11-30 **Category**: Forms & Reviews ## `POST /reviews` **Create a review** Creates a review. `status` defaults to `approved`, so the review is public at once unless you send `pending` or `rejected`. `rejectionReason` is stored only with `status: rejected`. `locale` defaults to the site's default locale. `productId` links the review to a product of the site, whatever its status. The server builds the slug from `authorName` and `title`, and sets the source to `admin`. Fires the `review.created` webhook. Errors: 400 for a `locale` a multi-language site does not enable, 422 on `productId` for an unknown, deleted or other site's product, 422 on `customFields` past its limits. Nothing is stored. Required permissions: `reviews.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `authorName` | string | Yes | Required. Display name of the author. 2-100 characters | | `authorEmail` | string | No | Author email address. Valid email address | | `authorPhotoUrl` | string | No | Author photo URL. Valid URL | | `authorCompany` | string | No | Author company name. Max 100 characters | | `authorPosition` | string | No | Author job title. Max 100 characters | | `authorCity` | string | No | Author city. Max 100 characters | | `rating` | integer (1 to 5) | Yes | Required | | `content` | string | Yes | Required. Text content. 10-5000 characters | | `title` | string | No | Display title. Max 200 characters | | `productName` | string | No | Associated product name. Max 200 characters | | `productSku` | string | No | Associated product SKU. Max 100 characters | | `productId` | string \| null | No | The `prod_` id or raw UUID of a product of the site, in any status, that the review is about. Null or omitted leaves the review unlinked | | `customFields` | object | No | Free-form values. Counting the object itself, at most 3 levels deep; up to 50 keys per object, 50 items per array, 200-character keys and 5000-character strings | | `status` | "pending" \| "approved" \| "rejected" | No | One of: pending, approved, rejected | | `rejectionReason` | string \| null | No | Reason for rejection | | `isFeatured` | boolean | No | Highlights the review, which lists can filter on with the `isFeatured` query parameter | | `reviewDate` | string | No | Original review date (ISO 8601) | | `displayOrder` | number | No | Sort position: in ascending order, lower values come first | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | > **Notes:** - To submit a review on behalf of a storefront visitor, use `POST /storefront/{siteId}/reviews`. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/reviews \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "title": "Great product!", "content": "Easy to integrate and the docs are excellent.", "rating": 5, "authorName": "Alice Martin", "authorEmail": "alice@example.com", "productId": "prod_01j9zq7m4k2x8v3n6p5r0t1w2w", "status": "approved" }' ``` ### Response Example ```json { "data": { "id": "ce6d56f3-12cd-537a-b737-af9b1604711a", "title": "Great product!", "content": "Easy to integrate and the docs are excellent.", "rating": 5, "productId": "prod_01j9zq7m4k2x8v3n6p5r0t1w2w", "status": "approved", "rejectionReason": null, "authorName": "Alice Martin", "authorEmail": "alice@example.com", "isFeatured": false, "locale": "en", "createdAt": "2025-04-06T11:00:00.000Z" } } ``` --- --- # Delete a form **Published**: 2026-11-30 **Category**: Forms & Reviews ## `DELETE /forms/:id` **Delete a form** Permanently deletes this translation of a form with all its submissions. Other translations are kept. Fires the `form.deleted` webhook. An unknown id returns 404. Required permissions: `forms.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/forms/6da65f7a-aec6-5876-9b9a-b0c9d69bdf0a \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Bulk archive contents **Published**: 2026-11-30 **Category**: Core CMS ## `POST /contents/bulk-archive` **Bulk archive contents** Archives up to 100 contents by ID, whatever their status. Archived contents are kept but no longer served publicly; no automatic redirect is written. IDs that match no content of the site are ignored. A content whose status another request changed meanwhile is left as is, and is neither returned nor counted. Fires one `content.bulk_archived` webhook carrying the archived IDs. Required permissions: `contents.update` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `ids` | string[] | Yes | Required | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | > **Notes:** - Maximum 100 IDs per request. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/contents/bulk-archive \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"ids": ["b857bb88-9d15-5a2e-8863-ce1ee99482d6"]}' ``` ### Response Example ```json { "data": [ { "id": "b857bb88-9d15-5a2e-8863-ce1ee99482d6", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "status": "archived", "publishedAt": "2026-06-01T09:00:00.000Z" } ], "meta": { "message": "Successfully archived 1 content(s)", "redirectsCreated": 0 } } ``` --- --- # List trashed files **Published**: 2026-11-30 **Category**: Media & Files ## `GET /media/trash` **List trashed files** Returns a paginated list of trashed files, most recently trashed first. `search` matches the filename. A trashed file is deleted for good 30 days after it was trashed, unless you restore it with `POST /media/{id}/restore`. Required permissions: `media.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page, 50 by default | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "deleted_at" \| "created_at" \| "filename" \| "size" | No | One of: deleted_at, created_at, filename, size | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl https://api.lynkow.com/v1/media/trash \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "d4e5f6a7-b8c9-4123-8efa-456789012345", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "uploadedBy": null, "folderId": null, "filename": "7c2e9a41-3b5d-4f6e-8a1b-2c3d4e5f6a7b.webp", "originalFilename": "old-banner.webp", "path": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/7c2e9a41-3b5d-4f6e-8a1b-2c3d4e5f6a7b.webp", "mimeType": "image/webp", "size": 198400, "metadata": { "width": 1600, "height": 900, "format": "webp", "alt": "Old banner" }, "url": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/7c2e9a41-3b5d-4f6e-8a1b-2c3d4e5f6a7b.webp", "createdAt": "2025-01-20T09:00:00.000Z", "updatedAt": "2025-04-02T10:00:00.000Z", "deletedAt": "2025-04-02T10:00:00.000Z" } ], "meta": { "total": 5, "perPage": 50, "currentPage": 1, "lastPage": 1 } } ``` --- --- # List search profiles **Published**: 2026-11-30 **Category**: Core CMS ## `GET /search/profiles` **List search profiles** Returns every search profile of the site, public or not, with its full settings. A profile is a scoped search over the site's index, with its own searchable and displayed fields, sort, facets and limits. Required permissions: `search.profiles.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/search/profiles" \ -H "Authorization: Bearer $API_TOKEN" \ -H "X-Site-Id: $SITE_ID" ``` ### Response Example ```json { "data": [ { "slug": "default", "name": "Default", "description": "Default search profile covering all indexed content.", "facets": [], "defaultLimit": 20, "maxLimit": 100 }, { "slug": "api-docs", "name": "API Docs", "description": "Search scoped to the API reference.", "facets": [ "categories.slug", "tags.slug" ], "defaultLimit": 20, "maxLimit": 50 } ] } ``` --- --- # Delete a media folder **Published**: 2026-11-30 **Category**: Media & Files ## `DELETE /media-folders/:id` **Delete a media folder** Deletes a folder and all its subfolders. The required `action` decides what happens to their media files, trashed ones included. `delete_files` deletes them permanently, and their storage is freed shortly after the response. `move_to_root` moves them to the root. Fires no webhook. Returns 204. `delete_files` cannot be undone. Required permissions: `media.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `action` | "delete_files" \| "move_to_root" | Yes | Required. One of: delete_files, move_to_root | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X DELETE "https://api.lynkow.com/v1/media-folders/f1a2b3c4-d5e6-4890-abcd-ef1234567890" \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"action": "move_to_root"}' ``` --- --- # Get content by slug **Published**: 2026-11-30 **Category**: Core CMS ## `GET /contents/slug/:slug` **Get content by slug** Returns a content by its slug, in any status and any locale, with its body, categories, tags, SEO fields and `alternates` (the published language versions and their paths). Translations of one content may share a slug. When several do, the one in the site's default language is returned, else the oldest. Required permissions: `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slug` | path | string | Yes | URL-friendly identifier, unique per site and locale | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/contents/slug/getting-started-with-lynkow \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "ded44e0a-01a9-54d9-a440-dc55d41f5870", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "type": "post", "status": "published", "excerpt": "Learn how to set up your first headless CMS.", "bodyHtml": "<h1>Welcome</h1><p>This is your first article...</p>", "locale": "en", "featuredImage": { "url": "https://cdn.lynkow.com/sites/abc123/hero.jpg", "alt": "Lynkow dashboard screenshot" }, "categories": [ { "id": "0d35327c-9034-5ab0-afd0-3506f391d284", "name": "Tutorials", "slug": "tutorials" } ], "tags": [ { "id": "4bac5cc1-eb1d-5b33-814b-01f5e8b7fe59", "name": "Getting Started", "slug": "getting-started" } ], "meta": { "metaTitle": "Getting Started with Lynkow | My Blog", "metaDescription": "A step-by-step guide to setting up Lynkow.", "canonicalUrl": null, "ogImage": null }, "author": { "id": "869380c8-a772-58a1-a833-a0ec8cd88033", "fullName": "Jane Doe" }, "publishedAt": "2025-03-15T10:30:00.000Z", "createdAt": "2025-03-14T08:00:00.000Z", "updatedAt": "2025-03-15T10:30:00.000Z" } } ``` --- --- # Permanently delete a file **Published**: 2026-11-30 **Category**: Media & Files ## `DELETE /media/:id/force` **Permanently delete a file** Permanently deletes a trashed file. The file is removed from Lynkow media storage shortly after the response, and its storage is freed then. Fires the `media.deleted` webhook. A file that is not in the trash returns 404: trash it first with `DELETE /media/{id}`. This cannot be undone. Required permissions: `media.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/media/a1b2c3d4-e5f6-7890-abcd-ef1234567890/force \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Search a specific profile **Published**: 2026-11-30 **Category**: Core CMS ## `GET /search/:profileSlug` **Search a specific profile** Searches with the named profile, public or not, applying its scope, fields, sort, facets and limits. On page 1, the profile's boosted and featured contents come first, flagged `_isBoosted` or `_isFeatured`. The query parameters work as on `GET /search`. 404 `RESOURCE_NOT_FOUND` for an unknown profile. 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan does not include Instant Search. 503 `INTERNAL_SERVICE_UNAVAILABLE` when search is not enabled for the site. Required permissions (any one of): `search.view`, `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `profileSlug` | path | string | Yes | Slug of the named search profile | | `q` | query | string | No | Full-text search query string. Min 1 character | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default false) | No | With `locale`, `true` also returns hits served from another locale when an item has no translation in it. Defaults to false; a non-boolean returns 422 | | `market` | query | string | No | Market `mkt_` id: products hidden in that market are left out. An unknown, draft or malformed value is ignored | | `category` | query | string | No | Keeps only the contents in the category with this slug | | `tag` | query | string | No | Keeps only the contents carrying the tag with this slug | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (min 1) | No | Hits per page. Defaults to the search profile's `defaultLimit`. A value above its `maxLimit` is lowered to it, and a non-numeric one uses the default | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl "https://api.lynkow.com/v1/search/api-docs?q=pagination&limit=5" \ -H "Authorization: Bearer $API_TOKEN" \ -H "X-Site-Id: $SITE_ID" ``` ### Response Example ```json { "data": [ { "id": "abc-123", "title": "Paginating list responses", "slug": "paginating-list-responses", "path": "/docs/api/pagination", "categories": [ { "slug": "api-reference", "name": "API Reference" } ], "_isFeatured": true } ], "meta": { "total": 4, "page": 1, "totalPages": 1, "perPage": 5, "query": "pagination", "processingTimeMs": 3, "profile": "api-docs" } } ``` --- --- # Restore from trash **Published**: 2026-11-30 **Category**: Media & Files ## `POST /media/:id/restore` **Restore from trash** Moves a trashed file back to the media library, with the same URL. Fires the `media.restored` webhook. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the site has reached its media file count, 404 when the file is not in the trash. Required permissions: `media.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/media/d4e5f6a7-b8c9-4123-8efa-456789012345/restore \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "d4e5f6a7-b8c9-4123-8efa-456789012345", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "uploadedBy": null, "folderId": null, "filename": "7c2e9a41-3b5d-4f6e-8a1b-2c3d4e5f6a7b.webp", "originalFilename": "old-banner.webp", "path": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/7c2e9a41-3b5d-4f6e-8a1b-2c3d4e5f6a7b.webp", "mimeType": "image/webp", "size": 198400, "metadata": { "width": 1600, "height": 900, "format": "webp", "alt": "Old banner" }, "url": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/7c2e9a41-3b5d-4f6e-8a1b-2c3d4e5f6a7b.webp", "createdAt": "2025-01-20T09:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z", "deletedAt": null } } ``` --- --- # Update a search profile **Published**: 2026-11-30 **Category**: Core CMS ## `PUT /search/profiles/:id` **Update a search profile** Updates a search profile with the fields you send. Fires the `search_profile.updated` webhook. 400 when another profile has the new `slug`, 422 when a sent `defaultLimit` or `maxLimit` leaves `defaultLimit` above `maxLimit`, 404 for an unknown profile. 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan does not include Instant Search. Required permissions: `search.profiles.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `slug` | string | No | URL-friendly identifier, unique per site and locale. 1-100 characters | | `name` | string | No | Display name. 1-200 characters | | `description` | string \| null | No | Description text | | `isPublic` | boolean | No | Whether this search profile is exposed on the public storefront search API | | `scope` | object | No | Limits the searched contents by category, tag, type, locale, id, path prefix or metadata. A sent object replaces the stored one, and `{}` removes every limit | | `searchableFields` | "title" \| "excerpt" \| "description" \| "body" \| "metaTitle" \| "metaDescription" \| "keywords" \| "authorName" \| "featuredImage" \| "customData" \| "meta" \| "categories.name" \| "tags.name"[] | No | Fields the query is matched against, replacing the stored list | | `displayedFields` | string[] | No | Fields returned on each hit, replacing the stored list | | `facets` | string[] | No | Fields whose value counts are returned in `meta.facetDistribution` | | `sort` | string[] | No | Order of every search through this profile, as `field:asc` or `field:desc` entries applied in turn. Empty sorts by relevance | | `defaultLimit` | number (1 to 100) | No | Hits per page when the search sends no `limit`, capped at `maxLimit`. Defaults to 20 on create | | `maxLimit` | number (1 to 500) | No | Highest `limit` a search can use; a larger one is lowered to it. Defaults to 100 on create | | `boostedContentIds` | string[] | No | Content UUIDs to rank higher in results (max 100) | | `featuredContentIds` | string[] | No | Content UUIDs pinned to the top of results regardless of relevance (max 100) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X PUT "https://api.lynkow.com/v1/search/profiles/3f2b1c8a-9d4e-4a7f-8b21-5e6d7c8a9b01" \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "API Reference", "facets": ["categories.slug"], "defaultLimit": 25 }' ``` ### Response Example ```json { "data": { "id": "3f2b1c8a-9d4e-4a7f-8b21-5e6d7c8a9b01", "siteId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "slug": "api-docs", "name": "API Reference", "description": "Search scoped to the API reference.", "isPublic": true, "isDefault": false, "scope": { "includeCategories": [ "api-reference" ], "includeLocales": [ "en" ] }, "searchableFields": [ "title", "excerpt", "body", "metaTitle" ], "displayedFields": [ "id", "title", "slug", "path", "excerpt" ], "facets": [ "categories.slug" ], "sort": [ "publishedAt:desc" ], "defaultLimit": 25, "maxLimit": 50, "boostedContentIds": [], "featuredContentIds": [], "createdAt": "2026-06-07T10:32:14.512+00:00", "updatedAt": "2026-06-07T11:05:48.190+00:00" } } ``` --- --- # List contents **Published**: 2026-11-30 **Category**: Core CMS ## `GET /contents` **List contents** Returns the site's contents in any status, newest `publishedAt` first, 20 per page by default (at most 100). Filter by status, type, category, tag, author, locale or date. `search` matches the title and the slug. Items carry no body: use `GET /contents/{id}` for it. With `groupByTranslation=true` on a multi-language site, each item carries its per-locale `translations`, filtered by the same status and ownership rules as the list. Required permissions: `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100, default 20) | No | Number of items per page | | `search` | query | string | No | Text to find in the title or slug, case-insensitive | | `type` | query | string | No | Resource type | | `status` | query | "draft" \| "published" \| "archived" \| "scheduled" | No | One of: draft, published, archived, scheduled | | `contentMode` | query | "standard" \| "structured" | No | One of: standard, structured | | `sortBy` | query | "created_at" \| "updated_at" \| "published_at" \| "title" \| "slug" \| "display_order" (default "published_at") | No | One of: created_at, updated_at, published_at, title, slug, display_order | | `sortOrder` | query | "asc" \| "desc" (default "desc") | No | One of: asc, desc | | `categoryIds` | query | string[] | No | Keeps only the contents in at least one of these categories (UUIDs) | | `tagIds` | query | string[] | No | Keeps only the contents with at least one of these tags (UUIDs) | | `category` | query | string | No | Keeps only the contents in the category with this slug | | `tag` | query | string | No | Keeps only the contents carrying the tag with this slug | | `authorId` | query | string | No | Author user ID. UUID format | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | | `publishedFrom` | query | string | No | Filter by publish date from (ISO 8601) | | `publishedTo` | query | string | No | Filter by publish date until (ISO 8601) | | `slug` | query | string | No | URL-friendly identifier, unique per site and locale | | `slugs` | query | string[] | No | Keeps only the items whose slug is one of these | | `ids` | query | string[] | No | Keeps only the items with these UUIDs | | `excludeIds` | query | string[] | No | Leaves out the items with these UUIDs | | `hasCategory` | query | boolean | No | `true` keeps the contents in at least one category, `false` those in none | | `hasTag` | query | boolean | No | `true` keeps the contents with at least one tag, `false` those with none | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `translationGroupId` | query | string | No | Translation group UUID (links translations across locales). UUID format | | `groupByTranslation` | query | boolean | No | On a multi-language site, `true` lists one item per translation group, with its `translations`. `locale` is then ignored | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash # List published articles, page 1 curl "https://api.lynkow.com/v1/contents?status=published&page=1&limit=10" \ -H "Authorization: Bearer $API_TOKEN" ``` *Lynkow SDK (server-side)* ```javascript // The SDK's public API only fetches published content. // Use the V1 API directly for draft/archived access. const response = await fetch('https://api.lynkow.com/v1/contents?status=draft', { headers: { Authorization: `Bearer ${apiToken}` } }) ``` ### Response Example ```json { "data": [ { "id": "51a254b0-30ef-50a3-b46b-bd8e66ebea3c", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "type": "post", "status": "published", "excerpt": "Learn how to set up your first headless CMS with Lynkow.", "locale": "en", "featuredImage": { "url": "https://cdn.lynkow.com/sites/abc123/hero.jpg", "alt": "Lynkow dashboard screenshot" }, "categories": [ { "id": "5e6fe6de-b492-5b7d-92f4-c1f89bc7487d", "name": "Tutorials", "slug": "tutorials" } ], "tags": [ { "id": "54d9de12-35ff-5d66-943a-06fa36a0aa1b", "name": "Getting Started", "slug": "getting-started" } ], "author": { "id": "7fc3f83d-af5e-53e7-b8b8-eb646ccc955e", "fullName": "Jane Doe", "avatarUrl": "https://cdn.lynkow.com/avatars/jane-doe.jpg" }, "publishedAt": "2025-03-15T10:30:00.000Z", "createdAt": "2025-03-14T08:00:00.000Z", "updatedAt": "2025-03-15T10:30:00.000Z" } ], "meta": { "total": 42, "perPage": 15, "currentPage": 1, "lastPage": 3 } } ``` --- --- # Search contents **Published**: 2026-11-30 **Category**: Core CMS ## `GET /contents/search` **Search contents** Returns the contents whose title, excerpt or body contains `q`, case insensitive. Filter by type, status, category, tag, author or creation date. Sorted by `createdAt`, newest first, by default; 20 per page (at most 100). Items carry no body. The `search` parameter of `GET /contents` matches the title and the slug only. Required permissions: `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `q` | query | string | No | Text to find in the title, excerpt or body, ignoring case | | `type` | query | "post" | No | Resource type. One of: post | | `status` | query | "draft" \| "published" \| "archived" \| "scheduled" | No | One of: draft, published, archived, scheduled | | `categoryIds` | query | string[] | No | Keeps only the contents in at least one of these categories (UUIDs) | | `tagIds` | query | string[] | No | Keeps only the contents with at least one of these tags (UUIDs) | | `authorId` | query | string | No | Author user ID. UUID format | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | | `sortBy` | query | "created_at" \| "updated_at" \| "published_at" \| "title" | No | One of: created_at, updated_at, published_at, title | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl "https://api.lynkow.com/v1/contents/search?q=getting+started&status=published" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "dd1c2f58-5af7-5fa8-b626-2551c193e013", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "type": "post", "status": "published", "excerpt": "Learn how to set up your first headless CMS with Lynkow.", "locale": "en", "categories": [ { "id": "6ef127f7-9046-5581-a076-c332b7034d4d", "name": "Tutorials", "slug": "tutorials" } ], "tags": [ { "id": "93057ff2-03b4-5a5b-a242-0d7b20928136", "name": "Getting Started", "slug": "getting-started" } ], "author": { "id": "dec8dbb4-7fb6-5b04-9b05-0f62ebeb55c1", "fullName": "Jane Doe", "avatarUrl": "https://cdn.lynkow.com/avatars/jane-doe.jpg" }, "publishedAt": "2025-03-15T10:30:00.000Z", "createdAt": "2025-03-14T08:00:00.000Z", "updatedAt": "2025-03-15T10:30:00.000Z" } ], "meta": { "total": 3, "perPage": 15, "currentPage": 1, "lastPage": 1 } } ``` --- --- # Import reviews from CSV **Published**: 2026-11-30 **Category**: Forms & Reviews ## `POST /reviews/import` **Import reviews from CSV** Creates reviews from a CSV file sent as `multipart/form-data`, with an optional `mapping`. The first row holds the headers, at most 1000. Each header is matched case-insensitively against the built-in names listed in the notes, unless `mapping` assigns it. Other headers, `status` included, are ignored, so a file from `GET /reviews/export` imports as is, each row as a new review. Each row needs `authorName`, `content` and a numeric `rating`, whose integer part is kept and clamped to 1..5. An empty `locale` gives the site's default locale. HTML tags are removed from free-text values such as `content`. The status follows the auto-approval settings, never the file. Invalid rows are skipped and reported. The valid rows are saved together: if saving fails, none is created. Returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks bulk review import. Required permissions: `reviews.import` ### Request Body Content-Type: `multipart/form-data` | Field | Type | Required | Description | | --- | --- | --- | --- | | `file` | string | Yes | The CSV file, up to 10 MB with a `.csv` extension, read as UTF-8. The separator is a semicolon when the header row holds more semicolons than commas, a comma otherwise | | `mapping` | string | No | JSON object sent as a text part, mapping review fields to your CSV headers when the built-in names do not fit, such as {"authorName":"Customer","content":"Feedback"}. Anything but an object of strings returns 400 Invalid mapping format | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `400` | `mapping` is not a JSON object whose values are all strings (`Invalid mapping format`), the file holds no row besides the header (`CSV file must have at least one data row`), or a quoted value is never closed. Nothing is imported. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `413` | The multipart request exceeds 10 MB in total, file and mapping included. Nothing is imported. | | `422` | Validation error on `file` (missing, without a `.csv` extension, or a header row of more than 1000 cells) or on `mapping` (not a string). Nothing is imported. | | `500` | The uploaded file could not be read (`Failed to read CSV file`), or saving the valid rows failed (`Failed to import reviews`). Nothing is imported. | > **Notes:** - Required headers: `authorName` (author_name, authorname, name, nom, auteur, author), `content` (content, review, avis, texte, commentaire, message, avis original, avis_original, original), `rating` (rating, note, stars, etoiles, étoiles, score, notation). > > - Author headers: `authorEmail` (author_email, authoremail, email, mail), `authorPhotoUrl` (author_photo_url, photo), `authorCompany` (author_company, company, entreprise, societe, société), `authorPosition` (author_position, position, poste, fonction), `authorCity` (author_city, city, ville, localisation). > - Other headers: `title` (title, titre), `productName` (product_name, product, produit), `productSku` (product_sku, sku), `reviewDate` (date, review_date, date_avis), `locale` (locale). > - A row is skipped when it lacks `authorName` or `content`, its `rating` is not a finite number, its `locale` is unknown or not enabled on a multi-language site, or a text value exceeds 255 characters. > - `reviewDate` accepts ISO 8601, MM/dd/yyyy, d/M/yyyy, and yyyy-MM-dd or dd/MM/yyyy optionally followed by HH:mm or HH:mm:ss. An ambiguous date reads day first. > - A date without an offset is read in Europe/Paris time. An empty or unrecognized date gives the import time. > - Imported reviews have the source `csv_import` and no linked product: `productName` and `productSku` are stored as text. > - There is no row limit beyond the 10 MB request size. > - `errors` is the number of skipped rows; `errorDetails` lists the first 10 of them. > - `line` counts the header row as 1 and does not count blank rows. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/reviews/import \ -H "Authorization: Bearer $API_TOKEN" \ -F "file=@reviews.csv" \ -F 'mapping={"authorName":"Customer","content":"Feedback"}' ``` ### Response Example ```json { "data": { "message": "Import completed", "imported": 42, "errors": 2, "errorDetails": [ { "line": 7, "error": "rating must be a number" }, { "line": 12, "error": "authorName is required" } ] } } ``` --- --- # Delete a variable **Published**: 2026-11-30 **Category**: Core CMS ## `DELETE /variables/:id` **Delete a variable** Permanently deletes a variable. Required permissions: `variables.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/variables/df73d10b-7e8e-5e8a-bc2e-6a7aa24b8ab3 \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Delete a tag **Published**: 2026-11-30 **Category**: Core CMS ## `DELETE /tags/:id` **Delete a tag** Deletes a tag. Contents are kept and lose the tag. Required permissions: `tags.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE https://api.lynkow.com/v1/tags/069a4293-b0e5-5f29-a8c6-d4ceeb2edb4f \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Move files to a folder **Published**: 2026-11-30 **Category**: Media & Files ## `POST /media-folders/bulk-move` **Move files to a folder** Moves 1 to 100 media files to a folder, or to the root with `folderId: null`. Returns the number of files moved. Errors: 400 when an ID is not a media file of the site, 404 for an unknown folder. Required permissions: `media.update` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `mediaIds` | string[] | Yes | Required. IDs of the media files to move | | `folderId` | string \| null | Yes | Required. Media folder UUID | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/media-folders/bulk-move \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"mediaIds": ["uuid1", "uuid2"], "folderId": "target-folder-uuid"}' ``` ### Response Example ```json { "data": { "moved": 2 } } ``` --- --- # Update review settings **Published**: 2026-11-30 **Category**: Forms & Reviews ## `PUT /reviews/settings` **Update review settings** Updates the site's review settings and returns them. Omitted fields keep their value. With `autoApproveEnabled`, a storefront submission or an imported review rated `autoApproveMinRating` (1 to 5) or higher is approved at once. Other reviews start as `pending`. `customFieldsSchema` replaces the whole list. It holds at most 50 fields, each `id` at most 200 characters, the limits a review's `customFields` must respect. Past either limit, the request returns 422. Required permissions: `reviews.settings` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `autoApproveEnabled` | boolean | No | Whether a new storefront or imported review rated at or above `autoApproveMinRating` is approved at once | | `autoApproveMinRating` | number (1 to 5) | No | Lowest rating approved at once when `autoApproveEnabled` is true | | `publicSubmissionEnabled` | boolean | No | Whether visitors can submit reviews from the storefront | | `requireEmail` | boolean | No | Whether a storefront submission must include an email address | | `showAuthorPhoto` | boolean | No | Whether the storefront shows the author's photo | | `showAuthorCompany` | boolean | No | Whether the storefront shows the author's company and position | | `showAuthorCity` | boolean | No | Whether the storefront shows the author's city | | `customFieldsSchema` | object[] | No | The custom fields a review can carry, at most 50. Replaces the whole list | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/reviews/settings \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "autoApproveEnabled": false, "requireEmail": true }' ``` ### Response Example ```json { "data": { "message": "Settings updated successfully", "settings": { "autoApproveEnabled": false, "autoApproveMinRating": 5, "publicSubmissionEnabled": true, "requireEmail": true, "showAuthorPhoto": true, "showAuthorCompany": true, "showAuthorCity": true, "customFieldsSchema": [] } } } ``` --- --- # Get form translation status **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /forms/:id/translations` **Get form translation status** Returns one entry per enabled site locale, saying whether the form has a translation in it and whether that translation needs review. An unknown id returns 404. Required permissions: `forms.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/forms/9afb58cf-2e58-5a81-9ce3-40a590d2f56f/translations \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "translationGroupId": "3f6b2a1c-9d8e-4f7a-b6c5-1e2d3c4b5a69", "translations": [ { "locale": "en", "exists": true, "id": "9afb58cf-2e58-5a81-9ce3-40a590d2f56f", "name": "Contact Form", "status": "active", "updatedAt": "2025-03-20T08:15:00.000Z", "needsReview": false }, { "locale": "fr", "exists": true, "id": "23dd1b6b-80d5-52f3-99c7-de39ac6fb34e", "name": "Formulaire de contact", "status": "draft", "updatedAt": "2025-04-06T15:00:00.000Z", "needsReview": false }, { "locale": "es", "exists": false, "id": null, "name": null, "status": null, "updatedAt": null, "needsReview": false } ] } } ``` --- --- # Update a review **Published**: 2026-11-30 **Category**: Forms & Reviews ## `PUT /reviews/:id` **Update a review** Updates the fields you send. `title`, `content` and `locale` apply to this review only. A change to any other field is copied to the review's other translations. Changing `status` or `rejectionReason` requires `reviews.moderate`. Sending any other field requires `reviews.update`. A value equal to the stored one is no change, so you can send the whole review back. A caller without `reviews.view` gets an acknowledgement instead of the review. `productId: null` unlinks the product. Approving clears the `rejectionReason`. Fires the `review.updated` webhook, with the previous link as `previousProductId`. Errors: 403 `AUTHZ_PERMISSION_DENIED` for a missing permission, 400 for a `locale` a multi-language site does not enable, 422 on `productId` for an unknown, deleted or other site's product (the product already linked is accepted), 422 on `customFields` past its limits. Nothing is changed. An unknown review returns 404. Required permissions (any one of): `reviews.update`, `reviews.moderate` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `authorName` | string | No | Display name of the author. 2-100 characters | | `authorEmail` | string \| null | No | Author email address | | `authorPhotoUrl` | string \| null | No | Author photo URL | | `authorCompany` | string \| null | No | Author company name | | `authorPosition` | string \| null | No | Author job title | | `authorCity` | string \| null | No | Author city | | `rating` | integer (1 to 5) | No | New star rating, counted in the site and product averages while the review is approved | | `content` | string | No | Text content. 10-5000 characters | | `title` | string \| null | No | Display title | | `productName` | string \| null | No | Associated product name | | `productSku` | string \| null | No | Associated product SKU | | `productId` | string \| null | No | The `prod_` id or raw UUID of a product of the site, in any status, that the review is about. Null unlinks it, omitted keeps the link. Copied to every translation | | `customFields` | object | No | Free-form values. Counting the object itself, at most 3 levels deep; up to 50 keys per object, 50 items per array, 200-character keys and 5000-character strings | | `status` | "pending" \| "approved" \| "rejected" | No | One of: pending, approved, rejected | | `rejectionReason` | string \| null | No | Reason for rejection | | `isFeatured` | boolean | No | Highlights the review, which lists can filter on with the `isFeatured` query parameter | | `reviewDate` | string \| null | No | Original review date (ISO 8601) | | `displayOrder` | number | No | Sort position: in ascending order, lower values come first | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/reviews/0e7f7645-5374-56dd-8f31-5681665a01fe \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "status": "approved", "isFeatured": true }' ``` ### Response Example ```json { "data": { "id": "0e7f7645-5374-56dd-8f31-5681665a01fe", "title": "Excellent platform", "content": "Lynkow made managing our website content incredibly easy.", "rating": 5, "productId": null, "status": "approved", "rejectionReason": null, "authorName": "Marie Dupont", "authorEmail": "marie@example.com", "isFeatured": true, "locale": "en", "createdAt": "2025-04-01T14:22:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # Bulk update review status **Published**: 2026-11-30 **Category**: Forms & Reviews ## `POST /reviews/bulk-status` **Bulk update review status** Sets the status of several reviews at once. Send `ids`, a non-empty array of review UUIDs, and `status`. With `status: rejected`, the optional `rejectionReason` is stored. Approving clears it. Ids matching no review of the site are ignored, and `count` is the number of reviews updated. Fires one bulk `review.updated` webhook whose `productIds` lists the products the updated reviews are linked to. Required permissions: `reviews.moderate` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `ids` | string[] | Yes | Required | | `status` | "pending" \| "approved" \| "rejected" | Yes | Required. One of: pending, approved, rejected | | `rejectionReason` | string | No | Reason for rejection. Max 500 characters | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/reviews/bulk-status \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"ids": ["76b8c526-3b5f-56cc-98d8-1707d4932edb", "7af5a769-1709-5d14-9794-e5efcf5b4e66"], "status": "approved"}' ``` ### Response Example ```json { "data": { "message": "2 reviews updated successfully", "count": 2 } } ``` --- --- # Export reviews as CSV **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /reviews/export` **Export reviews as CSV** Downloads the site's reviews as a comma-separated CSV file, newest first, and returns 422 for an invalid `status` or `rating`. The last field of each row, `locale`, is the review's language. A value starting with `=`, `+`, `-` or `@` gets a leading apostrophe so spreadsheets do not run it as a formula. The file imports back as is through `POST /reviews/import`. Required permissions: `reviews.export` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `status` | query | "pending" \| "approved" \| "rejected" | No | Export only the reviews in this status. | | `rating` | query | integer (1 to 5) | No | Export only the reviews with this rating. | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/reviews/export" \ -H "Authorization: Bearer $API_TOKEN" \ -o reviews.csv ``` ### Response Example ``` id,author_name,author_email,author_company,author_position,author_city,rating,title,content,product_name,product_sku,status,is_featured,source,review_date,created_at,locale 4bcb01ec-c7fa-53ed-9fac-ba726fca95e5,Marie Dupont,marie@example.com,,,Lyon,5,Excellent platform,Lynkow made managing...,,,approved,false,admin,2025-04-01T14:22:00.000+00:00,2025-04-01T14:22:00.000+00:00,fr ``` --- --- # List reviews **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /reviews` **List reviews** Returns the site's reviews in every status, newest first by default. Filter by status, rating, featured flag, source, product, locale and creation or review date, or search the author name, content and title. `product` takes a product's `prod_` id or raw UUID, whatever its status. A value naming no product of the site, a deleted one or a slug included, returns 404. `meta.averageRating` and `meta.totalApproved` cover every approved review of the site and ignore the filters. On a multi-language site, `groupByTranslation=true` lists each review once, in the default locale when it exists, with its translations per enabled locale. `locale` is then ignored. Required permissions: `reviews.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `status` | query | "pending" \| "approved" \| "rejected" | No | One of: pending, approved, rejected | | `rating` | query | number (1 to 5) | No | Keeps only the reviews with exactly this rating | | `ratingMin` | query | number (1 to 5) | No | Keeps only the reviews rated at least this | | `ratingMax` | query | number (1 to 5) | No | Keeps only the reviews rated at most this | | `isFeatured` | query | boolean | No | `true` keeps only the featured reviews, `false` only the others | | `productName` | query | string | No | Associated product name | | `product` | query | string | No | Keep only the reviews linked to this product of the site, named by its identifier (prod_ prefixed id or raw UUID), whatever its status. A value naming no non-deleted product of the site, a slug included, answers 404 | | `source` | query | "admin" \| "csv_import" \| "public_form" | No | One of: admin, csv_import, public_form | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "created_at" \| "rating" \| "author_name" \| "display_order" \| "review_date" | No | One of: created_at, rating, author_name, display_order, review_date | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | | `reviewDateFrom` | query | string | No | Filter by review date from (ISO 8601) | | `reviewDateTo` | query | string | No | Filter by review date until (ISO 8601) | | `slug` | query | string | No | URL-friendly identifier, unique per site and locale | | `slugs` | query | string[] | No | Keeps only the items whose slug is one of these | | `ids` | query | string[] | No | Keeps only the items with these UUIDs | | `excludeIds` | query | string[] | No | Leaves out the items with these UUIDs | | `groupByTranslation` | query | boolean | No | On a multi-language site, `true` lists one item per translation group, with its `translations`. `locale` is then ignored | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `translationGroupId` | query | string | No | Translation group UUID (links translations across locales). UUID format | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash # List approved reviews curl "https://api.lynkow.com/v1/reviews?status=approved&page=1&limit=10" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "76b8c526-3b5f-56cc-98d8-1707d4932edb", "title": "Excellent platform", "content": "Lynkow made managing our website content incredibly easy.", "rating": 5, "productId": "prod_01j9zq7m4k2x8v3n6p5r0t1w2w", "status": "approved", "rejectionReason": null, "authorName": "Marie Dupont", "authorEmail": "marie@example.com", "authorCompany": "Acme Corp", "authorCity": "Paris", "isFeatured": true, "locale": "en", "createdAt": "2025-04-01T14:22:00.000Z" }, { "id": "7af5a769-1709-5d14-9794-e5efcf5b4e66", "title": "Good but could improve", "content": "The API is solid. Would love to see webhooks for reviews.", "rating": 4, "productId": null, "status": "approved", "rejectionReason": null, "authorName": "John Smith", "authorEmail": "john@example.com", "authorCompany": null, "authorCity": "London", "isFeatured": false, "locale": "en", "createdAt": "2025-03-28T09:15:00.000Z" } ], "meta": { "total": 67, "perPage": 15, "currentPage": 1, "lastPage": 5, "averageRating": "4.35", "totalApproved": 54 } } ``` --- --- # Export submissions as CSV **Published**: 2026-11-30 **Category**: Forms & Reviews ## `GET /forms/:id/submissions/export` **Export submissions as CSV** Downloads every submission of a form as a CSV file named `<slug>-submissions.csv`, newest first. The header row is `ID`, `Date`, one entry per form field named by its label, `Status` and `IP hash`. `Date` reads `YYYY-MM-DD HH:mm:ss`. The IP hash is a salted per-site hash of the submitter's IP address, empty when none was recorded. A value a spreadsheet could read as a formula is prefixed with a single quote. Required permissions: `forms.submissions.export` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl "https://api.lynkow.com/v1/forms/c6e36ca6-7452-5dd4-9143-08dc78973679/submissions/export" \ -H "Authorization: Bearer $API_TOKEN" \ -o submissions.csv ``` ### Response Example ``` ID,Date,Name,Email,Message,Status,IP hash bb164fc9-26c9-5487-88b9-beb725cc70dd,2025-04-05 16:30:00,Sophie Bernard,sophie@example.com,"I would like to know more about your enterprise plan, thanks.",new,b77de23e5efbf847662ea60864117117b8f206d2872b189dcbf56e8ce9d77984 ``` --- --- # Create a form **Published**: 2026-11-30 **Category**: Forms & Reviews ## `POST /forms` **Create a form** Creates a form, in `draft` status unless you send `status`. `locale` defaults to the site's default language and must be a locale the site has enabled. Adding a notification destination requires `forms.submissions.view`, or the request returns 403 `AUTHZ_INSUFFICIENT_PERMISSIONS` and creates nothing. A destination is an enabled email notification with a recipient or a reply-to address, or an enabled webhook with a URL. The response returns webhook header values as `[REDACTED]` and the webhook URL as its origin only. Fires the `form.created` webhook. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` at the plan's form limit, 409 `RESOURCE_ALREADY_EXISTS` for a slug already used in that locale, 400 for a locale the site has not enabled, 422 for invalid input. Required permissions: `forms.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | Yes | Required. Display name. 1-255 characters | | `slug` | string | Yes | Required. URL-friendly identifier, unique per site and locale. 1-255 characters | | `description` | string | No | Description text. Max 1000 characters | | `schema` | object | Yes | Required. Field schema definition | | `settings` | object | No | Configuration settings | | `notifications` | object | No | Notification preferences | | `honeypotEnabled` | boolean | No | Whether a submission that fills the hidden decoy field is dropped. The sender still receives a success response | | `recaptchaEnabled` | boolean | No | Whether submissions must carry a reCAPTCHA token. It needs `recaptchaSiteKey` and `recaptchaSecretKey` | | `recaptchaVersion` | "v2" \| "v3" | No | Verification version: v2 challenge or v3 action and score verification. One of: v2, v3 | | `recaptchaMinScore` | number (0 to 1) | No | Minimum accepted v3 score between 0 and 1, default 0.5; authenticated configuration only | | `recaptchaSiteKey` | string | No | Max 255 characters | | `recaptchaSecretKey` | string | No | Max 255 characters | | `status` | "draft" \| "active" \| "closed" \| "archived" | No | One of: draft, active, closed, archived | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr") | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | The requested locale is supported but not enabled for this site. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `409` | A form with this slug already exists in the requested locale. | | `422` | Invalid input, such as a CAPTCHA without both keys, or a webhook header sent as `[REDACTED]`, repeated under another case or impossible to deliver. | > **Notes:** - A form accepts submissions only while its `status` is `active`. > > - Enabling CAPTCHA requires a non-blank `recaptchaSiteKey` and `recaptchaSecretKey`. > - `notifications.email.to` holds at most 10 addresses, with no duplicate when compared case-insensitively. > - The webhook URL must be a public `http` or `https` endpoint: a private, loopback or internal address returns 422. > - A webhook header name must be an HTTP token. A value must be a string, number or boolean with no control character other than tab and no character beyond U+00FF. > - Sending `[REDACTED]` as a webhook header value, or two header names that differ only by case, returns 422. > - A `tel` field takes `phoneOptions` with both keys: `showCountryCode` shows the country-code selector, and `defaultCountryCode` is the dial code selected by default, such as `+33`. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/forms \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "Contact Form", "slug": "contact-form", "status": "active", "schema": { "fields": [ {"id": "name", "type": "text", "label": "Full Name", "required": true}, {"id": "email", "type": "email", "label": "Email", "required": true}, {"id": "message", "type": "textarea", "label": "Message", "required": true} ], "settings": {"successMessage": "Thank you for reaching out!"} } }' ``` ### Response Example ```json { "data": { "id": "66f7496e-bce7-5772-b8a0-603f2a05670a", "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "createdBy": null, "name": "Contact Form", "slug": "contact-form", "schema": { "fields": [ { "id": "name", "type": "text", "label": "Full Name", "required": true }, { "id": "email", "type": "email", "label": "Email", "required": true }, { "id": "message", "type": "textarea", "label": "Message", "required": true } ], "settings": { "successMessage": "Thank you for reaching out!" }, "conditions": [] }, "settings": {}, "notifications": {}, "honeypotEnabled": true, "recaptchaEnabled": false, "recaptchaVersion": "v2", "recaptchaMinScore": 0.5, "status": "active", "locale": "en", "translationGroupId": "b7e1c2d3-4f5a-4b6c-8d7e-9f0a1b2c3d4e", "createdAt": "2025-04-06T11:00:00.000Z", "updatedAt": "2025-04-06T11:00:00.000Z", "creator": null } } ``` --- --- # Move a folder **Published**: 2026-11-30 **Category**: Media & Files ## `POST /media-folders/:id/move` **Move a folder** Moves a folder and its subfolders under another folder, or to the root with `parentId: null`. Returns the folder with its new breadcrumb `path`. Errors: 400 when the target is the folder itself or one of its subfolders, or when the move would nest folders deeper than 3 levels; 404 for an unknown target folder. Required permissions: `media.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `parentId` | string \| null | Yes | Required. Parent resource ID | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/media-folders/f3c4d5e6-f7a8-4012-8def-234567890123/move \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"parentId": "f1a2b3c4-d5e6-4890-abcd-ef1234567890"}' ``` ### Response Example ```json { "data": { "id": "f3c4d5e6-f7a8-4012-8def-234567890123", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "name": "Thumbnails", "parentId": "f1a2b3c4-d5e6-4890-abcd-ef1234567890", "createdAt": "2025-02-01T14:00:00.000Z", "updatedAt": "2025-04-06T12:30:00.000Z", "path": [ { "id": "f1a2b3c4-d5e6-4890-abcd-ef1234567890", "name": "Banners" }, { "id": "f3c4d5e6-f7a8-4012-8def-234567890123", "name": "Thumbnails" } ] } } ``` --- --- # Copy form to another locale **Published**: 2026-11-30 **Category**: Forms & Reviews ## `POST /forms/:id/copy-to-locale` **Copy form to another locale** Copies a form into `targetLocale` as a new translation of it. The copy keeps the slug, status, schema, settings, notifications and spam protection. Its name and field labels stay in the source language until you update them. Each copy counts toward the plan's form limit. Fires the `form.created` and `form.translated` webhooks. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` at the form limit, 409 `RESOURCE_ALREADY_EXISTS` when the form already has a translation in that locale or another form uses its slug there, 400 when the site is not multi-language or has not enabled that locale. Required permissions: `forms.create`, `forms.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `targetLocale` | string | Yes | Required. BCP 47 locale code of the locale to copy into (e.g. "fr", "es"). Must be enabled on the site. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | Multi-language is not enabled for this site, or the target locale is not one of its enabled locales. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | A translation of this form, or another form using the source slug, already exists in the target locale. | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/forms/845c64bc-f692-52a7-9340-b0c64ea9a6ea/copy-to-locale \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"targetLocale": "fr"}' ``` ### Response Example ```json { "data": { "id": "23dd1b6b-80d5-52f3-99c7-de39ac6fb34e", "siteId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "createdBy": null, "name": "Contact Form", "slug": "contact-form", "description": null, "schema": { "fields": [ { "id": "name", "type": "text", "label": "Full Name", "required": true }, { "id": "email", "type": "email", "label": "Email", "required": true }, { "id": "message", "type": "textarea", "label": "Message", "required": true } ], "settings": { "successMessage": "Thank you for reaching out!" }, "conditions": [] }, "settings": {}, "notifications": { "email": null, "webhook": null }, "honeypotEnabled": true, "recaptchaEnabled": false, "recaptchaVersion": "v2", "recaptchaMinScore": 0.5, "recaptchaSiteKey": null, "status": "active", "locale": "fr", "translationGroupId": "3f6b2a1c-9d8e-4f7a-b6c5-1e2d3c4b5a69", "createdAt": "2025-04-06T15:00:00.000Z", "updatedAt": "2025-04-06T15:00:00.000Z", "message": "Form copied to fr successfully" } } ``` --- --- # Replace a file **Published**: 2026-11-30 **Category**: Media & Files ## `POST /media/:id/replace` **Replace a file** Replaces the image of a media file, keeping its ID, alt text and folder. Send JPEG, PNG, GIF, WebP or AVIF up to 10 MB in the `file` field, processed as in `POST /media/upload`. The file gets a new URL, and the previous file is deleted. Fires the `media.replaced` webhook. Errors: 400 for an SVG or a trashed file, 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when a larger file would exceed the storage quota, 409 when the file changed during the upload, 422 for animated PNG. Required permissions: `media.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `multipart/form-data` | Field | Type | Required | Description | | --- | --- | --- | --- | | `file` | string | Yes | Required | | `preset` | "fast" \| "optimized" \| "quality" | No | Resize and compression preset: `fast` (1280 px, quality 80), `optimized` (1920 px, quality 80, the default) or `quality` (3840 px, quality 90). One of: fast, optimized, quality | | `maxWidth` | integer (100 to 4000) | No | Longest side in pixels the image is scaled down to, overriding the preset. A smaller image is never enlarged | | `quality` | integer (50 to 100) | No | Whole number from 50 to 100: WebP quality, overriding the preset | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/media/a1b2c3d4-e5f6-4890-abcd-ef1234567890/replace \ -H "Authorization: Bearer $API_TOKEN" \ -F "file=@new-hero-banner.jpg" ``` ### Response Example ```json { "data": { "id": "a1b2c3d4-e5f6-4890-abcd-ef1234567890", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "uploadedBy": null, "folderId": "f1a2b3c4-d5e6-4890-abcd-ef1234567890", "filename": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a.webp", "originalFilename": "new-hero-banner.webp", "path": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a.webp", "mimeType": "image/webp", "size": 310200, "metadata": { "width": 1920, "height": 1080, "format": "webp", "alt": "Homepage hero banner" }, "url": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a.webp", "variants": { "thumbnail": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a.webp?w=150", "card": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a.webp?w=400", "content": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a.webp?w=800", "medium": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a.webp?w=1200" }, "createdAt": "2025-02-10T12:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z", "deletedAt": null } } ``` --- --- # Update media metadata **Published**: 2026-11-30 **Category**: Media & Files ## `PUT /media/:id` **Update media metadata** Updates the alt text, name and custom `metadata` of a media file. `name` sets `originalFilename`, and the URL does not change. `metadata` keys are merged into the existing ones. `locale` picks the language of `alt`. Without it, or with the site default locale, `alt` sets `metadata.alt`. With another locale the site enables, `alt` is required and `metadata` is refused. A blank or `null` `alt` then deletes that locale's alt, which falls back as in `GET /media`. With `locale`, the response also carries `alt`, `altLocale` and `altIsFallback`. Fires the `media.updated` webhook. Errors: 422 `VALIDATION_FIELD_INVALID` on `locale` when the site does not enable it, on `alt` when it is missing, on `metadata` when sent with another locale. Required permissions: `media.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `locale` | string | No | BCP 47 locale code (e.g. "en", "fr"). 1-35 characters | | `alt` | string | No | Alternative text for the media (accessibility and SEO). Max 500 characters | | `name` | string | No | New file name, returned as `originalFilename`. The file URL does not change | | `metadata` | object | No | Custom key-value metadata | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/media/a1b2c3d4-e5f6-4890-abcd-ef1234567890 \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"alt": "Updated alt text", "metadata": {"credit": "Photo by Jane Doe"}}' ``` ### Response Example ```json { "data": { "id": "a1b2c3d4-e5f6-4890-abcd-ef1234567890", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "uploadedBy": null, "folderId": "f1a2b3c4-d5e6-4890-abcd-ef1234567890", "filename": "0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp", "originalFilename": "hero-banner.webp", "path": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp", "mimeType": "image/webp", "size": 245760, "metadata": { "width": 1920, "height": 1080, "format": "webp", "alt": "Updated alt text", "credit": "Photo by Jane Doe" }, "url": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/0b6f3c1e-8a2d-4f5b-9c7e-1d2a3b4c5d6e.webp", "createdAt": "2025-02-10T12:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z", "deletedAt": null } } ``` --- --- # Import file from URL **Published**: 2026-11-30 **Category**: Media & Files ## `POST /media/upload-from-url` **Import file from URL** Downloads an image from a public `http` or `https` URL and adds it to the media library. Accepts the formats of `POST /media/upload` and processes the image the same way. The remote `Content-Type` must be an image type. Redirects are not followed. The download must finish within 30 seconds and stay under 10 MB. Fires the `media.uploaded` webhook. Errors: 402 `SUBSCRIPTION_QUOTA_EXCEEDED` when the site has reached its media file count or storage quota, 404 for an unknown `folderId`, 422 on `url` when the URL is refused, the download fails or the file is not a supported image. Required permissions: `media.upload` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `url` | string | Yes | Required. Valid URL | | `name` | string | No | Filename to store the image under, instead of the URL's last path segment. 1 to 255 characters, without /, \ or NUL. An extension, when present, must be an image extension matching the downloaded format; without one, it is added | | `alt` | string | No | Alternative text for the media (accessibility and SEO) | | `folderId` | string | No | Media folder UUID. UUID format | | `preset` | "fast" \| "optimized" \| "quality" | No | Resize and compression preset: `fast` (1280 px, quality 80), `optimized` (1920 px, quality 80, the default) or `quality` (3840 px, quality 90). One of: fast, optimized, quality | | `maxWidth` | integer (100 to 4000) | No | Longest side in pixels the image is scaled down to, overriding the preset. A smaller image is never enlarged | | `quality` | integer (50 to 100) | No | Whole number from 50 to 100: WebP quality, overriding the preset | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | > **Notes:** - Without `name`, the file is named after the last segment of the URL > path, with the extension of the downloaded format. > > - An `.apng` extension in `name`, or in the URL path when `name` is > absent, returns 422. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/media/upload-from-url \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "url": "https://images.unsplash.com/photo-example.jpg", "alt": "Mountain landscape", "folderId": "uuid-of-folder" }' ``` ### Response Example ```json { "data": { "id": "c3d4e5f6-a7b8-4012-8def-234567890123", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "uploadedBy": null, "folderId": "f1a2b3c4-d5e6-4890-abcd-ef1234567890", "filename": "9e1d2c3b-4a5f-4e6d-8c7b-6a5f4e3d2c1b.webp", "originalFilename": "photo-example.webp", "path": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/9e1d2c3b-4a5f-4e6d-8c7b-6a5f4e3d2c1b.webp", "mimeType": "image/webp", "size": 312400, "metadata": { "width": 1920, "height": 1280, "format": "webp", "alt": "Mountain landscape", "uploadedViaApiToken": "Content pipeline", "sourceUrl": "https://images.example.com/photo-example.jpg" }, "url": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/9e1d2c3b-4a5f-4e6d-8c7b-6a5f4e3d2c1b.webp", "variants": { "thumbnail": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/9e1d2c3b-4a5f-4e6d-8c7b-6a5f4e3d2c1b.webp?w=150", "card": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/9e1d2c3b-4a5f-4e6d-8c7b-6a5f4e3d2c1b.webp?w=400", "content": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/9e1d2c3b-4a5f-4e6d-8c7b-6a5f4e3d2c1b.webp?w=800", "medium": "https://cdn.lynkow.com/sites/5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c/9e1d2c3b-4a5f-4e6d-8c7b-6a5f4e3d2c1b.webp?w=1200" }, "createdAt": "2025-04-06T11:45:00.000Z", "updatedAt": "2025-04-06T11:45:00.000Z", "deletedAt": null } } ``` --- --- # Get variable translation status **Published**: 2026-11-30 **Category**: Core CMS ## `GET /variables/:id/translations` **Get variable translation status** Returns the translations that exist for this variable: one entry per existing translation, the requested variable included, flagged `current`. A locale with no translation has no entry, and the list is empty when the variable has no translation group. `needsReview` is true when that translation was written against a default-language version of the variable that has changed since. Required permissions: `variables.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/variables/7332df7b-95cb-557c-a78a-8eed8c7acbc9/translations \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "translationGroupId": "7d9e4a3c-5f6b-4c8d-ae1f-2a3b4c5d6e7f", "currentLocale": "en", "translations": [ { "id": "7332df7b-95cb-557c-a78a-8eed8c7acbc9", "locale": "en", "key": "opening_hours", "label": "Opening hours", "value": "Monday to Friday, 9am to 6pm", "current": true, "needsReview": false }, { "id": "04510a52-6297-5942-b73f-6bfa50817d2f", "locale": "fr", "key": "opening_hours", "label": "Horaires", "value": "Du lundi au vendredi, de 9h à 18h", "current": false, "needsReview": false } ] } } ``` --- --- # Update a variable **Published**: 2026-11-30 **Category**: Core CMS ## `PUT /variables/:id` **Update a variable** Updates a variable. Every field is optional, and the `key` may be changed when the new value remains unique within the variable's locale. The locale and the type cannot change. For a `calendar` variable, a new `value` is validated and sanitized under the same rules as on create. Errors: 404 for an unknown or malformed id, 409 `VARIABLE_KEY_TAKEN`, 400 for an invalid calendar value. A caller without `variables.view` receives an acknowledgement instead of the variable. Required permissions: `variables.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `key` | string | No | 1-100 characters | | `label` | string | No | Merchant-visible reservation offering label. 1-255 characters | | `value` | string | No | Amount value. 1-100000 characters | | `description` | string \| null | No | Description text | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/variables/eef0d728-f572-58eb-89ae-163868efea2c \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"value": "Acme Corporation"}' ``` ### Response Example ```json { "data": { "id": "eef0d728-f572-58eb-89ae-163868efea2c", "key": "company_name", "value": "Acme Corporation", "type": "text", "locale": "en", "createdAt": "2025-01-05T09:00:00.000Z", "updatedAt": "2025-04-06T16:00:00.000Z" } } ``` --- --- # List variables **Published**: 2026-11-30 **Category**: Core CMS ## `GET /variables` **List variables** Returns a paginated list of variables, 100 per page by default. Filter by `type`, `locale`, `search` (on `key` and `label`) or `ids`. The default sort is `label`. Required permissions: `variables.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/variables \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "3b41ad33-95ba-5ce5-bf4b-9a173a4d001f", "key": "company_name", "value": "Acme Corp", "type": "text", "locale": "en", "createdAt": "2025-01-05T09:00:00.000Z", "updatedAt": "2025-01-05T09:00:00.000Z" }, { "id": "d6f9e3cf-f91f-54a1-b4fd-3eff618bce7b", "key": "phone_number", "value": "+1 (555) 123-4567", "type": "text", "locale": "en", "createdAt": "2025-01-05T09:05:00.000Z", "updatedAt": "2025-02-10T14:00:00.000Z" }, { "id": "abd7b525-a7c2-524e-86d7-d1e0814b7c12", "key": "opening_hours", "value": "Mon-Fri 9:00-18:00", "type": "text", "locale": "en", "createdAt": "2025-01-06T10:00:00.000Z", "updatedAt": "2025-01-06T10:00:00.000Z" } ], "meta": { "total": 3, "perPage": 15, "currentPage": 1, "lastPage": 1 } } ``` --- --- # List categories **Published**: 2026-11-30 **Category**: Core CMS ## `GET /categories` **List categories** Returns a paginated flat list of categories, 20 per page by default and 100 at most. Filter by `search`, `slug`, `ids`, `parentId` or `isRoot`. Use `GET /categories/tree` for the nested hierarchy. Required permissions: `categories.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `page` | query | number (min 1) | No | Page number, starting at 1 | | `limit` | query | number (1 to 100) | No | Number of items per page | | `search` | query | string | No | Text to match, case-insensitive, against the resource's main text fields such as title or name | | `sortBy` | query | "created_at" \| "updated_at" \| "name" \| "slug" \| "display_order" | No | One of: created_at, updated_at, name, slug, display_order | | `sortOrder` | query | "asc" \| "desc" | No | One of: asc, desc | | `dateFrom` | query | string | No | Filter from date (ISO 8601) | | `dateTo` | query | string | No | Filter until date (ISO 8601) | | `slug` | query | string | No | URL-friendly identifier, unique per site and locale | | `slugs` | query | string[] | No | Keeps only the items whose slug is one of these | | `ids` | query | string[] | No | Keeps only the items with these UUIDs | | `excludeIds` | query | string[] | No | Leaves out the items with these UUIDs | | `parentId` | query | string \| null | No | Parent resource ID | | `isRoot` | query | boolean | No | `true` keeps only the top-level categories; `false` has no effect | | `includeChildren` | query | boolean | No | `true` adds each category's `parent` object and its direct `children` | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl https://api.lynkow.com/v1/categories \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "b75b0dd9-50ef-54b6-a0bf-1557f86d9959", "name": "Tutorials", "slug": "tutorials", "description": "Step-by-step guides and how-tos", "parentId": null, "locale": "en", "contentCount": 12, "createdAt": "2025-01-10T09:00:00.000Z" }, { "id": "c31f6b99-cd60-5ae5-b578-14cb8e86758c", "name": "API Guides", "slug": "api-guides", "description": "REST API integration tutorials", "parentId": "b75b0dd9-50ef-54b6-a0bf-1557f86d9959", "locale": "en", "contentCount": 5, "createdAt": "2025-01-12T14:00:00.000Z" } ], "meta": { "total": 8, "perPage": 15, "currentPage": 1, "lastPage": 1 } } ``` --- --- # Copy variable to another locale **Published**: 2026-11-30 **Category**: Core CMS ## `POST /variables/:id/copy-to-locale` **Copy variable to another locale** Creates a copy of this variable in `targetLocale`, with the same `key`, `label`, `value`, `description` and `type`. Requires both `variables.create` and `variables.view`, since copying reads the source variable. A site at its plan's variable limit gets 402 `SUBSCRIPTION_QUOTA_EXCEEDED`. Required permissions: `variables.create`, `variables.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `targetLocale` | string | Yes | Required. BCP 47 locale code of the locale to copy into (e.g. "fr", "es"). Must be enabled on the site. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | The target locale or the copy operation is invalid. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | A translation of this variable already exists in the target locale. | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/variables/dbdefd3a-656a-5854-aad7-bac613565aeb/copy-to-locale \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"targetLocale": "fr"}' ``` ### Response Example ```json { "data": { "id": "04510a52-6297-5942-b73f-6bfa50817d2f", "key": "company_name", "value": "Acme Corp", "type": "text", "locale": "fr", "createdAt": "2025-04-06T15:00:00.000Z", "updatedAt": "2025-04-06T15:00:00.000Z" } } ``` --- --- # Update a tag **Published**: 2026-11-30 **Category**: Core CMS ## `PUT /tags/:id` **Update a tag** Updates a tag's `name` or `slug`. The locale cannot change. Responds 409 when another tag in the same locale already uses the slug. Required permissions: `tags.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-100 characters | | `slug` | string | No | URL-friendly identifier, unique per site and locale. 1-100 characters | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/tags/dedd17fe-59d5-5747-ac4a-b5387ffecf91 \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "JS / JavaScript"}' ``` ### Response Example ```json { "data": { "id": "dedd17fe-59d5-5747-ac4a-b5387ffecf91", "siteId": "4f1b5c3e-8a2d-5e6f-9b0c-1d2e3f4a5b6c", "name": "JS / JavaScript", "slug": "javascript", "locale": "en", "translationGroupId": "6c8d3f2b-4e5a-4b7c-9d0e-1f2a3b4c5d6e", "createdAt": "2025-01-08T10:00:00.000Z", "updatedAt": "2025-04-06T16:00:00.000Z" } } ``` --- --- # Get category translation status **Published**: 2026-11-30 **Category**: Core CMS ## `GET /categories/:id/translations` **Get category translation status** Returns the translations that exist for this category: one entry per existing translation, the requested category included, flagged `current`. A locale with no translation has no entry, and the list is empty when the category has no translation group. `needsReview` is true when that translation was written against a default-language version of the category that has changed since. Required permissions: `categories.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/categories/0d95ec3e-cec3-5b56-a2d6-8a0fc4293392/translations \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "translationGroupId": "5b7c2e1a-3d4f-4a6b-8c9d-0e1f2a3b4c5d", "currentLocale": "en", "translations": [ { "id": "0d95ec3e-cec3-5b56-a2d6-8a0fc4293392", "locale": "en", "name": "Tutorials", "slug": "tutorials", "current": true, "needsReview": false }, { "id": "8bec0447-6b77-5572-8cb4-4909fe02e7eb", "locale": "fr", "name": "Tutoriels", "slug": "tutoriels", "current": false, "needsReview": true } ] } } ``` --- --- # Get folder tree **Published**: 2026-11-30 **Category**: Media & Files ## `GET /media-folders/tree` **Get folder tree** Returns every folder of the site as a nested tree, each with its `children`, sorted by name. Required permissions: `media.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/media-folders/tree \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "f1a2b3c4-d5e6-4890-abcd-ef1234567890", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "name": "Banners", "parentId": null, "createdAt": "2025-01-15T09:00:00.000Z", "updatedAt": "2025-01-15T09:00:00.000Z", "children": [] }, { "id": "f2b3c4d5-e6f7-4901-bcde-f12345678901", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "name": "Blog Images", "parentId": null, "createdAt": "2025-01-15T09:05:00.000Z", "updatedAt": "2025-03-02T16:20:00.000Z", "children": [ { "id": "f3c4d5e6-f7a8-4012-8def-234567890123", "siteId": "5b1e7c2a-9d4f-4e3b-8a6c-1f2d3e4a5b6c", "name": "Thumbnails", "parentId": "f2b3c4d5-e6f7-4901-bcde-f12345678901", "createdAt": "2025-02-01T14:00:00.000Z", "updatedAt": "2025-02-01T14:00:00.000Z", "children": [] } ] } ] } ``` --- --- # Trigger a full reindex of the site **Published**: 2026-11-30 **Category**: Core CMS ## `POST /search/reindex` **Trigger a full reindex of the site** Starts a full reindex of the site's searchable items in the background and returns 202 at once, with `status: 'queued'`. 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan does not include Instant Search, 503 when search is not available. Required permissions: `search.config.update` ### Responses | Status | Description | | --- | --- | | `202` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl -X POST "https://api.lynkow.com/v1/search/reindex" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "status": "queued" } } ``` --- --- # Update a category **Published**: 2026-11-30 **Category**: Core CMS ## `PUT /categories/:id` **Update a category** Updates a category. Every field is optional, and `parentId: null` moves the category to the root. A category's locale never changes here. On a multi-language site a category tree holds one locale: a move under a parent in another locale than the category's is rejected with 422 on `parentId`. Sending the current `parentId` again is no move. Switching to structured mode, changing a structured schema, adding a data source field, or a `jsonLdGraph` or `jsonLdExclusions` entry the stored list lacks returns 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan lacks that feature. Stored values sent back unchanged are accepted. When the slug changes, or the category moves with nested blog URLs, every URL that changes gets an automatic 301 redirect rule: the category page and, with nested blog URLs, its published contents, its descendant categories and their published contents. With flat blog URLs a move changes no URL and creates no rule. Required permissions: `categories.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `name` | string | No | Display name. 1-255 characters | | `slug` | string | No | URL-friendly identifier, unique per site and locale. 1-255 characters | | `description` | string \| null | No | Description text | | `image` | string \| null | No | Image URL | | `parentId` | string \| null | No | Parent resource ID | | `sitemapPriority` | number (0 to 1) \| null | No | Sitemap priority (0.0-1.0) | | `sitemapChangefreq` | "always" \| "hourly" \| "daily" \| "weekly" \| "monthly" \| "yearly" \| "never" \| null | No | Sitemap change frequency (always, hourly, daily, weekly, monthly, yearly or never) | | `contentMode` | "standard" \| "structured" | No | One of: standard, structured | | `schema` | object | No | Field schema definition | | `schemaSource` | "own" \| "inherit" | No | One of: own, inherit | | `displayOrder` | number | No | Sort position: in ascending order, lower values come first | | `jsonLdGraph` | object[] | No | Author-defined JSON-LD graph nodes added to the page structured data (max 50); a node's optional `scope` (`site` or `page`) sets whether its `@id` is built on the site URL or the page URL | | `jsonLdExclusions` | string[] | No | JSON-LD node ids inherited from a parent level that this page excludes from its graph (max 50) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error, including, on a multi-language site, a `parentId` that moves the category under a category in another locale than its own. Nothing is changed. | > **Notes:** - Errors: 409 for a slug taken in the category's locale, 404 for an unknown parent, 400 for a parent that is the category itself or one of its descendants, 422 for an invalid `schema`. > > - A single-language site does not check the parent's locale. A category already under a parent of another locale keeps it through any update that does not move it. > - Hand-written redirects are never changed. > - `redirectsCreated` counts the automatic redirect rules created. Past the limit of 10000 automatic redirect rules per site, which excludes manual rules, the rest are not created and are counted in `redirectsSkipped`, and the update still succeeds. > - Changing `contentMode` adds `impactedArticleCount` (contents in the category) and `inheritingChildCount` (children inheriting its schema) to the response when they are above 0. ### Examples ```bash curl -X PUT https://api.lynkow.com/v1/categories/b4b22df1-8bde-5ba0-b1e3-bdc6d7f08933 \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "name": "REST API Guides", "description": "Updated description for API guides" }' ``` ### Response Example ```json { "data": { "id": "b4b22df1-8bde-5ba0-b1e3-bdc6d7f08933", "name": "REST API Guides", "slug": "api-guides", "description": "Updated description for API guides", "parentId": "8a077301-dc5f-53fe-a181-11515aae8c50", "locale": "en", "contentCount": 5, "createdAt": "2025-04-06T12:00:00.000Z", "updatedAt": "2025-04-06T16:00:00.000Z", "redirectsCreated": 0, "redirectsSkipped": 0 } } ``` --- --- # Delete a search profile **Published**: 2026-11-30 **Category**: Core CMS ## `DELETE /search/profiles/:id` **Delete a search profile** Permanently deletes a search profile and fires the `search_profile.deleted` webhook. Deleting the default profile returns 400: make another profile the default first. Required permissions: `search.profiles.delete` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `204` | Deleted (no body) | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl -X DELETE "https://api.lynkow.com/v1/search/profiles/3f2b1c8a-9d4e-4a7f-8b21-5e6d7c8a9b01" \ -H "Authorization: Bearer $API_TOKEN" ``` --- --- # Create a search profile **Published**: 2026-11-30 **Category**: Core CMS ## `POST /search/profiles` **Create a search profile** Creates a search profile. `isPublic` defaults to true, `maxLimit` to 100 and `defaultLimit` to 20, or to `maxLimit` when that is lower. `isDefault: true` makes it the site's default profile and also requires `search.profiles.update`, else 403 `AUTHZ_PERMISSION_DENIED` and nothing is created. Fires the `search_profile.created` webhook. 400 when another profile has the same `slug`, 422 when `defaultLimit` exceeds `maxLimit`. 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan does not include Instant Search, 402 `SUBSCRIPTION_QUOTA_EXCEEDED` at the plan's limit of search profiles. Required permissions: `search.profiles.create` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `slug` | string | Yes | Required. URL-friendly identifier, unique per site and locale. 1-100 characters | | `name` | string | Yes | Required. Display name. 1-200 characters | | `description` | string \| null | No | Description text | | `isPublic` | boolean | No | Whether this search profile is exposed on the public storefront search API | | `scope` | object | No | Limits the searched contents by category, tag, type, locale, id, path prefix or metadata. A sent object replaces the stored one, and `{}` removes every limit | | `searchableFields` | "title" \| "excerpt" \| "description" \| "body" \| "metaTitle" \| "metaDescription" \| "keywords" \| "authorName" \| "featuredImage" \| "customData" \| "meta" \| "categories.name" \| "tags.name"[] | No | Fields the query is matched against. Omitted, it copies the site search configuration's `includedFields` | | `displayedFields` | string[] | No | Fields returned on each hit. Omitted, a standard set of content fields is returned | | `facets` | string[] | No | Fields whose value counts are returned in `meta.facetDistribution` | | `sort` | string[] | No | Order of every search through this profile, as `field:asc` or `field:desc` entries applied in turn. Empty sorts by relevance | | `defaultLimit` | number (1 to 100) | No | Hits per page when the search sends no `limit`, capped at `maxLimit`. Defaults to 20 on create | | `maxLimit` | number (1 to 500) | No | Highest `limit` a search can use; a larger one is lowered to it. Defaults to 100 on create | | `boostedContentIds` | string[] | No | Content UUIDs to rank higher in results (max 100) | | `featuredContentIds` | string[] | No | Content UUIDs pinned to the top of results regardless of relevance (max 100) | | `isDefault` | boolean | No | Promote this profile to the site default, in place of the current one. Requires `search.profiles.update` in addition to `search.profiles.create`; without it the request is refused with 403 and no profile is created | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan lacks this feature, its quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X POST "https://api.lynkow.com/v1/search/profiles" \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "slug": "api-docs", "name": "API Docs", "description": "Search scoped to the API reference.", "isPublic": true, "scope": { "includeCategories": ["api-reference"], "includeLocales": ["en"] }, "searchableFields": ["title", "excerpt", "body", "metaTitle"], "displayedFields": ["id", "title", "slug", "path", "excerpt"], "facets": ["categories.slug", "tags.slug"], "sort": ["publishedAt:desc"], "defaultLimit": 20, "maxLimit": 50 }' ``` ### Response Example ```json { "data": { "id": "3f2b1c8a-9d4e-4a7f-8b21-5e6d7c8a9b01", "siteId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "slug": "api-docs", "name": "API Docs", "description": "Search scoped to the API reference.", "isPublic": true, "isDefault": false, "scope": { "includeCategories": [ "api-reference" ], "includeLocales": [ "en" ] }, "searchableFields": [ "title", "excerpt", "body", "metaTitle" ], "displayedFields": [ "id", "title", "slug", "path", "excerpt" ], "facets": [ "categories.slug", "tags.slug" ], "sort": [ "publishedAt:desc" ], "defaultLimit": 20, "maxLimit": 50, "boostedContentIds": [], "featuredContentIds": [], "createdAt": "2026-06-07T10:32:14.512+00:00", "updatedAt": "2026-06-07T10:32:14.512+00:00" } } ``` --- --- # Full-text search (default profile) **Published**: 2026-11-30 **Category**: Core CMS ## `GET /search` **Full-text search (default profile)** Searches the site's published items with typo tolerance, using the site's default search profile, and returns hits ranked by relevance with the matching terms highlighted. Narrow them with `locale`, `category` and `tag` (slugs), and with `market` to leave out the products hidden in that market. Use `GET /search/{profileSlug}` for another profile. A hit holds only the fields the profile displays, so any field, `id` and `path` included, can be missing. An empty `q` returns no hits rather than an error. `fallback` defaults to `false`: with `locale`, only hits written in that locale come back unless you pass `fallback=true`. `limit` defaults to the profile's `defaultLimit` and is capped at its `maxLimit`. 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan does not include Instant Search. 503 `INTERNAL_SERVICE_UNAVAILABLE` when search is not enabled for the site. Required permissions (any one of): `search.view`, `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `q` | query | string | No | Full-text search query string. Min 1 character | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default false) | No | With `locale`, `true` also returns hits served from another locale when an item has no translation in it. Defaults to false; a non-boolean returns 422 | | `market` | query | string | No | Market `mkt_` id: products hidden in that market are left out. An unknown, draft or malformed value is ignored | | `category` | query | string | No | Keeps only the contents in the category with this slug | | `tag` | query | string | No | Keeps only the contents carrying the tag with this slug | | `page` | query | number (min 1, default 1) | No | Page number, starting at 1 | | `limit` | query | number (min 1) | No | Hits per page. Defaults to the search profile's `defaultLimit`. A value above its `maxLimit` is lowered to it, and a non-numeric one uses the default | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash # Simple query curl "https://api.lynkow.com/v1/search?q=getting+started" \ -H "Authorization: Bearer $API_TOKEN" # Filtered + paginated curl "https://api.lynkow.com/v1/search?q=cms&locale=en&category=tutorials&page=1&limit=10" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "42", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "path": "/blog/getting-started-with-lynkow", "excerpt": "Learn how to set up your first headless CMS with Lynkow.", "locale": "en", "categories": [ { "slug": "tutorials", "name": "Tutorials" } ], "tags": [ { "slug": "getting-started", "name": "Getting Started" } ], "_formatted": { "title": "<em>Getting Started</em> with Lynkow", "excerpt": "Learn how to set up your first headless CMS with Lynkow." } } ], "meta": { "total": 3, "page": 1, "totalPages": 1, "perPage": 10, "query": "getting started", "processingTimeMs": 4, "profile": "default" } } ``` --- --- # Copy content to another locale **Published**: 2026-11-30 **Category**: Core CMS ## `POST /contents/:id/copy-to-locale` **Copy content to another locale** Creates a `draft` copy of a content in `targetLocale`, in the same translation group (`translationGroupId`). The title, body and SEO fields are copied as written, for you to translate; the canonical URL is not. The copy keeps the slug, unless another content of the target locale uses it: the slug then gets the locale as suffix (`my-article-fr`). Each category must have a translation in the target locale, else 400 and nothing is created. Tags move to their translation in the target locale and are left out when they have none. Requires `contents.create` and `contents.view`. Fires the `content.translated` webhook. Returns 402 when the site's content quota is reached. Required permissions: `contents.create`, `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `targetLocale` | string | Yes | Required. BCP 47 locale code of the locale to copy into (e.g. "fr", "es"). Must be enabled on the site. | ### Responses | Status | Description | | --- | --- | | `201` | Successful response | | `400` | Multi-language is off, the target locale is not enabled on the site, or a category has no translation in it. | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan quota for this resource is reached, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `409` | The content already has a translation in the target locale. The body then carries its `existingId` when you may view it. | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/contents/53fca881-a68d-585a-97a0-649b241e029e/copy-to-locale \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"targetLocale": "fr"}' ``` ### Response Example ```json { "data": { "id": "76c78094-f0c2-599a-925f-8223d98b2add", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "type": "post", "status": "draft", "locale": "fr", "translationGroupId": "3c9a7e52-1b4d-4f68-9a2e-6d0b8c71f4a3", "createdAt": "2025-04-06T15:00:00.000Z", "updatedAt": "2025-04-06T15:00:00.000Z" } } ``` --- --- # Get alternate locale versions **Published**: 2026-11-30 **Category**: Core CMS ## `GET /contents/:id/alternates` **Get alternate locale versions** Returns every language version of a content, itself included, sorted by locale. Each one is the full content with its `path` and `isCurrent`. Drafts are included: check `status` before linking to one from `hreflang` tags or a language switcher. Required permissions: `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/contents/54bcf507-92bb-53fd-8ddf-080e9fd98294/alternates \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "54bcf507-92bb-53fd-8ddf-080e9fd98294", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "type": "post", "status": "published", "locale": "en", "translationGroupId": "b3f1c2d4-5e6a-4b7c-8d9e-0f1a2b3c4d5e", "path": "/blog/getting-started-with-lynkow", "isCurrent": true }, { "id": "5f5ff1ca-5588-5697-ae45-333fbd9ab27f", "title": "Premiers pas avec Lynkow", "slug": "premiers-pas-avec-lynkow", "type": "post", "status": "draft", "locale": "fr", "translationGroupId": "b3f1c2d4-5e6a-4b7c-8d9e-0f1a2b3c4d5e", "path": "/fr/blog/premiers-pas-avec-lynkow", "isCurrent": false } ] } ``` --- --- # Update the site-level search configuration **Published**: 2026-11-30 **Category**: Core CMS ## `PUT /search/config` **Update the site-level search configuration** Updates the search index settings with the fields you send and returns them. Every save starts a full reindex of the site in the background, so search results may be incomplete for a short time. Fires the `search_config.updated` webhook. 402 `SUBSCRIPTION_FEATURE_UNAVAILABLE` when the site's plan does not include Instant Search. Required permissions: `search.config.update` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `includedFields` | "title" \| "excerpt" \| "description" \| "body" \| "metaTitle" \| "metaDescription" \| "keywords" \| "authorName" \| "featuredImage" \| "customData" \| "meta" \| "categories.name" \| "tags.name"[] | No | Content fields stored in the search index, and the default `searchableFields` of profiles created later. A change reindexes the site in the background | | `synonyms` | object | No | Synonym groups for query expansion: each key maps to an array of equivalent terms (max 50 per group) | | `stopWords` | string[] | No | Words ignored in search queries on every profile, replacing the stored list | | `typoTolerance` | object | No | Typo-tolerance settings for fuzzy matching: enable flag, min word sizes for 1/2 typos, and attribute/word exclusions | | `rankingRules` | "words" \| "typo" \| "proximity" \| "attribute" \| "sort" \| "exactness"[] | No | Relevance rules in priority order, most important first, replacing the stored order | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site's plan does not include this feature, or its subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Examples ```bash curl -X PUT "https://api.lynkow.com/v1/search/config" \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "includedFields": ["title", "excerpt", "body", "metaTitle", "keywords"], "synonyms": { "sneaker": ["trainer", "shoe"] }, "stopWords": ["the", "a", "an"], "typoTolerance": { "enabled": true, "minWordSizeForTypos": { "oneTypo": 5, "twoTypos": 9 } }, "rankingRules": ["words", "typo", "proximity", "attribute", "sort", "exactness"] }' ``` ### Response Example ```json { "data": { "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "siteId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "includedFields": [ "title", "excerpt", "body", "metaTitle", "keywords" ], "synonyms": { "sneaker": [ "trainer", "shoe" ] }, "stopWords": [ "the", "a", "an" ], "typoTolerance": { "enabled": true, "minWordSizeForTypos": { "oneTypo": 5, "twoTypos": 9 }, "disableOnAttributes": [], "disableOnWords": [] }, "rankingRules": [ "words", "typo", "proximity", "attribute", "sort", "exactness" ], "createdAt": "2026-06-01T08:00:00.000+00:00", "updatedAt": "2026-06-07T11:14:33.908+00:00" } } ``` --- --- # Get translation status **Published**: 2026-11-30 **Category**: Core CMS ## `GET /contents/:id/translations` **Get translation status** Returns, for each locale enabled on the site, whether the content has a translation in it, and whether that translation needs review because the text it was translated from has changed since. Required permissions: `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/contents/b7933cbe-51d7-5e1c-a0b0-a2468740578a/translations \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "translationGroupId": "3c9a7e52-1b4d-4f68-9a2e-6d0b8c71f4a3", "currentLocale": "en", "translations": [ { "locale": "en", "exists": true, "current": true, "needsReview": false, "id": "b7933cbe-51d7-5e1c-a0b0-a2468740578a", "slug": "getting-started-with-lynkow", "status": "published" }, { "locale": "fr", "exists": true, "current": false, "needsReview": true, "id": "68eae251-c391-52c1-b1e4-1f38e683fb62", "slug": "premiers-pas-avec-lynkow", "status": "published" }, { "locale": "es", "exists": false, "current": false, "needsReview": false } ] } } ``` --- --- # Compare two revisions **Published**: 2026-11-30 **Category**: Core CMS ## `GET /contents/:id/revisions/:revisionAId/compare/:revisionBId` **Compare two revisions** Compares two revisions of one content. Returns both revisions and a `changes` object with one boolean per field, the SEO and structured data metadata included, telling whether it differs. Required permissions: `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | | `revisionAId` | path | string | Yes | First revision ID (for comparison) | | `revisionBId` | path | string | Yes | Second revision ID (for comparison) | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/contents/eb804c28-9f82-5175-8b5f-0fc522f9e1ce/revisions/983fbfe3-1d10-5ba1-b737-c861e3e0d7b7/compare/4d4febc6-564c-50c3-b820-7675500994b8 \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "revisionA": { "id": "983fbfe3-1d10-5ba1-b737-c861e3e0d7b7", "versionNumber": 3 }, "revisionB": { "id": "4d4febc6-564c-50c3-b820-7675500994b8", "versionNumber": 5 }, "changes": { "titleChanged": true, "slugChanged": false, "excerptChanged": true, "bodyChanged": true, "metaChanged": false, "customDataChanged": false, "metadataChanged": true } } } ``` --- --- # List content revisions **Published**: 2026-11-30 **Category**: Core CMS ## `GET /contents/:id/revisions` **List content revisions** Returns a content's revisions, newest first, 20 per page (at most 100). A revision is a snapshot of the title, slug, excerpt, body, custom data and meta, saved before each update and before each restore. Required permissions: `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/contents/181a22b7-5611-56d3-a82b-0f7224a525ba/revisions \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "384c93fd-5093-5562-8b80-473410f29d5a", "contentId": "181a22b7-5611-56d3-a82b-0f7224a525ba", "title": "Updated Title", "changes": [ { "field": "title", "from": "Getting Started with Lynkow", "to": "Updated Title" }, { "field": "excerpt", "from": null, "to": "Updated excerpt for the article." } ], "createdAt": "2025-04-06T14:00:00.000Z", "author": { "id": "fcf66e1e-a1dd-5f3c-b7a5-68c99d12e2e6", "fullName": "Jane Doe" } }, { "id": "9638ac1d-cfb4-5dc8-9c5c-fe46267d5eec", "contentId": "181a22b7-5611-56d3-a82b-0f7224a525ba", "title": "Getting Started with Lynkow", "changes": [ { "field": "bodyMarkdown", "from": "# Welcome", "to": "# Welcome\n\nThis is your first article." } ], "createdAt": "2025-03-15T10:30:00.000Z", "author": { "id": "fcf66e1e-a1dd-5f3c-b7a5-68c99d12e2e6", "fullName": "Jane Doe" } } ] } ``` --- --- # Get a content **Published**: 2026-11-30 **Category**: Core CMS ## `GET /contents/:id` **Get a content** Returns a content by its ID, in any status, with its body, categories, tags, SEO fields, structured data, `path` and the size variants of its featured image. Variable placeholders in the body are returned as written, unresolved. Required permissions: `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/contents/9801322b-55d5-58a4-9631-ddde5b9bcccd \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "id": "9801322b-55d5-58a4-9631-ddde5b9bcccd", "title": "Getting Started with Lynkow", "slug": "getting-started-with-lynkow", "type": "post", "status": "published", "excerpt": "Learn how to set up your first headless CMS.", "bodyHtml": "<h1>Welcome</h1><p>This is your first article...</p>", "locale": "en", "featuredImage": { "url": "https://cdn.lynkow.com/sites/abc123/hero.jpg", "alt": "Lynkow dashboard screenshot", "variants": { "thumbnail": "https://cdn.lynkow.com/sites/abc123/hero.jpg?w=150", "card": "https://cdn.lynkow.com/sites/abc123/hero.jpg?w=400", "content": "https://cdn.lynkow.com/sites/abc123/hero.jpg?w=800", "medium": "https://cdn.lynkow.com/sites/abc123/hero.jpg?w=1200" } }, "categories": [ { "id": "901cfdce-4acc-5949-b904-b61a6524cc14", "name": "Tutorials", "slug": "tutorials" } ], "tags": [ { "id": "557bf1fb-3948-51a0-979b-39b87d4a18d5", "name": "Getting Started", "slug": "getting-started" } ], "meta": { "metaTitle": "Getting Started with Lynkow | My Blog", "metaDescription": "A step-by-step guide to setting up Lynkow.", "canonicalUrl": null, "ogImage": null }, "author": { "id": "9ce731a1-06b9-57a8-b875-5f13bb640160", "fullName": "Jane Doe" }, "publishedAt": "2025-03-15T10:30:00.000Z", "createdAt": "2025-03-14T08:00:00.000Z", "updatedAt": "2025-03-15T10:30:00.000Z", "alternates": [ { "locale": "fr", "id": "35dc6f72-d570-5e0b-a494-8516b72c7cae", "slug": "premiers-pas-avec-lynkow" } ] } ``` --- --- # Bulk delete contents **Published**: 2026-11-30 **Category**: Core CMS ## `POST /contents/bulk-delete` **Bulk delete contents** Permanently deletes up to 100 contents by ID, with their revisions. Their other translations are kept. IDs that match no content of the site are ignored. Fires one `content.bulk_deleted` webhook carrying the IDs actually deleted, and none when nothing was deleted. Required permissions: `contents.delete` ### Request Body Content-Type: `application/json` | Field | Type | Required | Description | | --- | --- | --- | --- | | `ids` | string[] | Yes | Required | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | > **Notes:** - Maximum 100 IDs per request. ### Examples ```bash curl -X POST https://api.lynkow.com/v1/contents/bulk-delete \ -H "Authorization: Bearer $API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"ids": ["b857bb88-9d15-5a2e-8863-ce1ee99482d6", "3b16c6e4-c690-5b86-98b7-2353846bdfbf"]}' ``` ### Response Example ```json { "data": { "message": "Successfully deleted 2 content(s)", "count": 2, "redirectsCreated": 0 } } ``` --- --- # Get the site-level search configuration **Published**: 2026-11-30 **Category**: Core CMS ## `GET /search/config` **Get the site-level search configuration** Returns the site's search index settings shared by every profile: the indexed content fields, synonyms, stop words, typo tolerance and ranking rules. A site that never changed them gets the defaults. Required permissions: `search.config.update` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/search/config" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "siteId": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d", "includedFields": [ "title", "excerpt", "body", "metaTitle", "metaDescription", "keywords", "categories.name", "tags.name" ], "synonyms": { "sneaker": [ "trainer", "shoe" ] }, "stopWords": [ "the", "a", "an" ], "typoTolerance": { "enabled": true, "minWordSizeForTypos": { "oneTypo": 5, "twoTypos": 9 }, "disableOnAttributes": [], "disableOnWords": [] }, "rankingRules": [ "words", "typo", "proximity", "attribute", "sort", "exactness" ], "createdAt": "2026-06-01T08:00:00.000+00:00", "updatedAt": "2026-06-01T08:00:00.000+00:00" } } ``` --- --- # List the API token's sites **Published**: 2026-11-30 **Category**: Settings & Config ## `GET /sites` **List the API token's sites** Returns the sites your API token can act on. Call it without `X-Site-Id`: an organization token uses it to find the site IDs to send in that header. A site token returns its own site, or an empty list when the user it was issued for has lost access to that site. An organization token returns every site of the organization, or only the sites the token is restricted to. Inactive sites are listed with `isActive: false`. Returns 403 `TENANT_SITE_INACTIVE` when the site the request resolves to (the token's site, the `X-Site-Id` site, or an organization token's only site) is inactive, or when the organization is not currently served. ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/sites \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "name": "My Website", "slug": "my-website", "domain": "www.example.com", "organizationId": "b2c3d4e5-f6a7-8901-bcde-f12345678901", "isActive": true } ] } ``` --- --- # Authentication **Published**: 2026-11-30 **Category**: Admin API ## API Tokens Create API tokens in the Lynkow admin dashboard under **Settings > Developers > API**. Each token is scoped to a single site and has granular permissions. ## Usage Include the token in every request: ```bash curl https://api.lynkow.com/v1/contents \ -H "Authorization: Bearer lkw_sk_xxxxxxxxxxxxxxxxxxxxxxxx" ``` ## Permissions Available permission scopes: | Permission | | --- | | `sites.view` | | `sites.create` | | `sites.update` | | `sites.hostnames.update` | | `sites.delete` | | `sites.manage` | | `contents.view` | | `contents.view.own` | | `contents.create` | | `contents.update` | | `contents.update.own` | | `contents.delete` | | `contents.delete.own` | | `contents.publish` | | `contents.publish.own` | | `media.view` | | `media.upload` | | `media.update` | | `media.delete` | | `categories.view` | | `categories.create` | | `categories.update` | | `categories.delete` | | `tags.view` | | `tags.create` | | `tags.update` | | `tags.delete` | | `site_blocks.view` | | `site_blocks.create` | | `site_blocks.update` | | `site_blocks.delete` | | `site_blocks.publish` | | `site_blocks.schema` | | `webhooks.view` | | `webhooks.create` | | `webhooks.update` | | `webhooks.delete` | | `webhooks.test` | | `support.view` | | `support.create` | | `api_tokens.view` | | `api_tokens.create` | | `api_tokens.update` | | `api_tokens.delete` | | `api_tokens.regenerate` | | `storefront_keys.regenerate` | | `forms.view` | | `forms.create` | | `forms.update` | | `forms.delete` | | `forms.submissions.view` | | `forms.submissions.update` | | `forms.submissions.delete` | | `forms.submissions.export` | | `reviews.view` | | `reviews.create` | | `reviews.update` | | `reviews.delete` | | `reviews.moderate` | | `reviews.import` | | `reviews.export` | | `reviews.settings` | | `spam.settings.view` | | `spam.settings.update` | | `seo.view` | | `seo.update` | | `sitemap.view` | | `sitemap.create` | | `sitemap.update` | | `sitemap.delete` | | `sitemap.import` | | `sitemap.export` | | `redirects.view` | | `redirects.create` | | `redirects.update` | | `redirects.delete` | | `redirects.import` | | `redirects.export` | | `users.view` | | `users.create` | | `users.update` | | `users.delete` | | `users.manage_roles` | | `roles.view` | | `roles.create` | | `roles.update` | | `roles.delete` | | `permissions.view` | | `permissions.assign` | | `analytics.view` | | `analytics.export` | | `analytics.settings` | | `analytics.gsc` | | `variables.view` | | `variables.create` | | `variables.update` | | `variables.delete` | | `cookie_consent.view` | | `cookie_consent.update` | | `cookie_consent.logs` | | `cookie_consent.export` | | `ai.generate` | | `notifications.settings.view` | | `notifications.settings.update` | | `plugins.view` | | `plugins.install` | | `plugins.configure` | | `search.view` | | `search.config.update` | | `search.profiles.view` | | `search.profiles.create` | | `search.profiles.update` | | `search.profiles.delete` | | `products.view` | | `products.create` | | `products.update` | | `products.delete` | | `products.publish` | | `reservations.view` | | `reservations.manage` | | `customers.view` | | `customers.manage` | | `whatsapp.view` | | `whatsapp.send` | | `whatsapp.templates.manage` | | `whatsapp.accounts.manage` | | `whatsapp.agent.manage` | | `product_collections.view` | | `product_collections.manage` | | `product_categories.view` | | `product_categories.manage` | | `carts.view` | | `carts.manage` | | `orders.view` | | `orders.manage` | | `orders.refund` | | `payments.view` | | `payments.manage` | | `commerce_emails.view` | | `commerce_emails.manage` | | `commerce_emails.send` | ## Error Responses | Status | Meaning | | --- | --- | | `401` | Missing or invalid API token | | `403` | Token lacks the required permission | | `429` | Too many requests: wait before retrying | --- # Overview **Published**: 2026-11-30 **Category**: Admin API Lynkow headless CMS REST API. Manage contents, forms, reviews, media, analytics, SEO, and more. ## Authentication Every request sends an API token as a Bearer token in the `Authorization` header. Create tokens in the dashboard under **Settings > Developers > API**. Each endpoint page lists the permission its token needs. ``` Authorization: Bearer lkw_sk_xxxxxxxxxxxxxxxxxxxxxxxx ``` An organization token also names the site in the `X-Site-Id` header. [Authentication](/admin-api/api-authentication) lists every permission. ## First request List the sites your token can act on. Any token can call it, whatever its permissions. ```bash curl https://api.lynkow.com/v1/sites \ -H "Authorization: Bearer $API_TOKEN" ``` ## Errors Every error returns JSON with an `errors` array and a `requestId`: ```json { "errors": [ { "message": "The title field must be defined", "field": "title", "code": "VALIDATION_REQUIRED" } ], "requestId": "8f14e45f-ceea-467f-a8e5-2c0d3a1b6f9e" } ``` Branch on `code`: it is stable, while `message` is written for people and can change. `field` names the input at fault. Quote `requestId` when you contact support. | Status | Meaning | | --- | --- | | `400` | Malformed request, or an organization token without `X-Site-Id` (`TENANT_SITE_REQUIRED_FOR_ORG_TOKEN`) | | `401` | Missing, invalid or expired token (`AUTH_TOKEN_REQUIRED`, `AUTH_TOKEN_INVALID`, `AUTH_TOKEN_EXPIRED`) | | `402` | The site's plan blocks the call: inactive subscription, quota reached or feature not included | | `403` | The token lacks a permission the endpoint requires (`AUTHZ_INSUFFICIENT_PERMISSIONS`) | | `404` | Unknown resource, or one outside the token's site | | `422` | Validation failed: one entry per invalid field | | `429` | Rate limit exceeded (`RATE_LIMIT_EXCEEDED`) | | `500` | Server error, with a generic message | ## Rate limits The site's plan sets how many requests per minute the API accepts, counted across all of the site's tokens. Past that limit, the API returns 429 `RATE_LIMIT_EXCEEDED` with no `Retry-After` header. Wait, then retry with an exponential backoff. A successful response carries `X-RateLimit-Limit` and `X-RateLimit-Remaining`. They report a per-client ceiling, not the plan limit, so the plan limit can refuse a request first. --- # The full /v1 API and the Lynkow MCP server **Published**: 2026-11-25 **Category**: 2026 **Released:** February 8, 2026 The `/v1` API now covers most of the dashboard, and AI assistants can manage your site through the hosted Lynkow MCP server. ## New - **Lynkow MCP server.** Connect an AI assistant to your Lynkow site. You sign in to Lynkow and approve the access, with no token to copy. - **Several sites in one connection.** When you approve an AI assistant, you choose which sites of your organization it can reach. It can then list those sites and switch between them. ## For developers - About 64 new `/v1` endpoints, covering variables, media folders, form submissions, site settings, analytics, site blocks and more. --- # Storefront API reference, Markdown for AI, notifications panel **Published**: 2026-11-25 **Category**: 2026 **Released:** May 26, 2026 This release documents the storefront API in full and helps your site answer AI agents in Markdown. ## Improvements - **Notifications panel.** The bell opens your notifications in an inline panel, which replaces the side drawer. ## For developers - **Storefront API reference.** The storefront API reference now documents each operation with a description and its parameters. - **Markdown for AI agents.** The `markdownProxy` helper for Next.js, exported from `lynkow/middleware/next`, sends requests that ask for `text/markdown` to your Markdown route. --- # Commerce on /v1 and MCP, and a selling currency **Published**: 2026-11-25 **Category**: 2026 **Released:** August 3, 2026 Commerce data is now available to your own code and AI assistants, and you can choose the currency your shop sells in. ## New - **Selling currency.** Choose the currency your shop sells in, under Settings > E-commerce. - **All reservation calendars on one page.** A month view shows bookings across every calendar, one color per calendar, with filters by calendar and status. ## For developers - **Commerce on /v1 and MCP.** Products, orders, carts, customers, bookings, reservation calendars and commerce settings are available through `/v1` with an API token, and through the hosted MCP server. - **AI skills.** Lynkow publishes skills that teach AI coding assistants, such as Claude Code, Cursor, Codex, Copilot and Windsurf, to build with the SDK or the storefront API. --- # Pages, the SDK and a new editor **Published**: 2026-11-25 **Category**: 2026 **Released:** January 29, 2026 This release adds structured pages, the official TypeScript SDK and a new content editor. ## New - **Pages and site blocks.** Define the structure of a page or a shared block with a schema, then fill it in from a form in the dashboard. - **Block editor.** Write with a slash menu, a formatting toolbar and Markdown paste. Insert tables, and code blocks with a language picker and a copy button. - **Form email notifications.** Get an email for every form submission, sent to several recipients if you want. ## For developers - The `lynkow` TypeScript SDK reached version 1.0 on January 12. --- # Content and category API fixes **Published**: 2026-11-25 **Category**: 2026 **Released:** November 18, 2026 This release fixes several content and category reads and writes. One change to the revision compare read is breaking. ## For developers - **Breaking: revision compare uses the ****`data`**** envelope.** `GET /v1/contents/{id}/revisions/{revisionAId}/compare/{revisionBId}` now returns its body under `data`, like every other read. Read `data.revisionA`, `data.revisionB` and `data.changes`. - **Slug reads pick a defined translation.** When several translations share a slug, `GET /v1/contents/slug/{slug}` returns the one in the site's default language, else the oldest. - **Bulk delete.** `POST /v1/contents/bulk-delete` now returns `count` as a number instead of a one-item array. Its `content.bulk_deleted` webhook lists only the contents actually deleted, and is not sent when none was. - **Inherited category schema.** The storefront category read now includes `resolvedSchema` for a structured category that inherits its schema. Update to SDK 1.65.1 to read it. - **Category children.** `includeChildren=true` on `GET /v1/categories` now returns each category's `children` as well as its `parent`. - **JSON-LD scope kept.** JSON-LD nodes now keep their `scope` (`site` or `page`) when you save them. - **Repeated taxonomy IDs.** `PUT /v1/contents/{id}` rejects repeated `categoryIds` or `tagIds` with 422, as create already did. --- # Reservations **Published**: 2026-11-25 **Category**: 2026 **Released:** July 14, 2026 Lynkow now handles bookings: make a product bookable, set when it is available, and take bookings from the dashboard or your site. ## New - **Bookable products.** Make a product bookable, set its weekly schedule and its exceptions, and manage its bookings in the dashboard. - **Shared calendars.** Create calendars with their own schedule and exceptions, then attach one calendar to several products. - **Resource pools.** Let a service draw from several calendars, for example one per staff member. ## For developers - **Guest booking.** Guests can book through the storefront API and the SDK, which also lists bookable products and their availability. --- # The storefront API and publishable keys (SDK 1.40) **Published**: 2026-11-25 **Category**: 2026 **Released:** July 3, 2026 The public API gets its own `/storefront` namespace and a publishable key. ## Improvements - **Faster public reads.** Public content reads respond faster, category listings in particular. ## For developers - **Storefront API.** The public API moves to `/storefront/:siteId`. SDK 1.40 calls the storefront URLs and accepts your publishable key. - **Publishable keys.** Each site has a publishable key for the storefront API. Find it under Settings > General, where you can regenerate it. --- # Lynkow launches **Published**: 2026-11-25 **Category**: 2025 **Released:** December 2025 Lynkow's first releases, in December 2025, bring everything you need to run the content, forms, reviews and SEO of a site from one dashboard. ## New - **Content editor.** Write articles in a rich text editor with Markdown support. Embed videos and iframes. - **Forms.** Build forms with conditional fields, preview them and read submissions in the dashboard. Spam protection filters bots. - **SEO basics.** Manage your sitemap, your robots.txt and your redirects. - **Reviews.** Collect customer reviews, approve or reject them before they appear, and import the ones you already have. - **Analytics.** Follow visits, pages, traffic sources, devices, engagement, funnels and heatmaps. --- # An Astro starter and @lynkow/astro **Published**: 2026-11-25 **Category**: 2026 **Released:** November 24, 2026 Lynkow sites can now be built on Astro as well as Next.js. ## For developers - **An Astro starter.** `npx create-lynkow-app my-site --template astro` generates a site with the same pages, features and site blocks as the Next.js starter: blog, shop, cart, checkout, customer accounts, bookings, search and SEO files. `create-lynkow-app` 0.2.14 adds the `--template` option, and asks which starter to generate when you leave it out in a terminal. - **`@lynkow/astro`****.** The new package holds what every Lynkow site on Astro needs: a middleware for redirects, language detection and locale routing, clients with a tagged data cache, the revalidation webhook, head data for SEO, the buyer session, and the visual editor. It requires Astro 7 with on-demand rendering and `lynkow` 1.65.6. - **A new guide.** [Build a Site with Astro](/docs/sdk/getting-started/astro) covers the starter, the setup of each piece and the environment variables. --- # Server keys and per-buyer rate limits **Published**: 2026-11-25 **Category**: 2026 **Released:** November 23, 2026 This release makes the storefront rate limits count each buyer, even when your own server makes the calls. ## New - **Server keys.** Manage server keys under **Settings > Developers > Storefront**, next to your publishable keys. A server key starts with `lkw_srv_` and is shown once. A new site gets one, already in the `.env` shown when you create the site. Your plan allows as many server keys as publishable keys, counted separately. - **Large carts.** Cart changes now have their own limit, so a buyer filling a large cart can still check out. - **Sign-in counts only failed attempts.** A buyer who signs in often is never refused for it. ## For developers - **Forward the buyer IP.** A server that calls the storefront API for its buyers sends the server key with each buyer's IP, through the `serverKey` and `clientIp` options of `createClient()` and `createBuyerClient()`. A secret API token also works. See [Customer Accounts](/docs/sdk/features/commerce-customer-accounts). - **Automatic with ****`@lynkow/next`**** 0.7.3.** Update `@lynkow/next` to 0.7.3 and set `LYNKOW_SERVER_KEY`: `createBuyerClient()` then forwards the buyer IP on its writes and on the guest order read, with no code change. Behind a CDN, or when your host documents its own client-IP header, set `LYNKOW_CLIENT_IP_HEADER` to that header's name. `resolveBuyerForwarding()` returns the same pair for a client you create yourself. - **Cart limit.** Cart writes allow 120 requests per minute for each client, instead of sharing the 10 per 15 minutes of form and review submissions. - **Buyer sign-in limits.** Login, account activation, email verification and password reset confirmation count only failed attempts: 5 failed sign-ins per email, and 10 failed attempts per client across the four, in 15 minutes. Past that, they return 429 `RATE_LIMIT_EXCEEDED` with a `Retry-After` header. Register, password reset requests and verification resends still count every request. - **Versions.** `lynkow` 1.65.5 and `@lynkow/next` 0.7.2 document the server key in `serverKey`. `@lynkow/next` 0.7.3 forwards on its own and requires `lynkow` 1.65.6, which adds the `requestHeaders` option. --- # A reservation calendar, order emails, and a faster dashboard **Published**: 2026-11-25 **Category**: 2026 **Released:** August 22, 2026 This release changes how you follow bookings, adds order emails, and makes the dashboard faster. ## New - **Reservations calendar.** The Reservations page shows your bookings on a calendar. Click a booking to open its details in a dialog. - **Order emails.** Buyers receive emails about their orders, starting with a confirmation when they place one. You receive a notification for each new order. - **Faster dashboard.** The dashboard loads faster, and screens you return to, such as analytics and the contents list, open without waiting. ## For developers - **Higher rate limits.** Rate limits on the storefront API and `/v1` are higher, so server-rendered sites and static builds receive fewer `429` responses. --- # Automatic buyer IP forwarding **Published**: 2026-11-25 **Category**: 2026 **Released:** November 23, 2026 A Next.js storefront now has each buyer counted on their own by setting one environment variable. ## For developers - **Forwarding without code.** With `@lynkow/next` 0.7.3, set `LYNKOW_SERVER_KEY` to the site's server key: `createBuyerClient()` then sends the key with the buyer's IP on every write and on the guest order read. Other reads never read the request headers, so their pages stay static. - **Where the address comes from.** The buyer's address is read from `X-Forwarded-For`. Behind a CDN, name the header your CDN overwrites with the visitor's address in `LYNKOW_CLIENT_IP_HEADER`. - **`resolveBuyerForwarding()`**, from `@lynkow/next/server`, returns the same `{ serverKey, clientIp }` pair for a client you create yourself. - **Opting out.** Passing `serverKey` or `clientIp` to `createBuyerClient()` turns the automatic forwarding off for that client. `serverKey: ''` sends nothing. - **Versions.** `@lynkow/next` 0.7.3 requires `lynkow` 1.65.6, which adds the `requestHeaders` option. - **Sites generated with ****`create-lynkow-app`****.** From 0.2.13, a new site relies on this forwarding and needs only `LYNKOW_SERVER_KEY`. A site generated with 0.2.12 passes its own buyer IP, which turns the automatic forwarding off for its clients. Replace its `src/lib/buyer-forwarding.ts` as shown in [Server Key and Buyer IP](/docs/sdk/advanced/server-key-buyer-ip#upgrade-an-older-site). - **A new guide.** [Server Key and Buyer IP](/docs/sdk/advanced/server-key-buyer-ip) gathers the per-buyer limits, the setup for each kind of server, a check that forwarding works, and a troubleshooting table. ## Improved - **The guest order page counts each buyer.** Its read shares the limit of checkout, 10 per 15 minutes. It is now forwarded too. - **Clearer permission.** The role permission that manages storefront keys and server keys is now named **Manage storefront and server keys**. --- # A new mobile dashboard, and safer forms **Published**: 2026-11-25 **Category**: 2026 **Released:** October 28, 2026 This release rebuilds the dashboard home and its mobile layout, fills in variables inside site blocks, and tightens forms. ## New - **A rebuilt dashboard home.** The dashboard home and the organization page are rebuilt. - **A reworked mobile layout.** The dashboard on a phone is reworked around a floating bottom bar. - **Variables in site blocks.** Text fields in your site blocks now replace variables with their value, as articles already did. - **Sign-in required on forms, in every language.** A form set to require sign-in now requires it in each of its translations. --- # Stock, markets, shipping and EU VAT **Published**: 2026-11-25 **Category**: 2026 **Released:** October 27, 2026 This release gives your store what it needs to sell physical goods: stock, markets, shipping and VAT. ## New - **Stock tracking.** Track stock for each variant. Stock is taken when a buyer checks out and put back when an order is cancelled. - **Markets.** Group the countries you sell to into markets, then show or hide each product per market. - **Shipping options.** Create shipping options with labels in each language. Buyers choose a delivery address and a shipping method in the cart. - **EU VAT.** The VAT rates of all 27 EU countries are built in. Prices are shown both excluding and including VAT, and VAT appears in the cart and on orders. --- # One platform, every language **Published**: 2026-11-25 **Category**: 2026 **Released:** October 16, 2026 This release makes every part of a Lynkow site translatable, from URLs and products to emails. ## New - **Clean URLs in your default language.** Pages in your default language no longer carry a language prefix. Old prefixed URLs redirect to the new ones. - **Translatable commerce.** Translate products, variants, product categories, collections, offerings and calendars. When a translation is missing, the default language is shown. - **Buyer emails in 24 languages.** Buyers receive their emails in their language, and you can override the wording of each email in each language. - **A translator role.** Give translators a role limited to some languages. A list shows what is missing or needs review. --- # New signup, guided site creation, and app.lynkow.com **Published**: 2026-11-25 **Category**: 2026 **Released:** September 17, 2026 This release rebuilds how you create a site and moves the dashboard to its own address. ## New - **Three-step site creation.** Name your site and its domain, pick the countries you serve on a globe, then choose a plan. You see whether a domain is already taken as you type, and each plan shows its real monthly and yearly price, with a free trial. - **app.lynkow.com.** The dashboard now lives at app.lynkow.com. The old address redirects there. ## For developers - **SDK 1.59.** The preview helpers now allow embedding from app.lynkow.com by default. Update the SDK so the preview keeps working in the dashboard, or pass `cmsOrigin` yourself. --- # Reservation emails **Published**: 2026-11-25 **Category**: 2026 **Released:** September 8, 2026 This release adds the emails that keep buyers and merchants informed about reservations. ## New - **Buyer emails.** Buyers receive an email when their reservation is booked, rescheduled or cancelled, in their own language. - **New reservation alert.** Merchants can turn on a notification to be told when a new reservation is confirmed. --- # Lynkow plans and the new docs site **Published**: 2026-11-25 **Category**: 2026 **Released:** September 1, 2026 This release introduces Lynkow subscription plans and moves the documentation to its own address. ## New - **Subscription plans.** Each site runs on a plan, starting with a free trial. Plans set quotas, such as storage, content and monthly form submissions, and which features are included. - **Usage in the dashboard.** The dashboard shows how much of each quota you use, and features outside your plan are marked as such. You get an email as you approach a limit. - **docs.lynkow.com.** The documentation moves to docs.lynkow.com. Links to the old address redirect to the new pages. --- # E-commerce: catalogue, customers, cart and offline checkout **Published**: 2026-11-25 **Category**: 2026 **Released:** July 22, 2026 Your site can now sell: build a catalogue, manage customers, and take orders through a cart and an offline checkout. ## New - **Product catalogue.** Create products with options, such as size or color, and generate their variants. Group products in collections and nested categories. - **Customers.** Keep a contact list of your customers in the dashboard and sort them into groups. Buyers can create a customer account on your site. - **Cart and offline checkout.** Buyers add products to a cart and place an order. You follow and update orders in the dashboard. ## For developers - **Commerce in the SDK.** The SDK covers customer accounts, the cart, checkout and orders, for guests and signed-in customers. --- # Home dashboards, a payer for each site, and create-lynkow-app **Published**: 2026-11-25 **Category**: 2026 **Released:** September 29, 2026 This release gives every member a home dashboard built for their role, lets someone else pay for a site, and adds a tool to start a new Lynkow site in one command. ## New - **Home dashboards by role.** Each member lands on a dashboard suited to their role, such as admin, editor, marketing or support. An admin can preview the dashboard of every role from a switcher. - **A payer for each site.** An agency can invite its client to pay for a site, on the plan the agency chose. The payer can be an existing member or someone invited by email, and they pick a monthly or yearly cycle. ## For developers - **create-lynkow-app.** `npx create-lynkow-app` creates a ready-to-run Next.js site connected to Lynkow. - **Hosted MCP server.** Web AI clients such as Perplexity, Grok, Le Chat, Cursor on the web and Gemini Enterprise can now connect. --- # Lynkow search and plugins **Published**: 2026-11-25 **Category**: 2026 **Released:** April 10, 2026 Every site can now turn on Lynkow search, and plugins arrive with a CDN cache purge plugin. ## New - **Lynkow search.** Turn on full-text search for your site in the SEO settings. Each site has its own index. - **Plugins.** Plugins extend your site from the dashboard. The first one is a CDN cache purge plugin, which purges your CDN cache when your content changes. - **External sitemaps.** Add external sitemaps to your sitemap index, next to the sitemap of your own content. ## For developers - **Search through the API.** Query your site's search through `/v1`, the storefront API and the MCP tools. --- # Visual editor, structured content, nested categories **Published**: 2026-11-25 **Category**: 2026 **Released:** March 27, 2026 This release lets you edit pages on a live preview of your site and give each category its own content fields. ## New - **Visual editor.** Edit your site blocks on a live preview of your site. Click a text to edit it in place, or open a drawer for lists and grouped fields. - **Structured content.** Switch a category to structured mode and define its custom fields. Content in that category is written in those fields in place of the rich-text body. - **Nested categories.** Nest categories several levels deep. When a slug changes or a category is deleted, Lynkow creates redirects from the old URLs. ## For developers - **Visual editor in the SDK.** Mark editable zones in your templates with `data-lynkow-block` and `data-lynkow-field`. The SDK connects them to the visual editor. --- # Commerce SEO on par with the blog **Published**: 2026-11-25 **Category**: 2026 **Released:** October 1, 2026 This release gives your products, collections and categories the same search engine tools as your articles. ## New - **An SEO panel for commerce.** Products, collections and categories get the same SEO panel as articles, plus structured data (JSON-LD) built for commerce. - **Public URLs for commerce.** Products, product categories and collections have public URLs and appear in your sitemap. Moving one leaves a redirect behind. - **Product ratings.** Link a review to a product. Its ratings then appear in the product's structured data. - **Commerce in llms.txt and search.** Your commerce pages appear in llms.txt and, if you turn it on, in Lynkow search. --- # Analytics, redesigned **Published**: 2026-11-25 **Category**: 2026 **Released:** March 8, 2026 Analytics in the dashboard is rebuilt around sessions, period comparison and filters. ## New - **Sessions.** Browse visitor sessions with their device, location, duration and entry page. Open a session to see its events in order on a timeline. - **Period comparison.** Compare a period with the previous one or with the same period a year earlier. Each block shows a trend, and the chart draws both periods. - **Filters.** Filter analytics by referrer, page, country, device, browser, operating system or traffic source. Filters stay applied as you switch tabs. - **Weekly activity heatmap.** See when visitors come to your site, by day of the week and hour of the day. --- # Responsive images, llms.txt and 200 languages **Published**: 2026-11-25 **Category**: 2026 **Released:** February 20, 2026 This release makes images lighter and sharper on every screen, helps AI assistants find your content, and opens your site to about 200 languages. ## New - **Responsive images.** Images in your content are served at several sizes with a `srcset`, so each visitor downloads the size their screen needs. - **llms.txt.** Your site publishes an `llms.txt` and an `llms-full.txt` file, with a Markdown version of each article and page, so AI assistants can read and cite your content. - **About 200 languages.** Write content in about 200 languages instead of 5. - **Revision history.** A Revisions tab in the content editor lists previous versions. Restore any of them in one click. --- # JSON-LD cascade, search profiles, authors **Published**: 2026-11-25 **Category**: 2026 **Released:** April 28, 2026 This release gives you control over the structured data of every page and over how search behaves on your site. ## New - **JSON-LD cascade.** Declare structured data once for the site, then add to it or override it per category, page and content. Each level has its own editor in the dashboard. - **Automatic review ratings.** The reviews preset adds your approved reviews to the structured data. The LocalBusiness, Organization and Product presets can compute the average rating and the review count from approved reviews. - **Search profiles.** Configure the search index of each site: indexed fields, synonyms, stop words and typo tolerance. Each search profile then sets its own scope, sorting, facets and featured content. - **Authors.** Set a default author in the blog settings and override it on each article. The author appears in the article's structured data. --- # Multilingual content, IndexNow and Google sign-in **Published**: 2026-11-25 **Category**: 2026 **Released:** January 9, 2026 This release lets you publish your site in several languages and tells search engines about your changes as soon as you make them. ## New - **Multilingual content.** Turn on several languages for your site, then switch between translations from tabs in the editor. Copy a content, category, tag or variable to another language to start its translation. - **Automatic language redirects.** When you turn multiple languages on or off, Lynkow creates the 301 redirects between the old and new URLs. - **IndexNow.** Search engines that support IndexNow are notified when you publish, update or delete content. - **Sign in with Google.** Create an account or sign in with your Google account. --- # Get a review by slug or ID **Published**: 2026-11-13 **Category**: Forms & Reviews ## `GET /reviews/:slugOrId` **Get a review by slug or ID** Fetches one approved review by slug or id. A pending, rejected or unknown review returns 404. The site's review settings decide which author fields are shown. `productId` is null unless the linked product is published. Without `locale`, a multi-language site serves its default-locale review. With `locale`, the review is served through the locale chain. On a multi-language site, `fallback=false` serves the requested locale only and returns 404 when it holds no match. A `fallback` that is not a boolean returns 422. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `slugOrId` | path | string | Yes | Review slug or UUID identifier | | `locale` | query | string | No | Optional language to serve the review in. Any value is accepted: a locale with no matching review is served through the locale chain (`isFallback` true) unless `fallback=false`. Omission serves the site's default locale on a multi-language site. | | `fallback` | query | boolean (default true) | No | Whether a missing translation may be served from another locale. On the storefront it defaults to true: an item with no translation in the requested locale is served through the locale chain (the requested locale, its base language, the site default locale, then a locale the item exists in) and flagged by isFallback. false keeps the requested locale only: on a multi-language site a list drops the other items and a single-item read with none is a 404, unless the operation serves default values. On the /v1 search endpoints it defaults to false. A value that is not a boolean is a 422 | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: public, max-age=0, s-maxage=60`. Rate-limit > bucket: general. Returns 404 with the standard error envelope when no > matching approved review exists. ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/reviews/excellent-service?locale=fr" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/reviews/excellent-service?locale=fr`) const { data: review } = await res.json() ``` ### Response Example ```json { "data": { "id": "01J9R5Z3KE7Q1XB4T6F8H2D9P0", "slug": "excellent-service", "authorName": "Anna Cooper", "rating": 5, "title": "Outstanding support.", "content": "The team replied within an hour and the fix shipped the next day.", "productName": "Pro plan", "productId": "prod_01j9zq7m4k2x8v3n6p5r0t1w2w", "isFeatured": true, "reviewDate": "2026-04-22T00:00:00.000Z", "createdAt": "2026-04-22T11:14:30.000Z", "authorCity": "Lyon" } } ``` --- --- # Get a published product **Published**: 2026-11-13 **Category**: Commerce ## `GET /products/:idOrSlug` **Get a published product** Returns one published product by its `prod_` id or its slug. An unknown or unpublished product returns 404. With `locale`, the slug can be the product's translated slug. The product is served in the first language of its chain that it is written in: the requested locale, its base language, the site's default locale, then the product's own language. With `fallback=false`, a product not written in the requested locale returns 404. A product hidden in the requested or served language returns 404. With `market` (a `mkt_` id), a product hidden in that market returns 404. An unknown market filters nothing. Prices include VAT where it applies, at the rate of `country`, else of the merchant's country. A bookable product is priced at the merchant country's rate. `structuredData.graph` is the page's JSON-LD graph, ready for an `application/ld+json` script. > **Note:** This endpoint requires the e-commerce feature to be enabled on your site. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `idOrSlug` | path | string | Yes | Product identifier (prod_ prefixed id) or product slug. Only a product published on the site resolves | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | Whether a missing translation may be served from another locale. On the storefront it defaults to true: an item with no translation in the requested locale is served through the locale chain (the requested locale, its base language, the site default locale, then a locale the item exists in) and flagged by isFallback. false keeps the requested locale only: on a multi-language site a list drops the other items and a single-item read with none is a 404, unless the operation serves default values. On the /v1 search endpoints it defaults to false. A value that is not a boolean is a 422 | | `market` | query | string | No | Market identifier (mkt_ prefixed id): a product hidden in that market returns 404. An unknown, inactive or malformed value is ignored | | `country` | query | string | No | The buyer's country (ISO 3166-1 alpha-2 code) whose VAT rate the prices are shown at. A value that cannot be used is ignored and the merchant's country applies | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Missing or invalid storefront publishable key | | `402` | The site subscription does not currently permit this operation | | `403` | The storefront key origin is not allowed | | `404` | Not found | | `422` | Validation error | --- --- # Search with a named profile **Published**: 2026-11-13 **Category**: Search ## `GET /search/:profileSlug` **Search with a named profile** Search the site using a named search profile. Same payload shape as `/search` but ranking, fields, and facets are scoped to the profile referenced by `:profileSlug`. Use `/search/profiles` to discover the available profiles. Every hit field, including `id` and `path`, can be omitted by indexing or display configuration. Nested category and tag names and slugs are optional too. With `market` (a `mkt_` id), the products hidden in that market are left out. `locale` and `fallback` follow the same storefront fallback contract as `/search`: `fallback` defaults to `true`, a missing translation is served through the locale chain, `fallback=false` keeps only the hits written in the requested locale, each hit carries `locale`, `requestedLocale` and `isFallback` when `locale` is sent, and the response sends `Content-Language` with the locales served. A `fallback` that is not a boolean returns 422. ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `profileSlug` | path | string | Yes | Slug of the named search profile | | `q` | query | string | No | Full-text search query string. Min 1 character | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default true) | No | Whether a missing translation may be served from another locale. On the storefront it defaults to true: an item with no translation in the requested locale is served through the locale chain (the requested locale, its base language, the site default locale, then a locale the item exists in) and flagged by isFallback. false keeps the requested locale only: on a multi-language site a list drops the other items and a single-item read with none is a 404, unless the operation serves default values. On the /v1 search endpoints it defaults to false. A value that is not a boolean is a 422 | | `market` | query | string | No | Market identifier (mkt_ prefixed id): products hidden in that market are left out. An unknown, inactive or malformed value filters nothing | | `category` | query | string | No | | | `tag` | query | string | No | | | `page` | query | number (min 1, default 1) | No | | | `limit` | query | number (1 to 100) | No | | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `402` | The site subscription does not currently permit this operation | | `404` | Not found | | `422` | Validation error | > **Notes:** Cache: `Cache-Control: no-store, no-cache, must-revalidate, proxy-revalidate`. Search routes bypass the public cache layer > entirely, so nothing is edge-cached. Rate-limit bucket: general. ### Examples ```curl curl "https://api.lynkow.com/storefront/{siteId}/search/docs?q=consent" ``` ```javascript const res = await fetch(`https://api.lynkow.com/storefront/${siteId}/search/docs?q=consent`) const { data, meta } = await res.json() ``` ### Response Example ```json { "data": [ { "id": "01J9YPWQ3KTNB4F8C7H6D2R5XA", "title": "Cookie consent", "slug": "cookie-consent", "excerpt": "How to wire the cookie-consent widget in your app.", "locale": "en", "type": "content", "_formatted": { "title": "Cookie <mark>consent</mark>" } } ], "meta": { "total": 1, "page": 1, "totalPages": 1, "perPage": 20, "query": "consent", "processingTimeMs": 4, "profile": "docs", "facetDistribution": { "type": { "content": 1 } } } } ``` --- --- # Get session detail **Published**: 2026-11-13 **Category**: SEO & Analytics ## `GET /analytics/sessions/:sessionId` **Get session detail** Returns the full event timeline for a single session: pageviews, clicks, scroll events, and timing data. The requested session must fall within the plan's most-recent `sessionsVisible` window; an older session is returned as not found. Required permissions: `analytics.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `sessionId` | path | string | Yes | Analytics session ID | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Session not found or outside the plan's visible session window | > **Notes:** - `visits` lists the same visitor's sessions that remain inside the > current `sessionsVisible` window, each with its own `session`, `events`, > and `formSubmissions`. ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/sessions/7a2b9c1d-3e4f-5a6b-7c8d-9e0f1a2b3c4d" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "session": { "id": "7a2b9c1d-3e4f-5a6b-7c8d-9e0f1a2b3c4d", "visitorId": "3f9a1c2e", "entryPage": "/", "exitPage": "/pricing", "pageCount": 4, "durationSeconds": 186, "deviceType": "desktop", "browser": "Chrome", "os": "Windows", "countryCode": "FR", "city": "Paris", "trafficSource": "organic", "referrerDomain": "search.example.com", "isBounce": false, "isNewVisitor": true, "startedAt": "2026-05-30T14:22:10.000Z", "endedAt": "2026-05-30T14:25:16.000Z", "visitCount": 2 }, "events": [ { "eventType": "pageview", "pagePath": "/", "pageTitle": "Home", "eventTime": "2026-05-30T14:22:10.000Z", "scrollDepth": 65, "timeOnPage": 48000, "isEntry": true, "isExit": false, "clickElement": null, "clickText": null, "clickUrl": null }, { "eventType": "click", "pagePath": "/", "pageTitle": "Home", "eventTime": "2026-05-30T14:22:58.000Z", "scrollDepth": null, "timeOnPage": null, "isEntry": false, "isExit": false, "clickElement": "a", "clickText": "Pricing", "clickUrl": "https://example.com/pricing" } ], "formSubmissions": [ { "id": "c4d5e6f7-1a2b-3c4d-5e6f-7a8b9c0d1e2f", "formName": "Contact", "formSlug": "contact", "status": "pending", "createdAt": "2026-05-30T14:24:40.000Z" } ], "visits": [ { "session": { "id": "7a2b9c1d-3e4f-5a6b-7c8d-9e0f1a2b3c4d", "visitorId": "3f9a1c2e", "entryPage": "/", "exitPage": "/pricing", "pageCount": 4, "durationSeconds": 186, "deviceType": "desktop", "browser": "Chrome", "os": "Windows", "countryCode": "FR", "city": "Paris", "trafficSource": "organic", "referrerDomain": "search.example.com", "isBounce": false, "isNewVisitor": true, "startedAt": "2026-05-30T14:22:10.000Z", "endedAt": "2026-05-30T14:25:16.000Z", "visitCount": 2 }, "events": [ { "eventType": "pageview", "pagePath": "/", "pageTitle": "Home", "eventTime": "2026-05-30T14:22:10.000Z", "scrollDepth": 65, "timeOnPage": 48000, "isEntry": true, "isExit": false, "clickElement": null, "clickText": null, "clickUrl": null } ], "formSubmissions": [ { "id": "c4d5e6f7-1a2b-3c4d-5e6f-7a8b9c0d1e2f", "formName": "Contact", "formSlug": "contact", "status": "pending", "createdAt": "2026-05-30T14:24:40.000Z" } ] } ] } } ``` --- --- # Get a submission **Published**: 2026-11-13 **Category**: Forms & Reviews ## `GET /forms/:id/submissions/:submissionId` **Get a submission** Returns a single form submission with all field values. Submissions store in `ipAddress` a salted, per-site hash of the submitter's IP address (a pseudonymous identifier), never the address itself. Required permissions: `forms.submissions.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | | `submissionId` | path | string | Yes | Form submission ID | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/forms/5b6d425e-8106-5407-aa92-307272afa8b1/submissions/0064fe2e-b119-5521-82d1-e82474245f10 \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "0064fe2e-b119-5521-82d1-e82474245f10", "formId": "5b6d425e-8106-5407-aa92-307272afa8b1", "locale": "fr", "status": "read", "data": { "name": "Sophie Bernard", "email": "sophie@example.com", "message": "I would like to know more about your enterprise plan." }, "ipAddress": "0107c54f24c07a582b85e239ce80d2266bcf8e58080b05aa382015d22ace933d", "userAgent": "Mozilla/5.0", "createdAt": "2025-04-05T16:30:00.000Z" } } ``` --- --- # Search a specific profile **Published**: 2026-11-13 **Category**: Core CMS ## `GET /search/:profileSlug` **Search a specific profile** Search using a named profile. The profile's scope, searchable subset, displayed subset, sort, facets and result limits are applied server-side. Boosted and featured content IDs (configured by the admin) are stitched in front of the baseline result set on page 1 with `_isBoosted`/`_isFeatured` flags. `locale` and `fallback` behave as on `/search`: `fallback` defaults to `false` on `/v1`, so `locale` keeps only the hits written in that locale unless `fallback=true` is passed; with `locale`, each hit carries `locale`, `requestedLocale` and `isFallback`, and the response sends `Content-Language`. With `market` (a `mkt_` id), the products hidden in that market are left out. Returns `404` if the profile does not exist, `403` on the public endpoint if the profile is private, `503` if search is not enabled for the site. Required permissions: `search.view`, `contents.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `profileSlug` | path | string | Yes | Slug of the named search profile | | `q` | query | string | No | Full-text search query string. Min 1 character | | `locale` | query | string | No | BCP 47 locale code (e.g. "en", "fr") | | `fallback` | query | boolean (default false) | No | Whether a missing translation may be served from another locale. On the storefront it defaults to true: an item with no translation in the requested locale is served through the locale chain (the requested locale, its base language, the site default locale, then a locale the item exists in) and flagged by isFallback. false keeps the requested locale only: on a multi-language site a list drops the other items and a single-item read with none is a 404, unless the operation serves default values. On the /v1 search endpoints it defaults to false. A value that is not a boolean is a 422 | | `market` | query | string | No | Market identifier (mkt_ prefixed id): products hidden in that market are left out. An unknown, inactive or malformed value filters nothing | | `category` | query | string | No | | | `tag` | query | string | No | | | `page` | query | number (min 1, default 1) | No | | | `limit` | query | number (1 to 100) | No | | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `402` | The site subscription does not currently permit this operation | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl "https://api.lynkow.com/v1/search/api-docs?q=pagination&limit=5" \ -H "Authorization: Bearer $API_TOKEN" \ -H "X-Site-Id: $SITE_ID" ``` ### Response Example ```json { "data": [ { "id": "abc-123", "title": "Paginating list responses", "slug": "paginating-list-responses", "path": "/docs/api/pagination", "categories": [ { "slug": "api-reference", "name": "API Reference" } ], "_isFeatured": true } ], "meta": { "total": 4, "page": 1, "totalPages": 1, "perPage": 5, "query": "pagination", "processingTimeMs": 3, "profile": "api-docs" } } ``` --- --- # WhatsApp Messaging **Published**: 2026-10-29 **Category**: Integrations > Connect your own WhatsApp Business account to Lynkow, then send template messages to your customers and track their delivery — without writing any code. ## Why This App? WhatsApp is where many customers actually read messages. The WhatsApp App lets you send order updates, appointment reminders and other notifications from your Lynkow dashboard, and see whether each one was delivered and read. You bring your own WhatsApp Business account. Lynkow never resells messaging: you keep full ownership of your account, your phone number and your billing relationship with Meta. ## Prerequisites Before you start, you need: - A **Facebook account** (a personal one is fine — it is only used to administer the app) - A **Meta Business portfolio**. If you already run a Facebook Page or Instagram account for your business, you almost certainly have one already, and you should reuse it. - A **phone with WhatsApp installed**, to receive your first test message - **Admin access** to your Lynkow site - Roughly **20 minutes** You do **not** need a dedicated phone number to get started. Meta gives you a free test number that can message up to 5 verified recipients — enough to complete this entire guide. Getting a real number is covered at the end. ## What You Are Collecting The whole Meta side of this guide exists to produce four values, which you will paste into Lynkow: | Value | Where it comes from | | --- | --- | | WhatsApp Business Account ID (WABA ID) | Meta app → WhatsApp use case → Step 1 | | Phone Number ID | Same screen | | Permanent access token | Business settings → System users | | App Secret | Meta app → App settings → Basic | Keep them in a password manager as you go. Two of them are secrets. --- # Part 1 — The Meta side ## Step 1 — Create the Meta app 1. Go to [developers.facebook.com](https://developers.facebook.com) and log in with your Facebook account 2. Open **My Apps** → **Create App** 3. **App details** — give it a recognisable name (for example `Acme WhatsApp`) and a contact email 4. **Use cases** — tick **only** the last card, *"Connect with customers on WhatsApp"* 5. **Business** — select your existing business portfolio. If it shows *"Business verification complete"*, you are in luck: you will skip the slowest step later. 6. **Requirements** — usually shows *"No requirements for this app's use cases"*. Nothing to do. 7. **Overview** — check the summary, then click **Create app** <!-- SCREENSHOT: the "Use cases" step with the WhatsApp card ticked and Facebook Login untouched --> ## Step 2 — Make WhatsApp appear After creation, the left sidebar shows **"Facebook Login for Business"** and **no WhatsApp entry at all**. This is confusing but expected — it does not mean you picked the wrong use case. Meta only reveals WhatsApp once the use case is customised. On the **Dashboard**, click the first row: **"Customise Connect with customers on WhatsApp"**. > Equivalent path if you prefer: sidebar → **Use cases** → the WhatsApp card → **Customise**. You land on a panel showing your business portfolio and a note that you will receive a WhatsApp test phone number. Click **Continue**. <!-- SCREENSHOT: the app dashboard right after creation, showing Facebook Login and no WhatsApp entry --> ## Step 3 — Get your test number, WABA ID and Phone Number ID You are now on the guided **Overview** screen. 1. Make sure the integration type is **"Integrate with the API"** (it is selected by default). Do not choose *"Become a partner"*. 2. Click **Step 1. Try it out** Meta has already provisioned a test WhatsApp Business account and a US test number. On this screen you will find, on the same line as the number: - **Phone Number ID** — copy it - **WhatsApp Business Account ID** — copy it > There is also an **Access token** field with a *Generate token* button. That token expires after 24 hours. **Do not use it in Lynkow.** You will create a permanent one in Step 5. 3. In the **Recipient** field, add your own phone number in international format. Meta sends a verification code over WhatsApp; enter it to confirm. 4. Leave the default template selected and click **Send message**. Check your phone — the message should arrive within seconds. This proves the Meta side works before Lynkow is involved at all. The **Test webhooks** table at the bottom of the page should also fill with a few `messages` rows. > If nothing arrives, send any WhatsApp message from your phone to the test number first to open a conversation window, then send again. **Stop here.** Do not click through to *Step 2. Production setup* yet — it asks for a real phone number and a payment method. You will come back to one part of it in Step 7. <!-- SCREENSHOT: the "Try it out" screen with Phone Number ID and WABA ID visible (values blurred) --> ## Step 4 — Copy the App Secret 1. In the left sidebar, open **App settings** → **Basic** 2. Find **App secret** on the right, click **Show** and re-enter your Facebook password 3. Copy it Lynkow uses this secret to verify that incoming webhooks genuinely come from Meta. ## Step 5 — Create a permanent access token The 24-hour token is useless for a real integration. You need a System user token that never expires. 1. Go to [business.facebook.com/settings](https://business.facebook.com/settings) and make sure the correct business portfolio is selected 2. **Users** → **System users** → **Add** 3. Name it `Lynkow API`, role **Admin**, then **Create system user** ### 5.1 — Assign the assets (do not skip this) This is the step most people miss, and the token silently fails afterwards. Click **Assign assets**, then do it **twice**: - Asset type **Apps** → select your app → enable **Full control: Manage app** → *Assign assets* - Asset type **WhatsApp accounts** → select your test account (usually named *"Test WhatsApp Business Account"*) → enable **Full control** → *Assign assets* > After the first assignment, the **Assign assets** button disappears from the page. It moves into the **…** menu next to *Revoke tokens*. ### 5.2 — Generate the token Click **Generate new token** and follow the four steps: 1. **App** — select your app 2. **Token expiration** — choose **Never** 3. **Permissions** — select `whatsapp_business_messaging` and `whatsapp_business_management` 4. **Done** — click **Copy** **Copy the token before closing the dialog.** Meta shows it exactly once. If you lose it, generate a new one and update Lynkow. <!-- SCREENSHOT: the token permissions step with both whatsapp_business_* permissions ticked --> --- # Part 2 — The Lynkow side ## Step 6 — Connect your account 1. In your Lynkow admin dashboard, open **Apps** → **WhatsApp** → **Account** 2. Paste the four values into the form: - **WhatsApp Business Account ID** - **Phone Number ID** - **Permanent token** - **App Secret** 3. Click **Connect** Lynkow makes a live test call to Meta before saving anything. If it succeeds, the page switches to a connected state with a **Verified** badge and your account's display name. Your token and App Secret are stored encrypted and shown masked from then on (`••••c276`). If it fails, jump to [Troubleshooting](#troubleshooting) — the error message tells you which of the four values is wrong. ## Step 7 — Point Meta's webhook at Lynkow The connected account page now shows two values under **Webhook configuration**: - **Callback URL** - **Verify token** Copy them into Meta: 1. Back in your Meta app, go to **Use cases** → **Customise** → **Step 2. Production setup** 2. Expand **Configure webhooks** 3. Paste the **Callback URL** and the **Verify token**, then click **Verify and save** 4. Expand **Configure webhooks** again and check the **Webhook fields** table: the **`messages`** field should already say **Subscribed**. Meta subscribes it by default — you normally have nothing to change here. Without this, messages will still send, but you will never see delivery or read receipts. > You may see a warning that unpublished apps only receive test webhooks. In practice, WhatsApp Cloud API delivery events do reach your endpoint while the app is still unpublished. You do not need to publish the app to complete this guide. <!-- SCREENSHOT: the "Configure webhooks" block inside Step 2, with callback URL and verify token filled --> ## Step 8 — Get a template WhatsApp does not let you send free-form text to someone who has not messaged you first. Every business-initiated message must use a **template** approved by Meta. Open **Apps** → **WhatsApp** → **Templates**. You have two options: **Import what you already have.** Click **Import from my account** to pull in every template already approved on your WhatsApp Business account. A brand-new test account comes with a few samples, including `hello_world`. **Write your own.** Click **New template** and fill in: - **Template name** — lowercase and underscores only, e.g. `appointment_reminder_v1` - **Category** — **Utility** for transactional messages (order updates, reminders); **Marketing** for promotional ones - **Language** - **Message body** — put variables in double braces, e.g. `{{customer_name}}` The template is saved as a **Draft** first. Click **Submit** to send it to Meta, and its status becomes **Pending**. Utility templates without variables are usually approved quickly; marketing templates take longer and are rejected more often. Some templates are imported but marked **Not sendable**, with the reason shown inline. Templates using carousels or image headers are not supported by Lynkow yet. ## Step 9 — Send your first message 1. Open **Apps** → **WhatsApp** → **Messages** and click **Compose** 2. Pick an **approved** template, fill in any variables 3. Enter recipients, one international-format number per line 4. Click **Send** The message appears in the log as **Queued**, then moves to **Sent** and **Delivered** as Meta reports back. Click any row to open its **delivery timeline** with timestamps for each event. If it stays **Queued** and never progresses, your webhook is not wired correctly — revisit Step 7. --- ## Going to production Everything above runs on Meta's free test number. To message real customers you need your own number, which means completing **Step 2. Production setup** in your Meta app: - **Register a WhatsApp phone number.** It must not be currently active on the WhatsApp consumer app or WhatsApp Business app. A landline works if it can receive a verification call. - **Add a payment method.** Meta bills you directly for business-initiated conversations; pricing depends on the message category and the recipient's country. - **Complete business verification** if your portfolio is not verified yet. Meta asks for documents proving your business exists, and review takes a few days. Nothing changes in Lynkow except the **Phone Number ID**: update it on the Account page using the reconnect flow, and keep the same WABA ID, token and App Secret. ## Troubleshooting ### There is no WhatsApp entry in my app's sidebar Expected right after creating the app. Meta shows *Facebook Login for Business* instead and only reveals WhatsApp once you customise the use case. Go to the app **Dashboard** and click *"Customise Connect with customers on WhatsApp"*. See Step 2. ### I cannot find the `business_management` permission Older guides ask for it. When your app only has the WhatsApp use case, Meta does not offer it in the token permission list, and Lynkow does not need it — `whatsapp_business_messaging` and `whatsapp_business_management` are enough. If you want it anyway, add it first under **Use cases** → **Other tools** → **Permissions and features**. ### "The Phone Number ID does not belong to the supplied WhatsApp Business Account" The two IDs come from different accounts. Copy both again from the same **Step 1. Try it out** screen — they are displayed side by side there. ### Connecting fails with an authentication error Usually one of: - The token was copied incomplete. It is long; make sure nothing was truncated. - You pasted the **24-hour token** from the *Try it out* screen instead of the System user token. - You skipped **assigning the assets** in Step 5.1. A token whose system user has no access to the WhatsApp account is valid but useless. - The App Secret belongs to a different app. ### My template was rejected Meta shows the reason on the template row. The frequent causes are promotional content submitted under the **Utility** category, placeholders at the very start or end of the body, and variables without example values. ### Messages send but never show as delivered The webhook is not reaching Lynkow. Check that the callback URL and verify token in Meta match the ones on your Account page exactly, that the *Configure webhooks* row shows a green tick, and that the `messages` field is subscribed. ### My recipient never receives anything While on the free test number, the recipient must be on the verified list, capped at 5 numbers. Add them in the **Recipient** field of the *Try it out* screen and confirm the code sent over WhatsApp. ## Security Your permanent token and App Secret are encrypted at rest and masked in the admin interface after saving. They are never returned in API responses or written to logs. The verify token shown on the Account page is only visible to users who can manage the account. If you suspect a token was exposed, revoke it in **Business settings** → **System users** → **Revoke tokens**, generate a new one, and paste it into the **Reconnect** section of the Account page. Your other three credentials stay unchanged. --- # Get notification settings **Published**: 2026-07-22 **Category**: Settings & Config ## `GET /settings/notifications` **Get notification settings** Returns email notification preferences for each event type. Required permissions: `notifications.settings.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/settings/notifications \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "formSubmission": true, "newReview": true, "reviewApproved": false, "contentPublished": false, "recipientEmails": [ "admin@example.com" ] } } ``` --- --- # Update notification settings **Published**: 2026-07-22 **Category**: Settings & Config ## `PUT /settings/notifications` **Update notification settings** Enables or disables email notifications per event type. Required permissions: `notifications.settings.update` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `403` | Forbidden, insufficient permissions | | `422` | Validation error | ### Response Example ```json { "data": { "formSubmission": true, "newReview": true, "reviewApproved": true, "contentPublished": false, "recipientEmails": [ "admin@example.com" ] } } ``` --- --- # Get available filter values **Published**: 2026-07-22 **Category**: SEO & Analytics ## `GET /analytics/filter-values` **Get available filter values** Returns the distinct values available for each filter dimension (browsers, operating systems, countries, etc.). Useful for building filter dropdowns in a UI. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/filter-values?dimension=browser&period=30d" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "values": [ { "value": "Chrome", "count": 5840 }, { "value": "Safari", "count": 2110 }, { "value": "Firefox", "count": 720 } ] } } ``` --- --- # Export analytics as CSV **Published**: 2026-07-22 **Category**: SEO & Analytics ## `GET /analytics/export` **Export analytics as CSV** Exports raw analytics data for the selected period and filters. Required permissions: `analytics.export` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `403` | Forbidden, insufficient permissions | > **Notes:** - This endpoint returns a CSV file (`Content-Type: text/csv`, > `Content-Disposition: attachment`), not a JSON body. The columns > depend on `type` (`overview`, `pages`, `referrers`, `countries`, > `cities`, `campaigns`; default `overview`). ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/export?type=pages&period=30d" \ -H "Authorization: Bearer $API_TOKEN" \ -o analytics-pages-30d.csv ``` ### Response Example ```json "Page Path,Page Title,Pageviews,Unique Visitors,Bounce Rate\n/,Home,5230,3890,41%\n/blog/getting-started,Getting Started Guide,1840,1502,55%\n" ``` --- --- # Get redirect click logs **Published**: 2026-07-22 **Category**: SEO & Analytics ## `GET /redirects/:id/logs` **Get redirect click logs** Returns the hit log for a redirect (timestamp, referrer, user agent). Required permissions: `redirects.view` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `403` | Forbidden, insufficient permissions | | `404` | Not found | ### Examples ```bash curl https://api.lynkow.com/v1/redirects/31668352-f217-5387-8965-672fd63dc5b5/logs \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "id": "1b9c7e40-5d3a-4f28-9a71-6c0e2d84b5f3", "redirectId": "31668352-f217-5387-8965-672fd63dc5b5", "referrer": "https://google.com/search?q=example", "userAgent": "Mozilla/5.0", "ipAddress": "203.0.113.42", "createdAt": "2025-04-05T18:22:00.000Z" }, { "id": "7a38caa8-8551-5428-b2d8-2dec8139686d", "redirectId": "31668352-f217-5387-8965-672fd63dc5b5", "referrer": null, "userAgent": "Mozilla/5.0", "ipAddress": "198.51.100.17", "createdAt": "2025-04-05T14:10:00.000Z" } ], "meta": { "total": 237, "perPage": 15, "currentPage": 1, "lastPage": 16 } } ``` --- --- # Get UTM campaign data **Published**: 2026-07-22 **Category**: SEO & Analytics ## `GET /analytics/campaigns` **Get UTM campaign data** Returns visitor and conversion data grouped by UTM parameters (source, medium, campaign, term, content). Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/campaigns?period=30d&limit=50" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": [ { "source": "newsletter", "medium": "email", "campaign": "spring-launch", "visitors": 820, "pageviews": 1240, "bounceRate": 34 }, { "source": "partner-site", "medium": "cpc", "campaign": "q2-promo", "visitors": 410, "pageviews": 690, "bounceRate": 48 }, { "source": "(none)", "medium": "(none)", "campaign": "summer-sale", "visitors": 150, "pageviews": 210, "bounceRate": 61 } ] } ``` --- --- # Toggle redirect active state **Published**: 2026-07-22 **Category**: SEO & Analytics ## `POST /redirects/:id/toggle` **Toggle redirect active state** Enables or disables a redirect without deleting it. Required permissions: `redirects.update` ### Parameters | Name | In | Type | Required | Description | | --- | --- | --- | --- | --- | | `id` | path | string | Yes | Unique identifier | ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `403` | Forbidden, insufficient permissions | | `404` | Not found | | `422` | Validation error | ### Examples ```bash curl -X POST https://api.lynkow.com/v1/redirects/a0c7c3f6-8e4c-5e8e-8100-ee32f3f111b6/toggle \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "id": "a0c7c3f6-8e4c-5e8e-8100-ee32f3f111b6", "sourcePath": "/old-blog", "targetUrl": "/blog", "statusCode": 301, "isRegex": false, "isActive": false, "preserveQueryString": true, "hitCount": 237, "lastHitAt": "2025-04-05T18:22:00.000Z", "createdAt": "2025-02-01T10:00:00.000Z", "updatedAt": "2025-04-06T12:00:00.000Z" } } ``` --- --- # Get time-series chart data **Published**: 2026-07-22 **Category**: SEO & Analytics ## `GET /analytics/chart` **Get time-series chart data** Returns time-series data for visualization (visitors, pageviews, sessions per day/hour). Granularity adjusts automatically based on the selected period. Required permissions: `analytics.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl "https://api.lynkow.com/v1/analytics/chart?period=30d&unit=day&compare=previous" \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "labels": [ "01/05", "02/05", "03/05" ], "pageviews": [ 1240, 1389, 1502 ], "visitors": [ 870, 951, 1003 ], "sessions": [ 990, 1078, 1140 ], "newVisitors": [ 612, 668, 701 ], "returningVisitors": [ 258, 283, 302 ], "compare": { "labels": [ "01/04", "02/04", "03/04" ], "pageviews": [ 1100, 1205, 1320 ], "visitors": [ 790, 860, 905 ], "sessions": [ 905, 980, 1030 ] } } } ``` --- --- # Get redirect statistics **Published**: 2026-07-22 **Category**: SEO & Analytics ## `GET /redirects/stats` **Get redirect statistics** Returns aggregate redirect stats (total redirects, total hits, most used). Required permissions: `redirects.view` ### Responses | Status | Description | | --- | --- | | `200` | Successful response | | `401` | Unauthorized, invalid or missing API token | | `403` | Forbidden, insufficient permissions | ### Examples ```bash curl https://api.lynkow.com/v1/redirects/stats \ -H "Authorization: Bearer $API_TOKEN" ``` ### Response Example ```json { "data": { "total": 42, "active": 38, "inactive": 4, "byStatusCode": { "301": 35, "302": 7 } } } ``` ---