> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentium.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Webhooks

> Public webhooks signatures and configuration in @agentium/core 4.0.0.

Import these **9 exports** from `@agentium/core`. Read the [webhooks guide](/webhooks/overview) for setup and behavior, or return to the [package reference](/api-reference/core).

A `?` marks an optional field. These are declarations for lookup; run the examples in the linked guide. Follow related-type links for Agentium types and source links for imported dependency types.

## emailWebhook

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/webhooks/destinations/email.ts)

```typescript theme={null}
export declare function emailWebhook(config: EmailWebhookConfig): WebhookDestination;
```

Related: [`EmailWebhookConfig`](/api-reference/core/webhooks#emailwebhookconfig), [`WebhookDestination`](/api-reference/core/webhooks#webhookdestination).

## EmailWebhookConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/webhooks/destinations/email.ts)

```typescript theme={null}
export interface EmailWebhookConfig {
    transport: "sendgrid";
    apiKey: string;
    to: string[];
    from: string;
    subject?: string | ((event: string) => string);
}
```

## httpWebhook

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/webhooks/destinations/http.ts)

```typescript theme={null}
export declare function httpWebhook(config: HttpWebhookConfig): WebhookDestination;
```

Related: [`HttpWebhookConfig`](/api-reference/core/webhooks#httpwebhookconfig), [`WebhookDestination`](/api-reference/core/webhooks#webhookdestination).

## HttpWebhookConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/webhooks/destinations/http.ts)

```typescript theme={null}
export interface HttpWebhookConfig {
    url: string;
    headers?: Record<string, string>;
    method?: "POST" | "PUT";
    secret?: string;
}
```

## slackWebhook

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/webhooks/destinations/slack.ts)

```typescript theme={null}
export declare function slackWebhook(config: SlackWebhookConfig): WebhookDestination;
```

Related: [`SlackWebhookConfig`](/api-reference/core/webhooks#slackwebhookconfig), [`WebhookDestination`](/api-reference/core/webhooks#webhookdestination).

## SlackWebhookConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/webhooks/destinations/slack.ts)

```typescript theme={null}
export interface SlackWebhookConfig {
    webhookUrl: string;
    channel?: string;
    formatMessage?: (event: string, payload: unknown) => string;
}
```

## WebhookConfig

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/webhooks/types.ts)

```typescript theme={null}
export interface WebhookConfig {
    destinations: WebhookDestination[];
    events?: string[];
    batchInterval?: number;
    retries?: number;
    onError?: "log" | "throw";
}
```

Related: [`WebhookDestination`](/api-reference/core/webhooks#webhookdestination).

## WebhookDestination

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/webhooks/types.ts)

```typescript theme={null}
export interface WebhookDestination {
    name: string;
    send(event: string, payload: unknown): Promise<void>;
}
```

## WebhookManager

[Source](https://github.com/agentiumOS/agentium/blob/v4.0.0/packages/core/src/webhooks/webhook-manager.ts)

```typescript theme={null}
export declare class WebhookManager {
    constructor(config: WebhookConfig);
    attach(eventBus: EventBus): void;
    detach(eventBus: EventBus): void;
    flush(): Promise<void>;
}
```

Related: [`EventBus`](/api-reference/core/events#eventbus), [`WebhookConfig`](/api-reference/core/webhooks#webhookconfig).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.