> ## 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.

# noCRM webhooks

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

The noCRM plugin handles incoming webhooks. Point your provider’s subscription URL at your Corsair HTTP handler (see [Overview](https://docs.corsair.dev/plugins/nocrm/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

* `account`
  * `defaultFieldCreated` (`account.defaultFieldCreated`)
  * `defaultFieldDeleted` (`account.defaultFieldDeleted`)
  * `defaultFieldUpdated` (`account.defaultFieldUpdated`)
  * `pipelineUpdated` (`account.pipelineUpdated`)
  * `stepCreated` (`account.stepCreated`)
  * `stepDeleted` (`account.stepDeleted`)
  * `stepUpdated` (`account.stepUpdated`)
* `clientFolders`
  * `created` (`clientFolders.created`)
* `leads`
  * `assigned` (`leads.assigned`)
  * `commented` (`leads.commented`)
  * `contentChanged` (`leads.contentChanged`)
  * `created` (`leads.created`)
  * `deleted` (`leads.deleted`)
  * `manualTrigger` (`leads.manualTrigger`)
  * `statusChanged` (`leads.statusChanged`)
  * `statusChangedToCancelled` (`leads.statusChangedToCancelled`)
  * `statusChangedToLost` (`leads.statusChangedToLost`)
  * `statusChangedToStandby` (`leads.statusChangedToStandby`)
  * `statusChangedToTodo` (`leads.statusChangedToTodo`)
  * `statusChangedToWon` (`leads.statusChangedToWon`)
  * `stepChanged` (`leads.stepChanged`)
  * `unassigned` (`leads.unassigned`)
* `prospects`
  * `created` (`prospects.created`)
  * `updated` (`prospects.updated`)
* `tasks`
  * `statusChanged` (`tasks.statusChanged`)
  * `statusChangedToDone` (`tasks.statusChangedToDone`)
  * `statusChangedToStandby` (`tasks.statusChangedToStandby`)
  * `statusChangedToTodo` (`tasks.statusChangedToTodo`)

## 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);
    // With multiTenancy, give each tenant its own URL (/api/webhook?tenantId=acme):
    // the query says whose account, secret and hooks handle the delivery.
    const query = Object.fromEntries(new URL(request.url).searchParams);
    // The raw text, not request.json(): signatures are checked over the exact bytes sent.
    const body = await request.text();
    const result = await processWebhook(corsair, headers, body, query);
    if (!result.plugin) {
        return Response.json({ success: false }, { status: 404 });
    }
    // A refusal (bad signature) carries no status and answers 400; a handler
    // that threw comes back with 500, so the sender retries it.
    const status =
        result.response?.success === false ? (result.response.statusCode ?? 400) : 200;
    return Response.json(result.response ?? { success: true }, {
        status,
        headers: result.responseHeaders,
    });
}
```

## Events

## Account

### Default Field Created

`account.defaultFieldCreated`

A default field was created. noCRM event account.default\_field.created.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        account: {
            defaultFieldCreated: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Default Field Deleted

`account.defaultFieldDeleted`

A default field was deleted. noCRM event account.default\_field.deleted.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        account: {
            defaultFieldDeleted: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Default Field Updated

`account.defaultFieldUpdated`

A default field was updated. noCRM event account.default\_field.updated.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        account: {
            defaultFieldUpdated: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Pipeline Updated

`account.pipelineUpdated`

A pipeline was updated (renamed, ...). noCRM event account.step.pipeline.updated.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        account: {
            pipelineUpdated: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Step Created

`account.stepCreated`

A pipeline step was created. noCRM event account.step.created.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        account: {
            stepCreated: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Step Deleted

`account.stepDeleted`

A pipeline step was deleted. noCRM event account.step.deleted.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        account: {
            stepDeleted: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Step Updated

`account.stepUpdated`

A pipeline step was updated. noCRM event account.step.updated.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        account: {
            stepUpdated: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

## Client Folders

### Created

`clientFolders.created`

A client folder was created. noCRM event client\_folder.created.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        clientFolders: {
            created: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

## Leads

### Assigned

`leads.assigned`

A lead was reassigned. noCRM event lead.assigned.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            assigned: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Commented

`leads.commented`

A lead got a comment. noCRM event lead.commented.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            commented: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Content Changed

`leads.contentChanged`

A lead's description changed. noCRM event lead.content\_has\_changed.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            contentChanged: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Created

`leads.created`

A lead was created. Carries the lead. noCRM event lead.creation.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            created: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Deleted

`leads.deleted`

A lead was moved to the trash. noCRM event lead.deleted.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            deleted: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Manual Trigger

`leads.manualTrigger`

Someone ran the webhook from the lead action menu (manual webhook). noCRM event lead.manual.trigger.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            manualTrigger: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Status Changed

`leads.statusChanged`

A lead's status changed (any status). noCRM event lead.status.changed.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            statusChanged: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Status Changed To Cancelled

`leads.statusChangedToCancelled`

A lead was cancelled. noCRM event lead.status.changed.to.cancelled.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            statusChangedToCancelled: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Status Changed To Lost

`leads.statusChangedToLost`

A lead was lost. noCRM event lead.status.changed.to.lost.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            statusChangedToLost: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Status Changed To Standby

`leads.statusChangedToStandby`

A lead was put on standby. noCRM event lead.status.changed.to.standby.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            statusChangedToStandby: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Status Changed To Todo

`leads.statusChangedToTodo`

A lead went back to to-do. noCRM event lead.status.changed.to.todo.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            statusChangedToTodo: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Status Changed To Won

`leads.statusChangedToWon`

A lead was won. noCRM event lead.status.changed.to.won.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            statusChangedToWon: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Step Changed

`leads.stepChanged`

A lead's pipeline step changed. noCRM event lead.step.changed.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            stepChanged: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Unassigned

`leads.unassigned`

A lead was created unassigned. noCRM event lead.unassigned.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        leads: {
            unassigned: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

## Prospects

### Created

`prospects.created`

A prospect was added to a prospecting list. noCRM event prospect.created.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        prospects: {
            created: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Updated

`prospects.updated`

One or more prospects were updated. noCRM event prospect.updated.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        prospects: {
            updated: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

## Tasks

### Status Changed

`tasks.statusChanged`

A post-sales task's status changed. noCRM event task.status.changed.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        tasks: {
            statusChanged: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Status Changed To Done

`tasks.statusChangedToDone`

A post-sales task was done. noCRM event task.status.changed.to.done.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        tasks: {
            statusChangedToDone: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Status Changed To Standby

`tasks.statusChangedToStandby`

A post-sales task was put on standby. noCRM event task.status.changed.to.standby.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        tasks: {
            statusChangedToStandby: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***

### Status Changed To Todo

`tasks.statusChangedToTodo`

A post-sales task went back to to-do. noCRM event task.status.changed.to.todo.

**Payload**

| Name | Type | Required | Description |
| - | - | - | - |
| `webhook_event` | `object` | Yes | — |

> [accordion] webhook\_event full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

> [accordion] Response data full type
>
> ```ts theme={null}
> {
>   id: number | string,
>   event: string,
>   signature: string,
>   data?: any,
>   event_params?: any,
>   has_succeeded?: boolean | null,
>   try_count?: number | null,
>   last_returned_code?: number | null,
>   extended_info?: any,
>   comments?: any
> }
> ```

**`webhookHooks` example**

```ts theme={null}
nocrm({
    webhookHooks: {
        tasks: {
            statusChangedToTodo: {
                before(ctx, args) {
                    return { ctx, args };
                },
                after(ctx, response) {
                },
            },
        },
    },
})
```

***


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