# Webhook

**POST `/crm_register_webhook`**

This endpoint is used to register or update a webhook for a specific collection.

**Headers:**

* `api_key` (required): The public key of the collection.
* `api_secret` (required): The private key of the collection.

**Body:**

* `webhook` (optional): The URL of the webhook. Must be a valid HTTPS URL if provided.
* `webhook_pass` (optional): The password for the webhook. Must be less than 250 characters if provided.
* `webhook_login` (optional): The login for the webhook. Must be less than 250 characters if provided.

**Responses:**

* `200 OK`:

  ```json
  jsonCopier le code{
      "status": true,
      "message": "updated"
  }
  ```
* `400 Bad Request`: Various error messages indicating the cause of the error.

**GET `/crm_get_webhook`**

This endpoint is used to retrieve the webhook details for a specific collection.

**Headers:**

* `api_key` (required): The public key of the collection.
* `api_secret` (required): The private key of the collection.

**Responses:**

* `200 OK`:

  ```json
  jsonCopier le code{
      "status": true,
      "data": {
          "webhook": "https://yourwebhook.com",
          "webhook_pass": "yourpassword",
          "webhook_login": "yourlogin"
      }
  }
  ```
* `400 Bad Request`: Various error messages indicating the cause of the error.


---

# 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.certhis.io/web3-crm/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.
