StatikAPI Documentation

Build APIs from your data — without backend complexity.

StatikAPI helps you combine external APIs with your own content, shape outputs, and publish reliable structured endpoints. These docs cover the open source foundation, with guidance for local CLI workflows, Cloudflare deployment, and hosted platform usage.

StatikAPI App

Use the hosted visual workflow when you want managed publishing, private APIs, and automation.

Open StatikAPI App

The open source CLI stays free and self-hostable. StatikAPI App adds hosted workflows, visual editing, automations, analytics, and private API access.

Last updated: May 2026

Catch-all Routes

Use [...name].js to capture multiple path segments.

Example:

text
src-api/docs/[...slug].js

This can become routes like:

  • /docs/guide
  • /docs/api/intro
  • /docs/reference/auth/login

Required paths()

Catch-all routes must export paths().

For catch-all routes:

  • paths() returns an array
  • each item is an array of strings

Example:

js
export async function paths() {
  return [['guide'], ['api', 'intro']];
}

That produces:

  • /docs/guide
  • /docs/api/intro

If a catch-all route does not export paths():

  • the route is skipped

Example

js
// src-api/docs/[...slug].js
export async function paths() {
  return [['guide'], ['api', 'intro']];
}

export async function data({ params }) {
  return {
    slug: params.slug,
    path: params.slug.join('/'),
    kind: params.slug.length > 1 ? 'section' : 'page',
  };
}

params for /docs/api/intro will be:

js
{
  slug: ['api', 'intro'];
}

Parent collection route with listIndex

Catch-all routes can also emit a parent collection route:

js
export const config = {
  listIndex: {
    enabled: true,
    pick: ['path'],
  },
};

export async function paths() {
  return [['guide'], ['api', 'intro']];
}

export async function data({ params }) {
  return {
    path: params.slug.join('/'),
    title: params.slug.join(' / '),
  };
}

This produces:

  • /docs/guide
  • /docs/api/intro
  • /docs

And /docs contains only the picked path field for each item.


Path validation

Each segment returned by paths() must be a usable path segment.

Invalid segment shapes include:

  • empty strings
  • segments containing /
  • non-string values

If paths() returns invalid segments, the build should fail with a route/path validation error.

Get started

Ready to publish your first API?

Start locally with the CLI or use StatikAPI Cloud when you want managed publishing and automation.

Get Started View examples