> For the complete documentation index, see [llms.txt](https://docs.searchagora.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.searchagora.com/webhooks/add-alert.md).

# Add alert

POST `/add-alerts`

This endpoint lets you create a new alert for a specific product. We currently support alerts for changes to stock or price of a product.

**Headers**

| Header          | Type   | Description   |
| --------------- | ------ | ------------- |
| `Authorization` | string | Bearer token. |

**Request body**

```json
{
    "productId": "678504dc4ef9824e38f29c27",
    "type": "stock" // allowed fields are stock and price
}
```

**Response**

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

```json
{
    "status": "success",
    "data": {
        "_id": "69416ae79e0508a7d6bb31a0",
        "user": "69119256f34516a8f3dbc536",
        "product": "678504dc4ef9824e38f29c27",
        "isNotified": false,
        "type": "stock",
        "requestedAt": "2025-12-16T14:21:27.567Z",
        "createdAt": "2025-12-16T14:21:27.567Z",
        "updatedAt": "2025-12-16T14:21:27.567Z",
        "__v": 0
    }
}
```

{% endtab %}

{% tab title="400" %}

```json
{
  "status": "fail",
  "data": "productId is required"
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.searchagora.com/webhooks/add-alert.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.
