# Create Webhook Endpoint

## /v1/webhook\_endpoints

<mark style="color:green;">`POST`</mark> `https://api.uiza.sh/v1/webhook_endpoints`

#### Request Body

| Name   | Type   | Description                                                                         |
| ------ | ------ | ----------------------------------------------------------------------------------- |
| secret | string | The token used to validate the communication between Uiza and the webhook endpoint. |
| url    | string | The URL of the webhook endpoint.                                                    |

{% tabs %}
{% tab title="200 " %}

```
{
 "id": "f0f207af-b338-4b7f-8d32-fe9cfa9566eb",
 "url": "https://webhook-test.com/live/created",
 "status": "enabled",
 "created_at": "2019-12-16T10:57:32Z",
 "updated_at": "2019-12-16T10:57:32Z"
}
```

{% endtab %}

{% tab title="400 " %}
{% tabs %}
{% tab title="Missing URL" %}

```
{
 "message": "Your request is missing url parameter. Please, verify and resubmit.",
 "error_type": "invalid_request_error"
}
```

{% endtab %}
{% endtabs %}
{% endtab %}

{% tab title="401 " %}

```
{
 "message": "You are unauthorized to access the requested resource. Please verify and resubmit.",
 "error_type": "invalid_request_error"
}
```

{% endtab %}

{% tab title="409 " %}

```
{
 "message": "The requested app_id already registered with a webhook.",
 "error_type": "invalid_request_error"
}
```

{% endtab %}

{% tab title="500 " %}

```
{
 "message": "An unexpected error occurred on Uiza's end.",
 "error_type": "api_error"
}
```

{% endtab %}
{% endtabs %}

{% code title="Sample Request" %}

```
curl -X POST https://api.uiza.sh/v1/webhook_endpoints
     -H 'Authorization: uap-c1ffbff4db954ddcb050c6af0b43ba56-41193b64'
     -d '{"url": "https://webhook-test.com/live/created", "secret": "a-secret"}'
```

{% endcode %}
