# Webhook

A webhook allows you to integrate with Oneflow by receiving callbacks whenever there is a new [contract event](oneflow-platform-glossary#contract-event) in one of your contracts.

# Webhook attributes

The table below shows all the attributes available for a webhook:

| Attribute             | Type                                                            | Description                                                                          |
| :-------------------- | :-------------------------------------------------------------- | :----------------------------------------------------------------------------------- |
| callback\_url         | [string](type-reference#base-types)                             | The webhook's callback url.                                                          |
| filters               | [array](type-reference#base-types)                              | The list of filters associated with the webhook. See [Filter](/docs/webhook#filter). |
| integration\_instance | [integer(signed\_integer\_id)](type-reference#subtypes-for-int) | Integration instance ID which the webhook is connected to.                           |
| legacy\_webhook       | [boolean](type-reference#base-types)                            | Indicates if the webhook is a legacy webhook.                                        |
| template\_group\_id   | [integer(signed\_integer\_id)](type-reference#subtypes-for-int) | Template group ID which the webhook is connected to.                                 |
| webhook\_id           | [integer(signed\_integer\_id)](type-reference#subtypes-for-int) | The ID of the webhook.                                                               |

## Filter

A filter denotes an object in the `filters` array. A filter contains`filter_rules`.

| Attribute     | Type                               | Description                                                                                                                             |
| :------------ | :--------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------- |
| filter\_rules | [array](type-reference#base-types) | Represents a list of filter rules which can be associated with one webhook filter object. See [Filter rule](/docs/webhook#filter-rule). |

### Filter rule

A filter rule denotes an object in the `filter_rules` array. A filter rule contains `type` and `values`.

| Attribute | Type                                | Description                                                                                                                                                                                                                                                                    |
| :-------- | :---------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| type      | [string](type-reference#base-types) | Represents the type of the filter rule. Currently, there are two types of filter rules available; `EVENT_TYPE` and `WORKSPACE`.                                                                                                                                                |
| values    | [array](type-reference#base-types)  | Contains a list of values related to the type of the filter rule. If it is an `EVENT_TYPE`, values are a list of strings that are any of the [contract events](/docs/webhook-type). If it is a `WORKSPACE`, values are a list of integers of [workspace](/docs/workspace) IDs. |