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

# API Overview

This section provides an overview of how to use the Gleap API, including authentication and querying.

## Base URL

All API requests should be made to:

```
https://api.gleap.io/v3
```

## Authentication

The Gleap API uses Bearer token authentication along with a project identifier header.

### Getting your API Key and Project ID

1. Navigate to your [Gleap dashboard](https://app.gleap.io)
2. Go to **Project Settings** → **Security** → **API Key**
3. Generate your API key
4. Your **Project ID** is also displayed on this page

<Warning>
  Keep your API key secure and never expose it in client-side code or public
  repositories.
</Warning>

### Required Headers

Include both headers in every API request:

```
Authorization: Bearer YOUR_API_KEY
Project: YOUR_PROJECT_ID
```

**Example request:**

```bash theme={null}
curl -X GET https://api.gleap.io/v3/tickets \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Project: YOUR_PROJECT_ID" \
  -H "Content-Type: application/json"
```

## Querying

All find endpoints (GET requests that return lists of resources) support querying on any property that exists on the document.

### Discovering Available Properties

To see which attributes are available on a document, fetch a single document first:

```bash theme={null}
curl -X GET https://api.gleap.io/v3/tickets/TICKET_ID \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Project: YOUR_PROJECT_ID"
```

This will return the full document structure showing all available properties you can query on.

### Query Examples

#### Exact Match

Query for tickets with a specific status:

```
GET https://api.gleap.io/v3/tickets?status=OPEN
```

Query for tickets assigned to a specific user:

```
GET https://api.gleap.io/v3/tickets?processingUser=user123
```

#### Date Range Queries

Query using comparison operators (`>=`, `<=`, `>`, `<`) for date fields:

```
GET https://api.gleap.io/v3/tickets?createdAt>=2025-09-01T00:00:00.000Z&createdAt<=2025-09-01T23:00:00.000Z
```

This example fetches all tickets created on September 1st, 2025 (between 00:00:00 and 23:00:00 UTC).

**Date format:** Use ISO 8601 format: `YYYY-MM-DDTHH:mm:ss.sssZ`

#### Combining Multiple Query Parameters

You can combine multiple query parameters using `&`:

```
GET https://api.gleap.io/v3/tickets?status=OPEN&priority=HIGH&createdAt>=2025-01-01T00:00:00.000Z
```

This returns all open tickets with high priority created after January 1st, 2025.

#### Multiple Values

Query for documents matching any of several values:

```
GET https://api.gleap.io/v3/tickets?status=OPEN,DONE,INPROGRESS
```

## Rate Limits

The API enforces rate limits to ensure fair usage:

* **Rate limit:** 1000 requests per 60 seconds per project

If you exceed the rate limit, you'll receive a `429 Too Many Requests` response. Wait before retrying your request.
