Skip to content

WebhooksResource

API reference for the Webhooks resource.

Methods

list

List all webhooks.

typescript
async list(): Promise<Webhook[]>

get

Get a specific webhook.

typescript
async get(id: string): Promise<Webhook>

create

Create a new webhook.

typescript
async create(data: CreateWebhookInput): Promise<Webhook>

Parameters:

typescript
interface CreateWebhookInput {
  url: string;
  events: string[];
  secret?: string;
}

update

Update a webhook.

typescript
async update(id: string, data: UpdateWebhookInput): Promise<Webhook>

Parameters:

typescript
interface UpdateWebhookInput extends Partial<CreateWebhookInput> {
  active?: boolean;
}

delete

Delete a webhook.

typescript
async delete(id: string): Promise<void>

test

Test a webhook.

typescript
async test(id: string): Promise<{ success: boolean; statusCode?: number; error?: string }>

Types

Webhook

typescript
interface Webhook {
  id: string;
  type: 'webhook';
  url: string;
  events: string[];
  active: boolean;
  secret?: string;
  createdAt: Date;
  updatedAt: Date;
}

WebhookEventType

typescript
type WebhookEventType = 
  | 'risk.created' | 'risk.updated' | 'risk.deleted' | 'risk.reviewed'
  | 'asset.created' | 'asset.updated' | 'asset.deleted' | 'asset.reviewed'
  | 'task.created' | 'task.assigned' | 'task.completed' | 'task.overdue'
  | 'document.created' | 'document.updated' | 'document.expired'
  | 'user.created' | 'user.updated' | 'user.deactivated'
  | 'compliance.status_changed'
  | 'audit.completed';

Released under the MIT License.