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

# Get a branch connection URI

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

## Request

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

Returns the full Postgres connection URI for a ready branch. The URI grants complete read/write access to the branch; treat it as a secret. Responds 404 until the branch is ready. All schema and row access happens directly over Postgres using this URI — the API never proxies SQL.

## Path parameters

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

## Response `200`

The connection URI for the ready branch.

- object
  - `connectionUri` 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)
