# Organization API: Billing & Payouts: Webhooks

> The 4 Organization API operations for webhooks.

Source: https://www.coritan.com/docs/api/reference/organizations/billing-payouts/webhooks/

Part of [Billing & Payouts](/docs/api/reference/organizations/billing-payouts/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/orgs/{org_slug}/webhooks`](#op-get-api-v1-orgs-org-slug-webhooks) | List webhooks |
| POST | [`/api/v1/orgs/{org_slug}/webhooks`](#op-post-api-v1-orgs-org-slug-webhooks) | Create webhook |
| PATCH | [`/api/v1/orgs/{org_slug}/webhooks/{webhook_id}`](#op-patch-api-v1-orgs-org-slug-webhooks-webhook-id) | Update webhook |
| DELETE | [`/api/v1/orgs/{org_slug}/webhooks/{webhook_id}`](#op-delete-api-v1-orgs-org-slug-webhooks-webhook-id) | Delete webhook |

### List webhooks {#op-get-api-v1-orgs-org-slug-webhooks}

`GET /api/v1/orgs/{org_slug}/webhooks`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

A `200` response is a list; each item has these fields:

| Field | Type |
| --- | --- |
| `[].id` | integer |
| `[].org_id` | integer |
| `[].url` | string |
| `[].events` | array of any |
| `[].is_active` | boolean |
| `[].failure_count` | integer |
| `[].last_triggered_at` | string (date-time) or null |
| `[].created_at` | string (date-time) or null |

### Create webhook {#op-post-api-v1-orgs-org-slug-webhooks}

`POST /api/v1/orgs/{org_slug}/webhooks`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `url` | string | yes |
| `events` | array of string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `201` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `201` response:

| Field | Type |
| --- | --- |
| `id` | integer |
| `org_id` | integer |
| `url` | string |
| `events` | array of any |
| `is_active` | boolean |
| `failure_count` | integer |
| `last_triggered_at` | string (date-time) or null |
| `created_at` | string (date-time) or null |

### Update webhook {#op-patch-api-v1-orgs-org-slug-webhooks-webhook-id}

`PATCH /api/v1/orgs/{org_slug}/webhooks/{webhook_id}`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `webhook_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Request body

`application/json` (required)

| Field | Type | Required |
| --- | --- | --- |
| `url` | string or null | no |
| `events` | array of string or null | no |
| `is_active` | boolean or null | no |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |

Fields of a `200` response:

| Field | Type |
| --- | --- |
| `id` | integer |
| `org_id` | integer |
| `url` | string |
| `events` | array of any |
| `is_active` | boolean |
| `failure_count` | integer |
| `last_triggered_at` | string (date-time) or null |
| `created_at` | string (date-time) or null |

### Delete webhook {#op-delete-api-v1-orgs-org-slug-webhooks-webhook-id}

`DELETE /api/v1/orgs/{org_slug}/webhooks/{webhook_id}`

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `webhook_id` | path | integer | yes |
| `org_slug` | path | string | yes |

#### Responses

| Status | Meaning |
| --- | --- |
| `200` | Success. |
| `422` | The request is not valid. `detail` lists each problem. |
