---
title: "Read the database's current schema"
method: GET
path: "/sites/{id}/db/schema"
tags: ["Sites"]
---

# Read the database's current schema

`GET /sites/{id}/db/schema`

## Request

- Base URL: `https://api.crevio.co/v1`
- URL: `https://api.crevio.co/v1/sites/{id}/db/schema`
- Auth: API key in header `Authorization`

The schema a database actually has, as the SQL that would recreate it. Pass `environment` to read the development database (what you are building against) or production (what the site is serving). Production's shape is changed only by deploying — it is a diff of development against it — so this is for understanding, not authoring.

## Path parameters

- `id` string, required

## Response `200`

Current schema

- object
  - `object` string
  - `environment` string
  - `schema` string: CREATE statements for every table, index and trigger.
  - `object_count` integer

## Other responses

- `400`: Bad request
- `401`: Authentication required
- `404`: Resource not found
- `429`: Rate limit exceeded — 600 requests per minute per credential. Retry after the number of seconds in `Retry-After`.

---

[API](https://skmtc.dev/crevio/apis/crevio-api-v1.md) · [All operations](https://skmtc.dev/crevio/apis/crevio-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/crevio/apis/crevio-api-v1/revisions/2219f18ad651?raw)
