> 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 %}
