---
title: "Get a branch schema"
method: GET
path: "/organizations/{organization}/databases/{database}/branches/{branch}/schema"
tags: ["Database branches"]
---

# Get a branch schema

`GET /organizations/{organization}/databases/{database}/branches/{branch}/schema`

### Authorization
A service token or OAuth token must have at least one of the following access or scopes in order to use this API endpoint:

**Service Token Accesses**
 `read_branch`, `delete_branch`, `create_branch`, `connect_production_branch`, `connect_branch`

**OAuth Scopes**

 | Resource | Scopes |
| :------- | :---------- |
| Organization | `read_branches` |
| Database | `read_branches` |
| Branch | `read_branch` |

## Path parameters

- `organization` string, required
- `database` string, required
- `branch` string, required

## Query parameters

- `keyspace` string
- `namespace` string

## Response `200`

Gets the schema for the branch

- object
  - `data` object[], required
    - `name` string, required — Name of the table
    - `html` string, required — Syntax highlighted HTML for the table's schema
    - `raw` string, required — The table's schema

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not Found
- `500` — Internal Server Error

---

[API](https://skmtc.dev/planetscale/apis/planetscale-api.md) · [All operations](https://skmtc.dev/planetscale/apis/planetscale-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/planetscale/planetscale-api/revisions/6d28c038c4fd/schema)
