API
Package docs status
Section titled “Package docs status”This page is generated from package source documentation in the Capell packages repository and the checked-in manifest. Source documentation is not distribution status. Before running a Composer command, verify that the exact package and compatible 1.x release are available through public Packagist or the authenticated marketplace account.
| Field | Value |
|---|---|
| Composer package | capell-app/api |
| Package slug | api |
| Product group | Capell Publishing |
| Tier | premium |
| Bundle | publishing |
| Runtime contexts | frontend |
| Capell version | ^1.0 |
| Catalogue role | extension |
| Release channel | Labs |
| Source repository | capell-app/packages |
| Source path | packages/api |
| Docs source | packages/api/docs |
| Manifest | capell.json |
What This Plugin Adds
Section titled “What This Plugin Adds”API is an Available, No schema impact Capell package in the Capell Publishing product group. It ships as capell-app/api and extends these surfaces: frontend.
API adds versioned public JSON endpoints for resolving published Capell pages and bounded Layout Builder graphs.
The package adds no admin screen. Headless clients can resolve a published page and request its sanitized public layout payload through the documented API routes.
Evidence: capell.json, routes/api.php, src/Http/Controllers/ResolvePageController.php, docs/screenshots.json, tests/Feature/Http/ResolvePageControllerTest.php, tests/Feature/OpenApiDocumentationTest.php.
Status details:
- Status: Available
- Tier: premium
- Bundle: publishing
- Composer package:
capell-app/api - Namespace:
Capell\Api - Theme key: not applicable
Why It Matters
Section titled “Why It Matters”For developers: ResolveApiRequestContextAction, BuildPublicPagePayloadAction, and BuildPublicLayoutPayloadAction keep request resolution, sanitization, and layout bounds outside the controller.
For teams: A separate frontend can consume published Capell content without receiving draft, admin, or authoring state.
Evidence: src/Actions/ResolveApiRequestContextAction.php, src/Actions/BuildPublicPagePayloadAction.php, src/Actions/BuildPublicLayoutPayloadAction.php, tests/Feature/Actions/BuildPublicPagePayloadActionTest.php, docs/screenshots.json, tests/Feature/Http/ResolvePageControllerTest.php, tests/Feature/ApiErrorScreenshotProofTest.php.
Screens And Workflow
Section titled “Screens And Workflow”Screenshot contract: docs/screenshots.json.
- Successful page resolve JSON response (frontend, required).
- Page resolve layout graph JSON response (frontend, required).
- Page resolve forbidden JSON response (frontend, optional).
- Page resolve not found JSON response (frontend, optional).
Technical Shape
Section titled “Technical Shape”- Service providers:
Capell\Api\Providers\ApiServiceProvider. - Config files:
packages/api/config/capell-api.php. - Route files:
packages/api/routes/api.php. - Actions:
BuildPublicLayoutPayloadAction,BuildPublicPagePayloadAction,ResolveApiRequestContextAction,ValidatePublicLayoutPayloadBoundsAction. - Data objects:
PublicPagePayloadOptionsData,ResolveApiRequestContextData. - Manifest contributions:
health-check: Capell\Api\Health\ApiHealthCheck,route: Capell\Api\Manifest\ApiRoutesContribution. - Health checks:
Capell\Api\Health\ApiHealthCheck. - Cache tags:
api,api:pages.
Data Model
Section titled “Data Model”This package has no schema impact. It extends Capell through health-check contributions and route contributions instead of declaring package-owned tables.
Install Impact
Section titled “Install Impact”- Required packages:
capell-app/core,capell-app/layout-builder. - Admin navigation: no admin page or resource contribution is declared.
- Admin/editor extensions: none declared.
- Permissions: none declared in
capell.json. - Public routes: loads
routes/api.php; registersApiRoutesContribution. - Database changes: no package migrations declared.
- Config:
config/capell-api.php. - Settings: no package settings declared.
- Queues or schedules: none declared.
- Cache tags:
api,api:pages. - Commands: none declared.
Common Pitfalls
Section titled “Common Pitfalls”- Keep required Capell packages on compatible v4 releases:
capell-app/core,capell-app/layout-builder. - Review package configuration before production-like verification:
config/capell-api.php. - Review middleware, throttling, signatures, and public-output safety in
routes/api.phpbefore exposing routes. - Keep public Blade and cached HTML free of authoring markers, model IDs, permissions, signed editor URLs, and lazy database queries.
- Custom write integrations must preserve invalidation for
api,api:pagescache tags.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely cause | Check | Fix |
|---|---|---|---|
| Package surface is missing after install | Provider or manifest is not loaded | Confirm capell.json, package composer.json, and provider registration |
Reinstall the package, refresh Composer autoload, and clear host caches |
| Route returns unexpected output | Route cache, middleware, or signed URL setup does not match the package route file | Check the route files listed in Technical Shape |
Clear route cache and verify middleware before exposing public routes |
| Public output leaks unexpected state | Render data, cache variation, or authoring boundary has regressed | Check public Blade, cache tags, and public-output safety tests | Move data loading out of Blade and rerun the package public-output tests |
Quick Start
Section titled “Quick Start”- Install the package:
composer require capell-app/api. - Review
config/capell-api.phpbefore enabling the package. - Open the Successful page resolve JSON response and confirm the public output renders without admin state.
Next Steps
Section titled “Next Steps”- Package docs
- Overview
- Configuration files:
config/capell-api.php. - Troubleshooting
- Screenshot contract
- Marketplace assets
- Capell content language plan
- Capell documentation design system
- Capell and package ERD notes
- Related packages: Layout Builder.
- Focused tests:
vendor/bin/pest packages/api/tests --configuration=phpunit.xml.