# API

## Package docs status

This page is generated from public package documentation in `capell-4/packages` and the package manifest checked into the source repository.

| Field | Value |
| --- | --- |
| Composer package | `capell-app/api` |
| Package slug | `api` |
| Product group | Capell Publishing Pro |
| Tier | premium |
| Bundle | `publishing-pro` |
| Runtime contexts | `frontend` |
| Capell version | `^4.0` |
| Source repository | `capell-app/packages` |
| Source path | `packages/api` |
| Docs source | `packages/api/docs` |
| Manifest | [`capell.json`](https://github.com/capell-app/packages/edit/4.x/packages/api/capell.json) |

Capell API exposes published page content as JSON for public integrations such as terms pop-ups, headless fragments, and lightweight client-side content fetches.

## At A Glance

- Package: `capell-app/api`
- Namespace: `Capell\Api\`
- Surfaces: public HTTP JSON endpoints
- Service providers: `packages/api/src/Providers/ApiServiceProvider.php`
- Capell dependencies: `capell-app/core`, `capell-app/layout-builder`

## Why It Helps Your Capell Workflow

- Exposes published Capell page data as public JSON for headless fragments, popups, terms content, and lightweight integrations.
- Keeps API output scoped to published content so integrations do not need admin access or internal page models.
- Gives developers a stable public delivery surface while preserving the rule that authoring state never appears in public responses.

## Best Used With

- [Layout Builder](../layout-builder/README.md)
- [Frontend Authoring](../frontend-authoring/README.md)
- [HTML Cache](../html-cache/README.md)

## What It Adds

- Host-scoped JSON delivery for published pages.
- Optional layout payload inclusion for integrations that need structured page content.
- HTML sanitization rules for public API responses.

## Docs

- [docs index](README.md)
- [overview.md](overview.md)
- [page-api.md](page-api.md)
- [screenshots.json](screenshots.json)

Start with [Overview](overview.md) for package surfaces and screenshot coverage, then [Page API](page-api.md) for endpoint shape, host-scoped site resolution, fields, layout includes, and HTML sanitization rules.

Screenshots and response captures are generated from [docs/screenshots.json](screenshots.json) during package documentation runs.