TryGhost / add-admin-api-endpoint
Install for your project team
Run this command in your project directory to install the skill for your entire team:
mkdir -p .claude/skills/add-admin-api-endpoint && curl -L -o skill.zip "https://fastmcp.me/Skills/Download/2599" && unzip -o skill.zip -d .claude/skills/add-admin-api-endpoint && rm skill.zip
Project Skills
This skill will be saved in .claude/skills/add-admin-api-endpoint/ and checked into git. All team members will have access to it automatically.
Important: Please verify the skill by reviewing its instructions before using it.
Add a new endpoint or endpoints to Ghost's Admin API at `ghost/api/admin/**`.
0 views
0 installs
Skill Content
---
name: Add Admin API Endpoint
description: Add a new endpoint or endpoints to Ghost's Admin API at `ghost/api/admin/**`.
---
# Create Admin API Endpoint
## Instructions
1. If creating an endpoint for an entirely new resource, create a new endpoint file in `ghost/core/core/server/api/endpoints/`. Otherwise, locate the existing endpoint file in the same directory.
2. The endpoint file should create a controller object using the JSDoc type from (@tryghost/api-framework).Controller, including at minimum a `docName` and a single endpoint definition, i.e. `browse`.
3. Add routes for each endpoint to `ghost/core/core/server/web/api/endpoints/admin/routes.js`.
4. Add basic `e2e-api` tests for the endpoint in `ghost/core/test/e2e-api/admin` to ensure the new endpoints function as expected.
5. Run the tests and iterate until they pass: `cd ghost/core && yarn test:single test/e2e-api/admin/{test-file-name}`.
## Reference
For a detailed reference on Ghost's API framework and how to create API controllers, see [reference.md](reference.md).