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

paths()

paths() tells StatikAPI which concrete routes to emit for a dynamic or catch-all file.

It is used by:

  • dynamic routes like users/[id].js
  • catch-all routes like docs/[...slug].js

Dynamic route example

js
// src-api/users/[id].js
export async function paths() {
  return ['1', '2', '3'];
}

Each string becomes one emitted route:

  • /users/1
  • /users/2
  • /users/3

Catch-all route example

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

Each string array becomes one emitted route:

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

Rules

Dynamic routes

paths() must return:

  • an array of strings

Catch-all routes

paths() must return:

  • an array of string arrays

General validation

Returned path segments must be valid route segments:

  • no empty strings
  • no / inside a segment
  • no non-string values

If paths() returns invalid data, the build fails with an explicit error.


Missing paths()

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

  • that route is skipped
  • the whole build does not fail only because paths() is missing

This is useful during gradual development, but for a real route you usually want paths() in place.


Interaction with listIndex

If the same route also uses:

js
export const config = { listIndex: true };

then:

  • paths() controls the concrete emitted routes
  • listIndex controls whether a parent collection route is also emitted from those results

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