NexoFlow
Docs · Content API REST reference

Technical SEOContent API · v1

Content API reference

The REST endpoints your site calls to read what NexoFlow publishes for it. On JavaScript or TypeScript, the nexoflow-sdk package wraps the posts and site settings with types and retries; everything else, and any other language, is plain HTTP.

Overview

The Content API is for one website reading its own content: published posts, site settings, the structured data for a page, the site's llms.txt and its post images. Every call is authenticated with that site's key and runs from your server, never the browser.

terminal
curl "https://nexoflow.net/api/v1/content/posts?limit=5&sort=newest" \
  -H "Authorization: Bearer $NEXOFLOW_API_KEY"

Authentication

Send your site key as a Bearer token. Keys start with pk_live_. A missing, malformed or replaced key gets a 401.

header
Authorization: Bearer pk_live_••••••••••••••••••••••••••••••••

Never in a URL, never in a browser

Keys sent as ?key= are refused, because URLs end up in logs and page source. The API also doesn't answer browsers calling from other sites. Keep the key in your hosting's NEXOFLOW_API_KEY and call the API from server code only.

Base URL

Every path below starts here.

base URL
https://nexoflow.net/api/v1

Endpoints

Paths are relative to the base URL. All of them take the same Bearer key, except images, which carry their own token.

  • GET /content/posts

    List published posts

    Query: page (default 1), limit (default 20, max 100), tag, category, sort (newest, the default, or oldest). Newest first by publish date. A scheduled post stays out until its publish date. The list leaves out each post's body; fetch the post for that.

  • GET /content/posts/{slug}

    One post with its body

    Query: format (html, the default, or markdown for the post's source) and styled=true to wrap the HTML in a styled container with its CSS. A slug that isn't published yet, or is scheduled for later, gets a 404.

  • GET /content/site-settings

    Permalinks and feature flags

    Returns { permalinkStructure, features }. permalinkStructure defaults to /%slug%; features holds four on/off flags (reading time, related posts, share buttons, schema markup), each on unless switched off.

  • GET /content/structured-data?path=/a/page

    The JSON-LD for one page

    Returns { jsonld, scriptTag }, where scriptTag is ready to print in the page's head. Returns { jsonld: null } when the page has no valid markup or schema markup is switched off. path is required (up to 2,048 characters); without it you get a 400.

  • GET /content/llms-txt

    Your site's llms.txt

    Plain text built from your business records, ready to serve at your own /llms.txt, with an ETag. A 404 with a plain sentence when there's nothing to serve: no live website on record yet, or schema markup switched off.

  • GET /content/images/{path}?token=img_…

    Post and author images

    You don't build these: every image URL in a post response already points here with its token. The token only reads this site's images, so it's safe in public HTML. It is not your site key.

  • POST /content/revalidate

    Note that content changed

    JSON body: slugs (optional; empty means everything) and type (default post). Returns { revalidated, slugs, type, projectId, timestamp } for your own cache code; it doesn't clear your site's cache itself.

  • POST /content/verify

    Confirm the connection

    Marks the site as connected and returns { ok, projectId, connectedAt }. Optional: any authenticated request does the same.

nf.posts.slugs() in the SDK isn't an endpoint of its own: it pages through /content/posts and returns the slugs.

Response shapes

Responses are JSON (llms.txt is plain text, images are the image). The exact fields and their TypeScript types ship with nexoflow-sdk; the ones you'll use most:

Post list

FieldWhat it holds
postsThe posts on this page: slug, title, excerpt, metaTitle, metaDescription, noIndex, noFollow, categories, tags, author, featuredImageUrl, dates, readingTimeMinutes and path.
paginationpage, limit, total, totalPages, hasMore
siteFeaturesThe same on/off flags as site settings, so one call is enough for an index page.
permalinkStructureFor example /%slug% or /%year%/%month%/%slug%. Each post already has a resolved path.

One post

Everything a list item has, plus:

FieldWhat it holds
contentThe body as HTML (or the source with format=markdown). In HTML, an FAQ section is included as a styled accordion.
contentStylesCSS for the body and its FAQ. Inject it on the page so the post is styled as intended.
focusKeywordThe post's main search phrase, or null. Single post only.
faqThe FAQ as { question, answer } items, for FAQPage JSON-LD. Empty when the post has none.
relatedArticlesResolved cards for the related posts chosen in the editor. Empty when related posts are switched off.
siteFeaturesThe site's on/off flags, so the post page needs no second call.

Image URLs (featuredImageUrl, images inside content) are absolute and ready for an img tag as they are. thingsToDoPages and relatedThingsToDo come from NexoFlow's earlier version; v2 doesn't make those pages, so they're empty unless your site had them before.

Caching

Each answer says how long a cache may keep it:

EndpointCache-Control
Posts and one postpublic, s-maxage=10, stale-while-revalidate=30
Site settingspublic, s-maxage=60, stale-while-revalidate=120
Structured data, llms.txtprivate, max-age=300
Imagespublic, max-age=31536000, immutable

On Next.js, the SDK adds its own revalidate hint (60 seconds unless you set another), so your pages refresh on that schedule.

Errors

Errors come back with an HTTP status and a JSON body with one error message, written to be read (llms.txt answers its 404 in plain text). The SDK turns them into a NexoFlowError.

response
HTTP/1.1 401 Unauthorized
{ "error": "Missing API key. Use header: Authorization: Bearer pk_live_…" }
  • 400: a required parameter is missing, such as path for structured data.
  • 401: the key is missing, doesn't start with pk_live_, isn't recognised, or was sent as ?key=.
  • 402: the business's plan has ended and so has the 30 days its posts stay up afterwards.
  • 404: no published post with that slug, nothing to serve (llms.txt), or the business was deleted.
  • 500: something failed on NexoFlow's side. The SDK retries these on its own.