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

# Webhook Types

> Types for webhook registrations, payloads, and delivery logs.

```typescript theme={null}
import type {
  WebhookEventName,
  WebhookRegistration,
  WebhookRegistrationPublic,
  WebhookPayload,
  WebhookUser,
} from '@collab-kit/utils';
```

## WebhookEventName

Union of all webhook event types.

```typescript theme={null}
type WebhookEventName =
  | 'participant.joined'
  | 'participant.left'
  | 'session.started'
  | 'session.closed'
  | 'user.created'
  | 'user.updated'
  | 'user.deleted';
```

## WebhookRegistration

A webhook registration including the signing secret. Only returned at creation time.

```typescript theme={null}
interface WebhookRegistration {
  id: string;
  organization_id: string;
  url: string;
  secret: string;
  events: WebhookEventName[];
  room_id: string | null;
  enabled: boolean;
  created_at: string;
  updated_at: string;
}
```

## WebhookRegistrationPublic

A webhook registration without the secret. Returned by list, get, and update endpoints.

```typescript theme={null}
type WebhookRegistrationPublic = Omit<WebhookRegistration, 'secret'>;
```

## WebhookUser

A user object with the `token` field stripped. Used in webhook payloads.

```typescript theme={null}
type WebhookUser = Omit<CollabKitUser, 'token'>;
```

## WebhookPayload

Union of all webhook payload types. Every payload includes `id`, `event`, and `timestamp` fields.

```typescript theme={null}
type WebhookPayload =
  | ParticipantJoinedPayload    // { event, room: CollabKitRoom, user: WebhookUser }
  | ParticipantLeftPayload      // { event, room: CollabKitRoom, user: WebhookUser }
  | SessionStartedPayload       // { event, room: CollabKitRoom }
  | SessionClosedPayload        // { event, room: CollabKitRoom, users: WebhookUser[] }
  | UserCreatedPayload          // { event, room: CollabKitRoom, user: WebhookUser }
  | UserUpdatedPayload          // { event, room: CollabKitRoom, user: WebhookUser }
  | UserDeletedPayload;         // { event, room: CollabKitRoom, user: WebhookUser }
```

## WebhookDelivery

A webhook delivery log entry. This type is defined on the server and not exported from `@collab-kit/utils`.

```typescript theme={null}
interface WebhookDelivery {
  id: string;
  webhook_id: string;
  event: string;
  payload: string;              // JSON-serialized webhook payload
  status: 'pending' | 'success' | 'failed';
  attempts: number;
  last_attempt_at: string | null;
  next_retry_at: string | null;
  status_code: number | null;
  created_at: string;
}
```
