canonical: https://jentic.com/apis/getcockpit.com/cockpit

# Getcockpit Cockpit CMS Content API

Jentic publishes the only available OpenAPI specification for Cockpit CMS Content API, keeping it validated and agent-ready. Cockpit is a self-hosted, headless CMS that exposes content stored as collections, singletons, and asset records over a JSON API. The Content API covers reading and writing content items, batching across multiple models, fetching nested tree structures, and retrieving asset binaries plus image thumbnails across 9 endpoints. It is most often used by static site generators and front-end frameworks that pull content at build time or render time from a self-hosted Cockpit instance.

## For AI agents

Read and write headless CMS content items across collections and singletons, query nested trees, and retrieve assets and image thumbnails from a self-hosted Cockpit instance. Authenticated via the api-key header.

## Scope

Does not handle user authentication, role management, or admin UI configuration - use for content item read/write and asset retrieval against a self-hosted Cockpit instance only.

## Capabilities

- Read a single content item from a Cockpit collection or singleton by model name
- Create or update content items in a model with MongoDB-style field updates
- List items across a model with filtering, sorting, and pagination for build-time fetches
- Batch-fetch content from multiple models in a single request to reduce round trips
- Retrieve nested tree-structured content for navigation menus and hierarchical pages
- Fetch asset binaries and on-the-fly image thumbnails for media-heavy front ends

## Use cases

### Static Site Generator Build Fetch

Static site generators like Astro, Eleventy, or Hugo pull content from a CMS at build time and render it to HTML. The Cockpit Content API supports listing items with filters and fetching individual items by ID, so a build script can request only the published content it needs and assemble pages without an interactive admin UI in the loop.

Example prompt: Call `GET `/content/items/{model}`` with a published filter to list items, then `GET `/content/item/{model}/{id}`` for any item that needs full nested data.

### Editor-to-Live Content Push

Editorial workflows often need an external tool - a Slack approval bot, a translation service, or a scheduling job - to write back to the CMS once content is approved or translated. The Cockpit Content API's create/update endpoint accepts the model name and item payload, so external systems can publish or update items without using the Cockpit admin UI.

Example prompt: On approval, call `POST `/content/item/{model}`` with the approved item payload to create or update the corresponding entry.

### Navigation Tree Rendering

Marketing sites with multi-level navigation often store hierarchy in a tree-structured collection so editors can drag-and-drop sections. The Cockpit Content API exposes a tree endpoint that returns nested children in a single call, which is significantly cheaper than recursive flat queries and lets the front end render menus directly.

Example prompt: Call `GET `/content/tree/{model}`` for the navigation model and pass the returned tree to the front-end menu component.

### Agent-Driven Content Lookup

An AI agent helping an editor or support engineer can answer 'show me the latest published article about X' by calling the Cockpit list-items endpoint through Jentic, applying a search filter, and returning the matching items. The agent never holds the api-key directly; Jentic injects it on each call.

Example prompt: Given a user query, call `GET `/content/items/{model}`` with the appropriate filter and return the top matching items to the user.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/content/item/{model}/{id}` | Get a content item by ID |
| POST | `/content/item/{model}` | Create or update a content item |
| GET | `/content/items/{model}` | List content items with filters |
| GET | `/content/items` | Batch-fetch content from multiple models |
| GET | `/content/tree/{model}` | Get a nested tree of content items |
| GET | `/assets/{id}` | Get an asset by ID |
| GET | `/assets/image/{id}` | Get an asset image thumbnail |

## Key resources

- **Content** — Content items in collections and singletons; supports get, create/update, delete, list, batch, and tree.
- **Assets** — Asset binary retrieval and image thumbnail generation.

## Why Jentic

- **Setup:** Wiring Cockpit CMS by hand means setting its api-key header, resolving the host of your self-hosted instance, and mapping each model and item id into the content paths yourself. Through Jentic you install once, import the Cockpit CMS Content API from the API Directory, store the key once, and your agent calls it.
- **Permission scoping:** Cockpit puts the model in the URL path (`/content/items/{model}`), so a rule can pin your agent to one content model: it reads and writes items for that model and leaves the rest untouched. You choose the operations it may call, so item creation is not included unless you add it.
- **Credential handling:** Your Cockpit api-key is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list content items from a Cockpit model' or 'fetch a nested content tree', and Jentic returns the matching Cockpit operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Contentful** — Hosted headless CMS with structured content modelling and a managed delivery API.
- **Sanity** — Hosted structured content backend with a real-time GROQ query language.
- **Storyblok** — Hosted headless CMS with a visual editor and component-based content modelling.
- **Ghost** — Publishing platform often paired with a headless CMS to handle newsletters and member-only posts.

## FAQ

### Why is there no official OpenAPI spec for Cockpit CMS Content API?

Cockpit does not publish an OpenAPI specification. Jentic generates and maintains this spec so that AI agents and developers can call Cockpit CMS Content API via structured tooling. It is validated against the live API and kept up to date. Get started with Jentic One, the self-hosted execution layer.

### What authentication does the Cockpit CMS Content API use?

The API uses an API key passed in the `api-key` header. Through Jentic, the key is stored encrypted in the vault and injected at execution time so agents never see the raw value.

### Can I create or update a content item with the Cockpit API?

Yes. Call `POST `/content/item/{model}`` with the model name and item payload. Cockpit accepts MongoDB-style updates for partial changes.

### Can I fetch a nested navigation tree from Cockpit?

Yes. Call `GET `/content/tree/{model}`` to retrieve a model's hierarchical structure in a single call, ideal for rendering site navigation.

### How do I batch-fetch content from multiple models through Jentic?

Search Jentic for `batch fetch content from Cockpit`, load the schema for `GET `/content/items``, and execute with the model list. Jentic injects the `api-key` header from the vault.

### Does the Cockpit Content API serve images directly?

Yes - `GET `/assets/image/{id}`` returns an on-the-fly thumbnail and `GET `/assets/{id}`` returns the full asset record. Use the thumbnail endpoint to avoid serving full-size images for previews.

### Can I limit what my agent is allowed to do with the Cockpit CMS Content API?

Yes. Because you run Jentic One yourself, your own rules decide which Cockpit operations and credentials the agent can use. Since Cockpit puts the content model in the URL path, such as `/content/items/{model}`, a rule can pin the agent to a single model so it reads and lists items there and leaves other models untouched. You also choose the exact operations it may call, so write actions like POST `/content/item/{model}` stay off unless you add them, keeping the api-key scoped to only what you approve.
