mcpField
A
Add Admin API Endpoint

Add Admin API Endpoint

github.com/tryghostDevelopment55.6k89 installsUpdated today
Repository

About Add Admin API Endpoint

A Ghost development skill for adding Admin API endpoints. It guides contributors through controller and route changes and the required end-to-end API tests.

Key features

  1. 01Create or update endpoint files
  2. 02Define API controller and browse endpoint
  3. 03Register Admin API routes
  4. 04Add and run e2e-api tests

Use cases

  1. 01Adding an endpoint for a new Ghost resource
  2. 02Extending an existing Admin API endpoint

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/tryghost/ghost --skill add-admin-api-endpoint

After installing, type/add-admin-api-endpointin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

permissions.md
reference.md
validation.md

Details

From the project README

Create Admin API Endpoint

Instructions

  1. If creating an endpoint for an entirely new resource, create a new endpoint file in ghost/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/server/web/api/endpoints/admin/routes.js.
  4. Add basic e2e-api tests for the endpoint in ghost/test/e2e-api/admin to ensure the new endpoints function as expected.
  5. Run the tests and iterate until they pass: cd ghost && pnpm 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.

Comments

Markdown supported