> ## Documentation Index
> Fetch the complete documentation index at: https://docs.theslow.net/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Project Events

> Retrieve all events for a specific project in your SlowNet account using an API key.

## Endpoint

```
GET https://theslow.net/api/slowstats/get-events?projectId=YOUR_PROJECT_ID
```

## Overview

This endpoint retrieves all event records for a given project, ordered by most recent first.\
Use it to fetch analytics or event tracking data tied to your projects.

## Authentication

This endpoint requires an API key. You can retrieve an API key from your [dashboard](https://theslow.net/dashboard). Include it in the `X-API-KEY` header:

```
X-API-KEY: YOUR_API_KEY_HERE
```

For more details, see the [Authentication Guide](https://docs.theslow.net/authentication).

## Query Parameters

| Parameter   | Type   | Required | Description                                |
| ----------- | ------ | -------- | ------------------------------------------ |
| `projectId` | string | Yes      | The ID of the project to fetch events for. |

## Responses

### ✅ 200 OK

Returns a JSON object containing the list of events:

```json theme={null}
{
  "events": [
    {
      "id": "string",
      "project_id": "string",
      "type": "string",
      "data": { /* custom event data */ },
      "occurred_at": "2025-07-16T00:00:00Z"
    }
  ]
}
```

### ⚠️ 400 Bad Request

If `projectId` is missing:

```json theme={null}
{
  "error": "Project ID is required."
}
```

### 🔒 401 Unauthorized

If authentication fails (invalid or missing API key):

```json theme={null}
{
  "error": "Unauthorized: You must provide a valid API Key."
}
```

### 🚫 403 Forbidden

If the project does not belong to the authenticated user:

```json theme={null}
{
  "error": "Forbidden: You do not have access to this project."
}
```

### 💥 500 Internal Server Error

For unexpected server errors:

```json theme={null}
{
  "error": "An internal server error occurred."
}
```

## Examples

### CURL

```bash theme={null}
curl -X GET "https://theslow.net/api/slowstats/get-events?projectId=abc123"      -H "X-API-KEY: YOUR_API_KEY_HERE"
```

### Python (requests)

```python theme={null}
import requests

headers = {"X-API-KEY": "YOUR_API_KEY_HERE"}
params = {"projectId": "abc123"}
response = requests.get("https://theslow.net/api/slowstats/get-events", headers=headers, params=params)
print(response.json())
```

### JavaScript (fetch)

```javascript theme={null}
fetch("https://theslow.net/api/slowstats/get-events?projectId=abc123", {
  headers: { "X-API-KEY": "YOUR_API_KEY_HERE" }
})
  .then(res => res.json())
  .then(data => console.log(data.events));
```

## Notes

* This endpoint enforces **ownership checks**, meaning you can only fetch events for projects tied to your API key.
* Results are ordered by `occurred_at` descending (most recent first).

## Need Further Assistance?

If you have any questions or encounter issues, please don't hesitate to reach out to our [support team](https://theslow.net/dashboard#support).
