Meridian Hooks API
The Hooks API from Meridian, for hooks.
The Hooks API from Meridian, for hooks.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/usemeridian-us:usemeridian-us-hooks-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Meridian Hooks API
description: Multi-session Claude coordinator MCP server.
version: 0.1.0
tags:
- name: Hooks
paths:
/hooks/diagnostics:
get:
summary: Get Hooks Diagnostics
description: '34f76536 — live hook-configuration diagnostics for the active repo.
Surfaces ``hook_paths.diagnose_configured_hooks`` as a real endpoint
instead of logic that only tests ever exercised. Classifies every hook
command configured in the active repo''s
``.claude/settings.json`` as ``ok`` / a genuine missing REQUIRED project
hook (``$CLAUDE_PROJECT_DIR``-scoped, must exist in this repo) / an
OPTIONAL global hook that is legitimately absent until the user runs
the ``hooks.ps1``/``hooks.sh`` installer on this machine / unresolvable.
A missing OPTIONAL hook is never treated as a problem here -- only
``missing_required_count`` signals a genuine, actionable misconfiguration.
Never raises: an absent or unreadable settings.json yields
``settings_found: false`` with an empty ``hooks`` list rather than a
404/500, since a diagnostics endpoint must never itself become a source
of failure for a session that polls it during orientation.
55d48d69 -- ``guard`` reports the Meridian guard: whether it is
registered, whether every registered shim''s runtime resolves, the
effective mode (``off`` / ``advisory`` / ``enforce``, from
``MERIDIAN_GUARD`` and the owner''s sentinel files) and the disabled
rules. ``status`` folds that into one word: ``not_installed``, ``off``,
``runtime_missing``, ``advisory`` or ``enforce``. The guard fails open
when its runtime is missing, so this is where a broken install shows up.
Mode and runtime are computed from THIS server process''s environment,
which can differ from the Claude Code session that runs the hooks.'
operationId: get_hooks_diagnostics_hooks_diagnostics_get
responses:
'200':
description: Successful Response
content:
application/json:
schema:
additionalProperties: true
type: object
title: Response Get Hooks Diagnostics Hooks Diagnostics Get
tags:
- Hooks
/hooks/session-start:
post:
summary: Hooks Session Start
description: 'Claude Code / Codex SessionStart hook.
Accepts {project_id, session_name?}. Calls start_session() and returns
{hookSpecificOutput: {additionalContext: "..."}} so Claude Code injects
the project context into the agent''s initial context window automatically.
Hosted callers can authenticate with Authorization: Bearer sk_meridian_...
to route directly to their tenant DB. Local/browser-session behavior is
unchanged when no Bearer token is supplied.'
operationId: hooks_session_start_hooks_session_start_post
requestBody:
content:
application/json:
schema:
additionalProperties: true
type: object
title: Body
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
additionalProperties: true
type: object
title: Response Hooks Session Start Hooks Session Start Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Hooks
/hooks/stop:
post:
summary: Hooks Stop
description: 'Claude Code / Codex Stop hook.
Accepts {project_id?, session_id?, cwd?, hostname?}. Fires auto_capture +
a delta handoff so a delta is produced even when the executor disconnects
without calling generate_handoff itself.
Best-effort / non-blocking: this never raises out and never returns 4xx/5xx
for a missing session — a missing/unresolvable session yields
``{"ok": true, "handoff": null, "reason": "no session"}`` and any
generate_handoff failure yields ``{"ok": true, "handoff": null, "error": ...}``
(both 200). The agent does not wait for this before exiting.
Resolution: an explicit ``session_id`` is preferred; otherwise the
most-recent active session for the project (resolved from ``project_id`` or,
failing that, the ``cwd``/``hostname`` the same way the SessionStart hook
routes) is handed off.
Hosted callers can authenticate with Authorization: Bearer sk_meridian_...
to route directly to their tenant DB. Local/browser-session behavior is
unchanged when no Bearer token is supplied.
b4f4627f — two guards layered on top of the existing best-effort contract:
* ``stop_hook_active`` (Claude Code sets this true when the CURRENT Stop
event was itself caused by a PREVIOUS Stop hook''s exit-2 block) short-
circuits immediately, before any DB/background work — the same
infinite-retrigger guard already baked into every rendered Stop-hook
script (sprint_guard.{sh,ps1}, and now every custom Stop hook — see
``handoff._render_custom_hook_files``), applied at this route''s own
entry point too, in case a caller ever forwards the real hook payload
here (the shipped hooks.sh/.ps1 STOP_CMD is a fixed curl call that
never does today, but this route accepts arbitrary POST bodies and
must not assume that stays true forever).
* a same-session in-flight guard (``_STOP_HOOK_INFLIGHT``) skips a
SECOND concurrent call for a session already being processed rather
than racing two concurrent ``generate_handoff(mode="delta")`` calls
for the same ``session_id``.'
operationId: hooks_stop_hooks_stop_post
requestBody:
content:
application/json:
schema:
additionalProperties: true
type: object
title: Body
required: true
responses:
'200':
description: Successful Response
content:
application/json:
schema:
additionalProperties: true
type: object
title: Response Hooks Stop Hooks Stop Post
'422':
description: Validation Error
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPValidationError'
tags:
- Hooks
components:
schemas:
ValidationError:
properties:
loc:
items:
anyOf:
- type: string
- type: integer
type: array
title: Location
msg:
type: string
title: Message
type:
type: string
title: Error Type
input:
title: Input
ctx:
type: object
title: Context
type: object
required:
- loc
- msg
- type
title: ValidationError
HTTPValidationError:
properties:
detail:
items:
$ref: '#/components/schemas/ValidationError'
type: array
title: Detail
type: object
title: HTTPValidationError