# Client API: Mail: Webhooks

> The 3 Client API operations for webhooks.

Source: https://docs.coritan.com/api/reference/client/mail/smtp-relay-webhooks/

Part of [Mail](/api/reference/client/mail/).

## Operations

| Method | Path | Summary |
| --- | --- | --- |
| GET | [`/api/v1/client/smtp-relay/{service_id}/webhooks`](#op-get-api-v1-client-smtp-relay-service-id-webhooks) | List webhooks |
| POST | [`/api/v1/client/smtp-relay/{service_id}/webhooks`](#op-post-api-v1-client-smtp-relay-service-id-webhooks) | Create webhook |
| DELETE | [`/api/v1/client/smtp-relay/{service_id}/webhooks/{webhook_id}`](#op-delete-api-v1-client-smtp-relay-service-id-webhooks-webhook-id) | Delete webhook |

### List webhooks {#op-get-api-v1-client-smtp-relay-service-id-webhooks}

`GET /api/v1/client/smtp-relay/{service_id}/webhooks`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `service_id` | path | integer | yes |

#### Responses

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

### Create webhook {#op-post-api-v1-client-smtp-relay-service-id-webhooks}

`POST /api/v1/client/smtp-relay/{service_id}/webhooks`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `service_id` | path | integer | yes |

#### Request body

`application/json` (required)

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

#### Responses

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

### Delete webhook {#op-delete-api-v1-client-smtp-relay-service-id-webhooks-webhook-id}

`DELETE /api/v1/client/smtp-relay/{service_id}/webhooks/{webhook_id}`

Authentication: an access token, sent as `Authorization: Bearer <token>`.

#### Parameters

| Name | In | Type | Required |
| --- | --- | --- | --- |
| `webhook_id` | path | integer | yes |
| `service_id` | path | integer | yes |

#### Responses

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