Documentation sections

API

Content API for React, Next.js, and custom sites

The Content API is a server-side pull path for approved items, so non-WordPress sites and apps can use the same delivery-ready work in their own release flow.

Updated
2026-04-19
Availability
Paid plans, token per project

Pull approved items from your server

Use the list endpoint to sync multiple items or the detail endpoint for one item. Every request uses the project token, and your application should cache responses server-side.

GET /api/v1/projects/:projectId/content

Returns approved or published content items that can move into your own publishing process.

Headers

  • Authorization: Bearer <token>

Query

  • state=approved|published, default approved
  • operation=create|update|all, default all
  • per_page=number, default 20, max 50

Responses

  • 200 data + meta
  • 401 INVALID_TOKEN
  • 403 PROJECT_NOT_ENTITLED
  • 429 RATE_LIMITED

Next.js App Router, React, SvelteKit, and Astro

Keep the integration server-side: a Next.js App Router route handler, a SvelteKit server load, an Astro endpoint, or a backend used by your React app.

ts
const response = await fetch(`${NELAVIO_API_BASE}/api/v1/projects/${projectId}/content`, {
  headers: {
    Authorization: `Bearer ${NELAVIO_CONTENT_API_TOKEN}`,
  },
});

const payload = await response.json();
  • Next.js App Router: fetch from a route handler or server component.
  • SvelteKit: use server load or a local endpoint.
  • Astro: fetch in an endpoint or during the static build.
  • Plain React: add a backend instead of fetching with the token in browser code.

Static build and custom CMS workflows

A static build can pull JSON during CI, while a custom CMS can sync approved titles, descriptions, content blocks, and metadata into its own database before publishing.

GitHub Action for static sites

Astro, SvelteKit, Next.js export, and React/Vite repos can run a workflow daily or manually. Pull approved content into src/content/blog and review it through a pull request.

yaml
name: Pull Nelavio content

on:
  workflow_dispatch:
  schedule:
    - cron: "17 5 * * *"

jobs:
  sync:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      pull-requests: write
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with:
          node-version: 20
      - run: node scripts/pull-nelavio-content.mjs
        env:
          NELAVIO_API_BASE: https://app.nelavio.com
          NELAVIO_PROJECT_ID: ${{ secrets.NELAVIO_PROJECT_ID }}
          NELAVIO_CONTENT_API_TOKEN: ${{ secrets.NELAVIO_CONTENT_API_TOKEN }}
          NELAVIO_CONTENT_DIR: src/content/blog
      - run: |
          git diff --quiet && exit 0
          git switch -c nelavio/content-sync
          git add src/content/blog
          git commit -m "Sync Nelavio content"
          gh pr create --fill --title "Sync Nelavio content"
        env:
          GH_TOKEN: ${{ github.token }}

Set up the Content API pull

Generate a token in project delivery settings and wire approved Nelavio output into your own publishing process.

Run My First Free Scan