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

# Userlist webhooks

> Userlist incoming webhooks in Corsair: the event paths to subscribe to, the payload each event carries, and the response data.

The Userlist plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](https://docs.corsair.dev/plugins/userlist/overview.md) for setup context and the exact URL shape).

> [!NOTE]
>
> **New to Corsair?** See [webhooks](https://docs.corsair.dev/concepts/webhooks.md) and [hooks](https://docs.corsair.dev/concepts/hooks.md).

## Webhook map

* `companyCreated` (`companyCreated`)
* `companyUpdated` (`companyUpdated`)
* `formSubmitted` (`formSubmitted`)
* `messageBounced` (`messageBounced`)
* `messageClicked` (`messageClicked`)
* `messageEnqueued` (`messageEnqueued`)
* `messageOpened` (`messageOpened`)
* `messageReported` (`messageReported`)
* `relationshipCreated` (`relationshipCreated`)
* `relationshipUpdated` (`relationshipUpdated`)
* `userCreated` (`userCreated`)
* `userSubscribed` (`userSubscribed`)
* `userUnsubscribed` (`userUnsubscribed`)
* `userUpdated` (`userUpdated`)

## HTTP handler setup

```ts app/api/webhook/route.ts theme={null}
import { processWebhook } from "corsair";
import { corsair } from "@/server/corsair";

export async function POST(request: Request) {
    const headers = Object.fromEntries(request.headers);
    const body = await request.json();
    const result = await processWebhook(corsair, headers, body);
    return result.response;
}
```

## Events

## Company Created

### Company Created

`companyCreated`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        companyCreated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## Company Updated

### Company Updated

`companyUpdated`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        companyUpdated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## Form Submitted

### Form Submitted

`formSubmitted`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        formSubmitted: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## Message Bounced

### Message Bounced

`messageBounced`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        messageBounced: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## Message Clicked

### Message Clicked

`messageClicked`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        messageClicked: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## Message Enqueued

### Message Enqueued

`messageEnqueued`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        messageEnqueued: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## Message Opened

### Message Opened

`messageOpened`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        messageOpened: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## Message Reported

### Message Reported

`messageReported`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        messageReported: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## Relationship Created

### Relationship Created

`relationshipCreated`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        relationshipCreated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## Relationship Updated

### Relationship Updated

`relationshipUpdated`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        relationshipUpdated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## User Created

### User Created

`userCreated`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        userCreated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## User Subscribed

### User Subscribed

`userSubscribed`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        userSubscribed: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## User Unsubscribed

### User Unsubscribed

`userUnsubscribed`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        userUnsubscribed: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***

## User Updated

### User Updated

`userUpdated`

**Payload:** `unknown`

**`webhookHooks` example**

```ts theme={null}
userlist({
    webhookHooks: {
        userUpdated: {
            before(ctx, args) {
                return { ctx, args };
            },
            after(ctx, response) {
            },
        },
    },
})
```

***


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