# Steps to configure a webhook

Following are the steps to configure a webhook.

**1. Webhook event selection:**

Select the webhook event for which you want to receive the notification as given below.

> &#x20;   **`"events": [`**\
> `        `**`"CARD_STATUS_CHANGE"`**\
> `  `**`]`**

**2. Decide the endpoint:**

Decide the endpoint where you want to receive the webhook notification.&#x20;

Note that the endpoint should be hosted in your destination system.&#x20;

> **"endpoint": "**[**https://example.com**](https://nymcard.com/)**"**

&#x20;

**3. Security configuration:**

Determine the security characteristics as given below, choose the security credentials (username and password).&#x20;

> **`"config": {`**\
> `    `**`"basic_auth_username": "username",`**\
> `    `**`"basic_auth_password": "password",`**\
> `    `**`"custom_headers": [`**\
> `    `**`{`**\
> `        `**`"header_name": "apikey",`**\
> `        `**`"header_value": "306e38e4-54be-469f-beca-4297129289d6"`**\
> `    `**`}`**
>
> **`]`**

&#x20;

**4. Create a webhook:**

You can create a webhook now by sending a **POST** request to **/webhooks** endpoint as given below.

<details>

<summary><a href="https://nymcard.com/docs/api#tag/Webhooks/operation/createWebhookNotification">POST /webhooks</a></summary>

**`{`**\
`    `**`"endpoint": "`**[**`https://example.com/`**](https://example.com/)**`",`**\
`    `**`"events": [`**\
`        `**`"CARD_STATUS_CHANGE"`**\
`  `**`],`**\
`    `**`"config": {`**\
`        `**`"basic_auth_username": "username",`**\
`        `**`"basic_auth_password": "password",`**\
`        `**`"custom_headers": [`**\
`        `**`{`**\
`            `**`"header_name": "apikey",`**\
`            `**`"header_value": "306e38e4-54be-469f-beca-4297129289d6"`**\
`        `**`}`**\
`        `**`],`**\
`        `**`"created": "2021-05-27T18:48:00.074Z",`**\
`        `**`"modified": "2021-05-27T18:48:00.074Z"`**\
`    `**`}`**\
\&#xNAN;**`}`**

</details>

{% hint style="info" %}
It is possible to link more than one event with a single endpoint.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nymcard.com/get-started/webhooks/steps-to-configure-a-webhook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
