Source: https://datafa.st/docs/api/account/alerts/history
Markdown source: https://datafa.st/docs/api/account/alerts/history.md
Description: Get recent alert trigger logs. Supports alertId and limit query parameters.

# Get alert history

`GET https://datafa.st/api/v1/admin/websites/{websiteId}/alerts/history`

Return recent alert trigger logs — which alerts fired, for which goals, and whether delivery succeeded or failed.

Use `alertId` to filter to one alert. Results are capped at 100.

> **Related:** [Alerts announcement](/changelog/alerts-mobile-wordpress) · [Custom goals](/docs/custom-goals)

## Request

#### Path parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `websiteId` | string | — | Website ObjectId. From [List websites](/docs/api/account/websites/list) (`_id` field). Example: `665f0b3c4d2e1a0012345678`. |

#### Query parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `alertId` | string | No | Filter to one alert. ObjectId from [List alerts](/docs/api/account/alerts/list). Example: `665f0b3c4d2e1a0012345678`. |
| `limit` | number | No | Max logs returned. Default `50`, max `100`. Example: `limit=25`. |

#### Example query

```http
GET /api/v1/admin/websites/{websiteId}/alerts/history?alertId=665f0b3c4d2e1a0012345678&limit=25
```

## Response

Returns a JSON object with `status: "success"` and endpoint-specific fields in `data`.

#### Response fields

| Field | Type | Description |
| --- | --- | --- |
| `data[].alertId` | string | Alert ObjectId. |
| `data[].alertName` | string | Alert name. |
| `data[].goalName` | string | Goal that triggered the alert. |
| `data[].status` | string | `sent` or failed status. |
| `data[].error` | string\|null | Error message when delivery failed. |
| `data[].visitorId` | string\|null | Alias for `datafast_visitor_id` on endpoints that accept both names. |
| `data[].triggeredAt` | string | Trigger timestamp. |
| `counts.sent` | number | Number of sent logs before limit slicing. |
| `counts.failed` | number | Number of failed logs before limit slicing. |
| `counts.total` | number | Total logs before limit slicing. |

### Authentication

Use a `dft_` account token with `alerts:read`.

A `df_` website API key for the same website can also call this route when the path `websiteId` matches the key's website. Write access with a `df_` key is capped at **member** level — owner-only actions such as [team management](/docs/api/account/team) require a `dft_` token and owner role.

### Errors

See [API errors](/docs/api#errors) for the standard error envelope, auth failures, validation errors, permission errors, and rate limits.

## Code examples

### Example request

```bash
curl -X GET "https://datafa.st/api/v1/admin/websites/{websiteId}/alerts/history" \
  -H "Authorization: Bearer dft_xxx"
```

### Success response

```json
{
  "status": "success",
  "data": [{
    "alertId": "665f0b3c4d2e1a0012345678",
    "alertName": "New signup",
    "goalName": "signup",
    "status": "sent",
    "error": null,
    "visitorId": "a3ab2331-989f-4cfa-91c6-2461c9e3c6bd",
    "triggeredAt": "2026-05-21T00:00:00.000Z"
  }],
  "counts": { "sent": 1, "failed": 0, "total": 1 }
}
```
