Skip to main content
POST
Create a new runtime hook

Body

application/json
name
string
required

Hook name

action
string

Action: inject_context, send_session_event, append_history, comment_task

agent
string

Agent scope value

async
boolean

Run hook action asynchronously

barrier
string

Delivery barrier for prompt actions

cooldown
string

Cooldown (e.g. 5s, 1m)

dedupeKey
string

Optional dedupe template

disabled
boolean

Create hook disabled

event
string

Event: SessionStart, PreToolUse, PostToolUse, CwdChanged, FileChanged, Stop

matcher
string

Optional matcher (tool name, path, session, etc)

message
string

Action message/body template

role
string

append_history role: user or assistant

scope
string

Scope: global, agent, session, workspace, task

session
string

Session scope value

targetSession
string

Target session for action payload

targetTask
string

Target task for comment_task payload

task
string

Task scope value

workspace
string

Workspace scope value

Response

Success — no @Returns schema declared; payload shape is loose.

The response is of type object.