Source: https://dinakar-rewind.docs.pageloop.ai/api-reference/query/getschema

# Annotated database schema

GET `https://api.rewind.rest/v1/schema`

Returns the curated, annotated schema for the query endpoint: every queryable table with its columns, types, semantic notes, join keys, and global conventions (single user\_id, ISO timestamps, rating scales, image URL composition). Secret/system tables are intentionally omitted.

## Authorization

#### Authorization (header, string, required)

API key. Read keys (rw\_live\_...) access GET endpoints. Admin keys (rw\_admin\_...) access all endpoints.

## Response

#### 200

Annotated schema

#### notes (array of string, required)

Global conventions a model needs before writing queries.

#### tables (array of object, required)

Every queryable table with columns, notes, and join keys.

#### properties

#### name (string, required)

#### purpose (string, required)

#### columns (array of object, required)

#### joins (array of string)

#### 401

Unauthorized

#### error (string, required)

#### status (integer, required)

#### Request

```bash cURL
curl -X GET 'https://api.rewind.rest/v1/schema' \
  -H 'Authorization: Bearer <token>'
```

```javascript JavaScript
const res = await fetch('https://api.rewind.rest/v1/schema', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <token>',
  },
});
const data = await res.json();
```

```python Python
import requests

res = requests.get(
    'https://api.rewind.rest/v1/schema',
    headers={'Authorization': 'Bearer <token>'}
)
data = res.json()
```

#### Response

```json 200
{
  "notes": [
    "string"
  ],
  "tables": [
    {
      "name": "string",
      "purpose": "string",
      "columns": [
        "\u2026"
      ],
      "joins": [
        "\u2026"
      ]
    }
  ]
}
```

```json 401
{
  "error": "Not found",
  "status": 404
}
```
