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

# List event names

> GET /events/{tenantAlias} returns every distinct event name of the tenant.

`GET /events/{tenantAlias}` returns an array of strings. Each string is an `eventName` that the
tenant has stored. Use it to find out what you track, or to build an event selector in your own
dashboard. The path is relative to the base URL `https://queryapis.grainql.com/v1/api/query`.

## Request

```http theme={null}
GET /v1/api/query/events/{tenantAlias}
X-API-Key: $GRAIN_API_KEY
```

`{tenantAlias}` is the tenant alias that the dashboard shows, not the tenant UUID. The request
has no body and no query parameters.

## Example

<CodeGroup>
  ```bash curl theme={null}
  curl https://queryapis.grainql.com/v1/api/query/events/your-tenant-id \
    -H "X-API-Key: $GRAIN_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://queryapis.grainql.com/v1/api/query/events/your-tenant-id', {
    headers: {
      'X-API-Key': process.env.GRAIN_API_KEY,
    },
  });

  if (!response.ok) {
    const { error } = await response.json();
    throw new Error(`List failed: ${response.status} ${error}`);
  }

  const eventNames = await response.json();
  ```
</CodeGroup>

Response:

```json theme={null}
[
  "page_viewed",
  "button_clicked",
  "form_submitted",
  "purchase_completed",
  "user_signed_up",
  "video_played",
  "search_performed"
]
```

## Response fields

The body is a JSON array. It has no wrapper object.

| Item | Type | Notes |
| - | - | - |
| each element | string | One distinct `eventName`. Send it as `event` to the query and count endpoints. |

## Rules for the client

1. Cache the list. Event names change only when you track a new event.
2. To read the properties of one event name, send the name as `event` to `POST /{tenantAlias}`
   with a small `size`. Read [Query events](/api-reference/query-api/query-events).
3. To make sure that every expected event arrives, compare the list with the names in your
   tracking plan. A missing name means that no event with that name reached Grain.
4. If the API returns `429`, wait `Retry-After` seconds, then retry one time. Read
   [Query API](/api-reference/query-api/overview) for the rate limits and the error table.

## Limits

| Limit | Value | Where |
| - | - | - |
| Requests per minute and per day | Set by the plan | every request |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.