JSON API
A built-in read-only HTTP API for fetching published content from any client — mobile apps, static site generators, or custom frontends.
Contensio ships a lightweight, read-only JSON API under /api/v1/. No API keys or authentication are required — all endpoints return only published content.
Endpoints
| Method | URL | Description |
|---|---|---|
GET |
/api/v1/content/{type} |
Paginated list of published entries |
GET |
/api/v1/content/{type}/{slug} |
Single entry by slug |
{type} is the content type name — page, post, or any custom type slug.
Listing entries
GET /api/v1/content/post?per_page=10&lang=en
Query parameters
| Parameter | Default | Description |
|---|---|---|
per_page |
20 |
Items per page. Maximum 100. |
lang |
site default | Language code to return translations for. |
Response
{
"data": [
{
"id": 42,
"status": "published",
"published_at": "2026-04-17T10:30:00+00:00",
"created_at": "2026-04-15T08:00:00+00:00",
"author": { "id": 1, "name": "Jane Smith" },
"title": "Getting started with Contensio",
"slug": "getting-started-with-contensio",
"excerpt": "A quick walkthrough of the install process.",
"meta_title": null,
"meta_description": null,
"featured_image": {
"url": "https://example.com/storage/uploads/2026/04/cover.jpg",
"thumbnail": "https://example.com/storage/uploads/2026/04/thumb_cover.webp",
"medium": "https://example.com/storage/uploads/2026/04/medium_cover.webp"
},
"terms": [
{ "id": 7, "name": "Laravel", "slug": "laravel" }
]
}
],
"meta": {
"current_page": 1,
"last_page": 5,
"per_page": 10,
"total": 48
}
}
featured_image is null when no image is set. Variant URLs (thumbnail, medium) fall back to the original url if the variant has not been generated yet.
Single entry
GET /api/v1/content/post/getting-started-with-contensio
Returns { "data": { ... } } with the same shape as a single item in the list response, or a 404 JSON response if the slug doesn't match a published entry of the given type.
Language selection
By default the API returns translations for the site's default language. Pass ?lang=fr (or any configured language code) to get a different language. If no translation exists for the requested language, the default language translation is returned.
Error responses
| Status | Body |
|---|---|
404 |
{ "error": "Content type not found." } |
404 |
{ "error": "Not found." } |
Notes
- The API returns published entries only. Draft and scheduled content is never exposed.
- Custom field values are not included in the default response. Use the Eloquent API inside your Laravel application if you need field values server-side.
- There is no write API — all content mutations go through the admin panel or direct Eloquent access.
- Route names:
contensio.api.content.index,contensio.api.content.show.