Connect your website with the delivery API
Fetch published Stratafold content from any website or app: API keys, list and single-entry endpoints, previews, references and caching.
For developers. 7 minute read. Updated .
Stratafold is headless: it stores and serves your content, and your website decides how it looks. Any site or app that can make an HTTP request can use it, whether it is built with Next.js, Astro, a mobile app or a server-rendered site.
Create an API key
In the workspace, open Settings → API keys → Create key:
- Published content keys (
sf_live_…) only ever see what you have published. Use these on your live site. - Published and drafts keys (
sf_prev_…) can also read drafts for staging and preview environments.
The full key is shown once. Keep it on your server, in an environment variable, and never in browser code. A key belongs to one workspace, so it can only read that workspace’s content.
List entries
curl -H "Authorization: Bearer $STRATAFOLD_KEY" \
"https://api.stratafold.com/delivery/v1/content/blog_post?order=publishedAt:desc&pageSize=10"
| Parameter | What it does |
|---|---|
page, pageSize | Pagination; up to 100 entries per page |
order | publishedAt:desc (default), publishedAt:asc, title:asc, title:desc, updatedAt:desc |
slug | Filter to one slug |
include=1 | Return referenced entries inline, one level deep |
preview=true | Include drafts (preview keys only) |
Each item has id, contentType, slug, title, fields, seo, publishedAt, updatedAt and version. The response also includes page, pageSize, total and totalPages.
Get one entry
curl -H "Authorization: Bearer $STRATAFOLD_KEY" \
"https://api.stratafold.com/delivery/v1/content/blog_post/why-we-start-with-research"
Use the slug or the entry ID. Drafts and archived entries return 404 on live keys.
Example: a Next.js page
async function getPost(slug: string) {
const res = await fetch(
`https://api.stratafold.com/delivery/v1/content/blog_post/${slug}`,
{
headers: { Authorization: `Bearer ${process.env.STRATAFOLD_KEY}` },
next: { revalidate: 60 },
},
);
if (res.status === 404) return null;
if (!res.ok) throw new Error(`Stratafold responded ${res.status}`);
return res.json();
}
Rich text fields contain Markdown; render them with any Markdown library.
Discover your schemas
GET /delivery/v1/content-types lists every schema in the workspace with its fields, which is handy for generating types in your codebase.
Caching and browsers
Responses carry Cache-Control: private, max-age=30, because they depend on your key. Cache on your own server or with your framework’s revalidation. If you must call the API from a browser, add your site under Settings → General → Allowed browser origins so other sites can’t use your key.