Skip to main content
POST
Create

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Authorization
string
header
required

This API uses OAuth2 with the Client Credential flow. Client Credentials must be sent in the BODY, not the headers. For an example of how to implement this, refer to the c1TokenSource.Token() function.

Body

application/json

The HooksServiceCreateRequest message.

This message contains a oneof named hook_type. Only a single field of the following list may be set at a time:

  • function
  • builtinPattern
  • jsonPatch
displayName
string
required

The displayName field.

builtinPattern
Built In Pattern · object | null

BuiltInPattern references a ConductorOne-maintained DLP pattern. The specific pattern and its configuration are encoded as a oneof.

This message contains a oneof named config. Only a single field of the following list may be set at a time:

  • piiRedaction
  • creditCardBlocking
  • queryScopeLimit
  • writeAuthorization
  • sensitiveFileGuard
  • toolOutputSizeGuard
  • secretsMasking
  • linkFilter
  • encodedContentGuard
  • promptInjectionScan
  • blockOutput
  • blockToolCall
  • preToolBlock
description
string

The description field.

enabled
boolean

The enabled field.

event
enum<string>

The event field.

Available options:
HOOK_EVENT_TYPE_UNSPECIFIED,
HOOK_EVENT_TYPE_PRE_TOOL_USE,
HOOK_EVENT_TYPE_POST_TOOL_USE,
HOOK_EVENT_TYPE_PRE_OUTPUT
filter
Hook Filter · object | null

HookFilter determines which calls (or, for HOOK_EVENT_TYPE_PRE_OUTPUT, which outgoing response chunks) a hook applies to.

function
Hook Function Ref · object | null

HookFunctionRef identifies a customer-authored function to invoke.

jsonPatch
Json Patch Config · object | null

JSONPatchConfig adds, overwrites, or removes fields on a tool call's JSON input, with no function invocation. Only valid on HOOK_EVENT_TYPE_PRE_TOOL_USE. cel_expression is evaluated against ctx/input/caller and must produce a map; static_overlay is a fixed map. Either result is shallow-merged onto the input under RFC 7396 merge patch semantics: a key overwrites or adds that key, a null value removes it, and a nested object replaces rather than merging into the existing one.

This message contains a oneof named source. Only a single field of the following list may be set at a time:

  • celExpression
  • staticOverlay
managedByGuardrails
boolean

The managedByGuardrails field.

priority
integer<int32>

The priority field.

Response

200 - application/json

Successful response

The HooksServiceCreateResponse message.

hook
Hook · object | null

Hook represents a customer-configured interception point for tool calls.

This message contains a oneof named hook_type. Only a single field of the following list may be set at a time:

  • function
  • builtinPattern
  • jsonPatch