Skip to main content
POST
Typescript (SDK)

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
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
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.

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