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

# Analytics Overview

> Access analytics data from Tusk through our RESTful API.

The Tusk Analytics API is a RESTful API that allows you to access your analytics data from Tusk.

<Warning>
  The Analytics API is only available for customers on Team Plus and Enterprise plans.
</Warning>

### Base URL

All API URLs are relative to the following base URL:

```
https://use-tusk.uc.r.appspot.com/api/v1/analytics
```

### Authentication

The Tusk Analytics API uses API keys to authenticate requests. You can create and manage your API keys in your [Tusk settings](https://app.usetusk.ai/app/settings/api-keys).

Your API key should be included in all API requests in the `x-api-key` header.

### Versioning

The API is versioned, and the current version is `v1`. If we introduce breaking changes, we will release a new version of the API.

### Common Query Parameters

Most analytics endpoints support the following query parameters for filtering data.

| Parameter   | Type                | Description                                                                                                      |
| :---------- | :------------------ | :--------------------------------------------------------------------------------------------------------------- |
| `startDate` | `string` (ISO 8601) | The start date (inclusive) to filter results. For example: `2024-01-01T00:00:00Z`.                               |
| `endDate`   | `string` (ISO 8601) | The end date (inclusive) to filter results. For example: `2024-01-31T23:59:59Z`.                                 |
| `repoIds`   | `array[number]`     | A list of repository IDs to filter by. Can be provided as a comma-separated string (e.g., `1,2,3`).              |
| `usernames` | `array[string]`     | A list of GitHub/GitLab usernames to filter by. Can be provided as a comma-separated string (e.g., `john,jane`). |

### Errors

The Tusk Analytics API uses conventional HTTP response codes to indicate the success or failure of a request:

* `2xx` response codes indicate success.
* `4xx` response codes indicate an error with the information provided (e.g., a required parameter was omitted).
* `5xx` response codes indicate an error with Tusk's servers.
