Fetch content with the Delivery API
The delivery API is your fast read path. It is plain REST, authenticated with a bearer token, and returns content in the shape of your model. Here is everything you need to query it well.
The endpoint
List published entries for a project, newest first. Authenticate with any read token — the public read token is perfect for published content.
curl https://your-domain.com/api/v1/your-project/documents \ -H "Authorization: Bearer mjmt_your_public_read_token"
Filter, paginate and sort
- type — only entries of a content type, e.g. ?type=blog_post
- uid — a single entry by its slug, e.g. ?uid=hello-world
- lang — content for a locale, e.g. ?lang=fr-fr (defaults to your project default)
- per_page & page — page through results (per_page up to 100)
- sort — order by id, uid, created_at or updated_at; prefix with - for descending, e.g. ?sort=-updated_at
- depth — how deep references resolve, 1 to 3 (default 1)
Fetch with JavaScript
The same request from a front end — here listing blog posts and rendering their titles:
const res = await fetch(
'https://your-domain.com/api/v1/your-project/documents?type=blog_post&sort=-created_at',
{ headers: { Authorization: 'Bearer mjmt_your_public_read_token' } }
);
const { results } = await res.json();
for (const post of results) {
console.log(post.data.title, post.uid);
}
A single entry
curl https://your-domain.com/api/v1/your-project/documents/42 \ -H "Authorization: Bearer mjmt_your_public_read_token"
Responses are CDN-cacheable and carry an ETag, so repeat reads are fast and can be revalidated with a 304.
Use a preview token and ?ref=preview to render unpublished drafts on a staging site, while production only ever sees published content.
Download TypeScript types for your content model so your editor autocompletes fields and your build catches mismatches.