Skip to main content

create

client.hooks.create(data: CreateHookRequest): Promise<Hook>

Creates a new hook.

Registers a hook that will fire when the specified event occurs. The hook is enabled by default upon creation.

Parameters

ParameterTypeRequiredDescription
dataCreateHookRequestYesHook creation payload including event type and action

Returns

Promise<Hook> — A promise that resolves to the newly created

Example

import { CodeBoltClient } from '@codebolt/clientsdk';

const client = new CodeBoltClient();

const result = await client.hooks.create(/* CreateHookRequest */);
console.log(result);