> For the complete documentation index, see [llms.txt](https://docs.prestd.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.prestd.com/api-reference.md).

# API Reference

pREST API reference — REST (Representational State Transfer) HTTP endpoints that map to SQL on the native PostgreSQL adapter (and certified engines).

**pREST** generates HTTP APIs from your database catalog. Today the **native** dialect is PostgreSQL (and Postgres-compatible engines documented under [Databases](/databases.md)). This reference covers endpoints, parameters, auth, and advanced query patterns.

## What is REST?

**REST (Representational State Transfer)** is an [architectural style](https://developer.mozilla.org/en-US/docs/Glossary/REST) for building APIs over HTTP. pREST exposes your SQL tables as REST resources at `/{database}/{schema}/{table}`, mapping standard verbs to CRUD on the same server as MCP.

Application backends, mobile and web clients, and any HTTP client that needs CRUD on SQL tables use that surface. This reference documents the endpoints below; see also [Parameters](/api-reference/parameters.md) and [Auth](/api-reference/auth.md).

***prestd*** implements HTTP verbs that map to SQL data operations on the connected engine.

### GET

> SQL `SELECT` (PostgreSQL dialect mapping)

| Endpoints                           | Description                                                                                                                                       |
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `/_health`                          | Liveness probe — pings default database                                                                                                           |
| `/_ready`                           | Readiness probe — pings default database and all registered aliases                                                                               |
| `/_mcp`                             | MCP discovery — server metadata and available read-only tools ([guide](/get-started/mcp-over-http.md), [stdio adapter](/ai/install-prest-mcp.md)) |
| `/databases`                        | List all databases                                                                                                                                |
| `/schemas`                          | List all schemas                                                                                                                                  |
| `/tables`                           | List all tables                                                                                                                                   |
| `/show/{DATABASE}/{SCHEMA}/{TABLE}` | Lists table structure - all fields contained in the table                                                                                         |
| `/{DATABASE}/{SCHEMA}`              | Lists table tables - find by schema                                                                                                               |
| `/{DATABASE}/{SCHEMA}/{TABLE}`      | List all rows, find by database, schema and table                                                                                                 |
| `/{DATABASE}/{SCHEMA}/{VIEW}`       | List all rows, find by database, schema and view                                                                                                  |

### POST

| Endpoints | Description                                                                                                                                 |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `/_mcp`   | MCP JSON-RPC — `initialize`, `tools/list`, `tools/call` ([guide](/get-started/mcp-over-http.md), [stdio adapter](/ai/install-prest-mcp.md)) |

> SQL `INSERT` (PostgreSQL dialect mapping)

```
/{DATABASE}/{SCHEMA}/{TABLE}
```

**JSON DATA:**

```
{
    "FIELD1": "string value",
    "FIELD2": 1234567890
}
```

### PATCH and PUT

> SQL `UPDATE` (PostgreSQL dialect mapping)

Using query string to make filter (WHERE), example:

```
/{DATABASE}/{SCHEMA}/{TABLE}?{FIELD NAME}={VALUE}
```

JSON DATA:

```
{
    "FIELD1": "string value",
    "FIELD2": 1234567890,
    "ARRAYFIELD": ["value 1","value 2"]
}
```

> unconditional `update` can update unwanted record

### DELETE

> SQL `DELETE` (PostgreSQL dialect mapping)

Using query string to make filter (WHERE), example:

```
/{DATABASE}/{SCHEMA}/{TABLE}?{FIELD NAME}={VALUE}
```

> unconditional `delete` can delete unwanted record

### Related

* [Databases](/databases.md)
* [Acronyms](/readme/acronyms.md) ([REST](/readme/acronyms.md#rest), [MCP](/readme/acronyms.md#mcp))
* [Parameters](/api-reference/parameters.md)
* [MCP over HTTP](/get-started/mcp-over-http.md)
* [Auth](/api-reference/auth.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.prestd.com/api-reference.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
