Skip to main content

Update a Hook

Update a Hook. PATCH /api/openapi/v1/hook-policies/{policyId}, scope admin.v1.hooks.manage.

  • Scope: admin.v1.hooks.manage
  • Permission: Manage Hooks (hooks)
  • Permission type: Manage
  • Endpoint: PATCH/api/openapi/v1/hook-policies/{policyId}

Authentication and request headers

Call with an application API key. This endpoint checks only the scope above; read, manage and execute permissions do not imply one another.
NameLocationTypeRequiredDescriptionExample
AuthorizationheaderstringYesApplication API key, passed as a Bearer token.Bearer qwk_***
X-Request-IdheaderstringNoOptional request tracing identifier; generated by the server if omitted.req-20260831-001

Request parameters

NameLocationTypeRequiredDescriptionExample
policyIdpathstring · uuidRequiredPolicy group ID"<uuid>"
configbodyanyRequiredRule configuration"<string>"
descriptionbodystringRequiredPolicy description"<string>"
enabledbodyboolean | nullRequiredEnabledfalse
event_namebodystringRequiredTrigger"SessionStart"
namebodystringRequiredPolicy name"<string>"
event_name supports these 12 stable event names: SessionStart, PreUserPromptSubmit, UserPromptSubmit, PreToolUse, PostToolUse, Stop, PreCompact, PostCompact, ConnectorAdded, ExpertSuiteAdded, SkillAdded, Notification. Names are case-sensitive. Each organization can configure at most one policy group per event; unknown events are rejected.

Request example

cURL

Responses

200 OK
NameTypeRequiredDescriptionExample
configanyYesRule configuration"<string>"
created_atstring · date-timeYesCreated at"2026-08-27T10:00:00Z"
descriptionstringYesPolicy description"<string>"
enabledbooleanYesEnabledfalse
event_namestringYesTrigger"<string>"
idstringYesPolicy group ID"<string>"
namestringYesPolicy name"<string>"
updated_atstring · date-timeYesUpdated at"2026-08-27T10:00:00Z"
Response example
default Flat business error
NameTypeRequiredDescriptionExample
codestringNoStable business error code"<string>"
detailstringYesHuman-readable error description"<string>"
detailsOpenapiErrorDetailsNoError details{"field":"<string>","reason":"<string>","suggestion":"<string>"}
details.fieldstringNoRequest field that failed validation"<string>"
details.reasonstringNoStable validation failure reason"<string>"
details.suggestionstringNoSuggested normalized value"<string>"
errorstringYesStable HTTP error type"<string>"
Response example