Source: https://datafa.st/docs/api/account/tracked-goals
Markdown source: https://datafa.st/docs/api/account/tracked-goals.md
Description: List tracked goals for a website before setting KPIs, alerts, or funnels.

# Goals API

Use this endpoint when building an agent or UI that needs to choose from existing goals before setting a KPI, creating an alert, or creating a funnel.

It returns goals already seen in your analytics data, ordered by frequency. This helps prevent typos when an automation asks a user to pick a goal.

Base path: `https://datafa.st/api/v1/admin`

| Endpoint | Method | Path | Permission | Purpose |
|---|---|---|---|---|
| [List tracked goals](/docs/api/account/tracked-goals/list) | GET | `/websites/{websiteId}/goals` | `settings:read` | List tracked goals ordered by frequency |

```sh
curl "https://datafa.st/api/v1/admin/websites/YOUR_WEBSITE_ID/goals" \
  -H "Authorization: Bearer dft_xxx"
```

To send goal events and query goal analytics, use [Goals](/docs/api/website/goals).

## Code examples

### Example request

```bash
curl "https://datafa.st/api/v1/admin/websites/YOUR_WEBSITE_ID/goals" \
  -H "Authorization: Bearer dft_xxx"
```

### Success response

```json
{
  "status": "success",
  "data": [
    {
      "name": "signup",
      "total": 128,
      "uv": 104,
      "conversionRate": 8.4,
      "eventType": "custom"
    }
  ]
}
```
