---
title: "Claude Code hook event from a Fi sandbox"
method: POST
path: "/v4/fi/hook"
tags: ["v4", "Fi", "__public__"]
---

# Claude Code hook event from a Fi sandbox

`POST /v4/fi/hook`

## Headers

- `authorization` string, nullable

## Request body

- FiHookEvent — Superset of fields across the hook events we consume. Claude Code may include additional fields; ignore them.
  - `hook_event_name` 'UserPromptSubmit' | 'PreToolUse' | 'PostToolUse' | 'Stop', required
  - `session_id` string, required
  - `transcript_path` string, required
  - `cwd` string, nullable
  - `permission_mode` string, nullable
  - `prompt` string, nullable
  - `tool_name` string, nullable
  - `tool_input` object, nullable
  - `tool_response` unknown
  - `tool_use_id` string, nullable
  - `stop_hook_active` boolean, nullable
  - `last_assistant_message` string, nullable — Final assistant text emitted in the turn (present on Stop).

## Response `200`

Success

- SuccessResponseFiHookResponse
  - `success` true, required — Flag for it request was successful
  - `data` FiHookResponse, required — Response body returned to Claude Code after handling a hook event.
    - `ok` boolean, required
    - `panels_written` integer
    - `note` string, nullable
  - `meta` ResponseMeta
    - `requestId` string — Unique request identifier for tracing
    - `timestamp` string, date-time — Response timestamp (UTC)
    - `durationMs` integer, nullable — Request processing time in milliseconds

## Other responses

- `401` — Auth Invalid Token
- `403` — Forbidden Insufficient Permissions
- `422` — Validation Failed
- `426` — Business Quota Exceeded
- `500` — Internal Error

---

[API](https://skmtc.dev/definite/apis/defapi.md) · [All operations](https://skmtc.dev/definite/apis/defapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/definite/defapi/revisions/3943d8deb3be/schema)
