---
title: "Introspect project schema"
method: GET
path: "/projects/v1/admin/{project_id}/schema"
tags: ["Admin"]
---

# Introspect project schema

`GET /projects/v1/admin/{project_id}/schema`

## Request

- Base URL: `https://api.run402.com`
- URL: `https://api.run402.com/projects/v1/admin/{project_id}/schema`
- Auth: one of:
  - HTTP bearer
  - API key in header `SIGN-IN-WITH-X`
  - HTTP bearer
  - HTTP bearer

Returns full schema introspection: tables, columns, constraints, RLS policies. A SIWX wallet (SIGN-IN-WITH-X), a sign-in session bearer, or a grant key bearer is also accepted, authorized by the caller's own authority on the project (no service key): project.database.read (org role viewer or higher, or a grant / grant key carrying database:read) and project.database.write (developer or higher, or database:write, which also reads). The credential's shape picks the path; a principal call never returns a key and is audited (with a SHA-256 of the request, never its text) before it runs. A non-member, or a principal without the authority, gets 403 FORBIDDEN with next_actions (ask an org owner or admin for a role, ask for a grant with the capability, or import the service key), and the same answer whether or not the project exists. Schema introspection is a read (project.database.read) and runs inside a READ ONLY transaction.

## Path parameters

- `project_id` string, required: Run402 project ID. Public IDs are not UUIDs.

## Response `200`

Schema info

- object
  - `schema` string
  - `tables` object[]
    - `name` string
    - `columns` object[]
    - `constraints` object[]
    - `rls_enabled` boolean
    - `policies` object[]

## Other responses

- `401`: Missing or invalid authentication. Run402-originated JSON bodies use the canonical ErrorEnvelope.
- `403`: Not authorized for this project (FORBIDDEN, with next_actions).

---

[API](https://skmtc.dev/run402/apis/run402-api.md) · [All operations](https://skmtc.dev/run402/apis/run402-api/llms.txt) · [OpenAPI document](https://skmtc.dev/run402/apis/run402-api/revisions/893607557f50?raw)
