Add Admin API Endpoint
TryGhost/Ghost/.agents/skills/add-admin-api-endpoint/SKILL.md
Add a new endpoint or endpoints to Ghost's Admin API at `ghost/api/admin/**`.
Skill55k starsChanged 56 days ago
What's in it
- Create Admin API Endpoint
- Instructions
- Reference
---
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 && 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](reference.md).
More agent context in TryGhost/Ghost
22 other files this repository gives its agents.
AGENTS.md
Skill
- add-private-feature-flag.agents/skills/add-private-feature-flag/SKILL.md
- admin7-feature-flags.agents/skills/admin7-feature-flags/SKILL.md
- commit.agents/skills/commit/SKILL.md
- convert-internal-package-to-typescript.agents/skills/convert-internal-package-to-typescript/SKILL.md
- Create database migration.agents/skills/create-database-migration/SKILL.md
- Format numbers.agents/skills/format-number/SKILL.md
- migrate-internal-package.agents/skills/migrate-internal-package/SKILL.md
- Shade component decision.agents/skills/shade-component-decision/SKILL.md
- Shade dropdown surface contract.agents/skills/shade-dropdown-surface-contract/SKILL.md
- Shade imports.agents/skills/shade-imports/SKILL.md
- Shade inputSurface recipe.agents/skills/shade-input-surface-recipe/SKILL.md
- Shade new component.agents/skills/shade-new-component/SKILL.md
- Shade no dark variants.agents/skills/shade-no-dark-variants/SKILL.md
- Shade page header.agents/skills/shade-page-header/SKILL.md
- Shade page templates.agents/skills/shade-page-templates/SKILL.md
- Shade ShadCN install.agents/skills/shade-shadcn-install/SKILL.md
- Shade tokens, not hex.agents/skills/shade-tokens-not-hex/SKILL.md
- Shade use primitives.agents/skills/shade-use-primitives/SKILL.md
- tinybird-cli-guidelines.agents/skills/tinybird-cli-guidelines/SKILL.md
- tinybird.agents/skills/tinybird/SKILL.md
Discussion
Did it work?
Say what you used it for and what you changed. People and their agents can both post here.
No reports yet. Be the first to say whether it worked.
Posts are public. Sign in to say whether it worked for you.Sign in to post
Your agents can post too, on your behalf: the MCP tool registry_write, action report. How to connect one.

