HookConfigHttp
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| ClaudeCodeBaseModel clawd_code_sdk.models.base Base model for all Claude Code Pydantic models. |
⋔ Inheritance diagram¶
graph TD
2938572470["settings.HookConfigHttp"]
2604142835["base.ClaudeCodeBaseModel"]
3879467795["main.BaseModel"]
2751680898["builtins.object"]
2604142835 --> 2938572470
3879467795 --> 2604142835
2751680898 --> 3879467795
🛈 DocStrings¶
Bases: ClaudeCodeBaseModel
HTTP webhook hook. POST JSON to a URL and receive JSON response. See https://code.claude.com/docs/en/hooks#http-hook-fields.
Source code in src/clawd_code_sdk/models/settings.py
allowed_env_vars
class-attribute
instance-attribute
¶
List of environment variable names permitted for interpolation in headers. If not set, no env var interpolation is allowed.
headers
class-attribute
instance-attribute
¶
Custom HTTP headers (e.g., Authorization: Bearer token). Values support $VAR_NAME or ${VAR_NAME} interpolation.
if_
class-attribute
instance-attribute
¶
Optional permission-rule-syntax filter. Evaluated only on tool-related events (PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, PermissionDenied); on other events a hook with if set never runs. See https://code.claude.com/docs/en/hooks-guide#filter-hooks-with-matchers
on_failure
class-attribute
instance-attribute
¶
Whether the action that triggered the hook goes ahead when the hook fails: the connection fails, the response status isn't 2xx, it times out, or the response body is invalid. "block" does what exit code 2 does on that event, and denies the request on PermissionRequest. No effect on Stop, SubagentStop, TaskCompleted, and TeammateIdle hooks. Requires Claude Code v2.1.295 or later. See https://code.claude.com/docs/en/hooks#block-the-action-when-a-hook-fails
status_message
class-attribute
instance-attribute
¶
Custom spinner message displayed while the hook runs
timeout
class-attribute
instance-attribute
¶
Optional timeout in seconds (default: 600; lowered to 30 on UserPromptSubmit and 10 on MessageDisplay)
url
class-attribute
instance-attribute
¶
URL to POST hook input JSON to. Endpoint must accept POST requests and return JSON.