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

# REST API overview

> Base URL, request and response format, pagination, and an overview of every ReyGrid API endpoint.

The ReyGrid API is the HTTP interface to the ReyGrid RAG platform. It lets you chat with your RAG agents, keep persistent conversations per user, manage their knowledge, search it, and track your usage. This reference is generated from the API's OpenAPI specification (version 1.0.3).

## Base URL

```text theme={"system"}
https://reygrid.com/api/v1
```

## Making requests

* Send and receive JSON (`Content-Type: application/json`).
* Authenticate with a Bearer API key in the `Authorization` header. Only `GET /ping` is public. See [Authentication](/rest-api/authentication).
* Path segments such as `agentId` and `conversationRef` are plain strings. URL-encode them if they contain special characters.

```bash theme={"system"}
curl https://reygrid.com/api/v1/validate \
  -H "Authorization: Bearer $REYGRID_API_KEY"
```

## Response format

Successful responses are JSON objects with `"success": true`. Failures use one of two shapes; see [Errors](/rest-api/errors).

## Pagination

List endpoints accept two query parameters.

| Parameter | Type | Default | Constraints |
| - | - | - | - |
| `page` | integer | `1` | minimum `1` |
| `size` | integer | `20` | `1`–`100` |

Each list response includes a `pagination` object:

```json theme={"system"}
{
  "totalPages": 3,
  "currentPage": 1,
  "pagingCounter": 1,
  "hasNextPage": true,
  "totalConversations": 54
}
```

Conversations add `totalConversations`, messages add `totalMessages` and sources add `totalSources`. Keep requesting the next `page` while `hasNextPage` is `true`.

## Endpoints

| Method | Path | Purpose |
| - | - | - |
| `GET` | [`/ping`](/api-reference/health-check) | Health check |
| `GET` | [`/validate`](/api-reference/validate-api-key) | Validate an API key and read usage |
| `POST` | [`/agents/{AgentId}/chat`](/api-reference/chat-with-an-agent) | Send a message (JSON or SSE stream) |
| `GET` | [`/agents/{agentId}/conversations`](/api-reference/list-agent-conversations) | List an agent's conversations |
| `GET` | [`/agents/{agentId}/conversations/{conversationRef}/messages`](/api-reference/list-conversation-messages) | List messages |
| `DELETE` | [`/agents/{agentId}/conversations/{conversationRef}`](/api-reference/delete-a-conversation) | Delete a conversation |
| `DELETE` | [`/agents/{agentId}/conversations/{conversationRef}/messages/{messageId}`](/api-reference/delete-a-message) | Delete a message |
| `POST` | [`/agents/{agentId}/conversations/{conversationRef}/tool/cancel/{toolCallId}`](/api-reference/cancel-a-tool-call) | Cancel a tool call |
| `POST` | [`/agents/{agentId}/conversations/{conversationRef}/messages/{messageId}/feedback`](/api-reference/rate-a-reply) | Rate a reply |
| `GET` | [`/agents`](/api-reference/list-agents) | List agents |
| `GET` | [`/agents/{agentId}`](/api-reference/get-an-agent) | Get an agent |
| `PATCH` | [`/agents/{agentId}`](/api-reference/update-an-agent) | Update an agent |
| `GET` | [`/agents/{agentId}/sources`](/api-reference/list-knowledge-sources) | List knowledge sources |
| `POST` | [`/agents/{agentId}/sources/text`](/api-reference/add-a-text-source) | Add text |
| `POST` | [`/agents/{agentId}/sources/qa`](/api-reference/add-a-qa-source) | Add a Q\&A pair |
| `POST` | [`/agents/{agentId}/sources/files`](/api-reference/upload-a-file) | Upload a file |
| `POST` | [`/agents/{agentId}/sources/website`](/api-reference/crawl-a-website) | Crawl a website |
| `DELETE` | [`/agents/{agentId}/sources/{sourceId}`](/api-reference/delete-a-source) | Delete a source |
| `POST` | [`/agents/{agentId}/search`](/api-reference/search-knowledge) | Search knowledge |
| `GET` | [`/models`](/api-reference/list-models) | List models |
| `GET` | [`/usage`](/api-reference/get-usage) | Credit balance and usage |

<Note>
  `conversationRef` accepts either a **conversationId** or a persistent **userId**. See [Persistent conversations](/rest-api/conversations).
</Note>

## SDKs

Prefer a typed client? Use the [Python](/integrations/python/installation) or [TypeScript](/integrations/typescript/installation) SDK.


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