---
title: "Get a database branch"
method: GET
path: "/api/v1/databases/{databaseId}/branches/{branchId}"
tags: ["Databases"]
---

# Get a database branch

`GET /api/v1/databases/{databaseId}/branches/{branchId}`

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/databases/{databaseId}/branches/{branchId}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Returns one branch's record, including status and failure state when present. Responses never include connection credentials.

## Path parameters

- `databaseId` string, required
- `branchId` string, required

## Response `200`

The branch record.

- object
  - `id` string, required
  - `databaseId` string, required
  - `parentBranchId` string, nullable, required
  - `name` string, required
  - `status` 'creating' | 'ready' | 'failed', required
  - `initSource` 'parent-data' | 'schema-only', required
  - `parentTimestamp` string, nullable, required
  - `expiresAt` string, nullable, required
  - `endpointHost` string, nullable, required
  - `createdAt` string, required
  - `updatedAt` string, required
  - `readyAt` string, nullable, required
  - `failedAt` string, nullable, required
  - `failureState` object, nullable, required
    - `code` 'provider_unavailable' | 'provider_rejected' | 'internal_error', required
    - `message` string, required

## Other responses

- `401`: Authentication is missing or invalid.
- `404`: The resource was not found.
- `429`: Too many requests; retry after the indicated delay.

---

[API](https://skmtc.dev/khotan/apis/khotan-api.md) - [All operations](https://skmtc.dev/khotan/apis/khotan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/khotan/apis/khotan-api/revisions/90b512a53e42?raw)
