---
title: "Retrieve branch credentials"
method: GET
path: "/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/credentials"
tags: ["Branches"]
---

# Retrieve branch credentials

`GET /organizations/{organizationID}/projects/{projectID}/branches/{branchID}/credentials`

## Path parameters

- `organizationID` string, required
- `projectID` string, required
- `branchID` string, required

## Query parameters

- `username` string

## Response `200`

Credentials for the branch retrieved successfully

- BranchCredentials — Credentials and connection details for accessing a branch
  - `username` string, required — Username for accessing the branch database
  - `password` string, required — Password for accessing the branch database
  - `hostname` string, required — Hostname for accessing the branch database
  - `port` integer, required — Port for accessing the branch database
  - `dbname` string, required — Name of the database to connect to
  - `connectionString` string, required — Database connection string for accessing this branch. It carries no sslmode parameter, clients choose their own TLS settings.

## Other responses

- `400` — Generic error response for most error conditions
- `401` — Error response when authentication or authorization fails
- `404` — Generic error response for most error conditions
- `5XX` — Unexpected Error
- `default` — Unexpected Error

## Changes

- **2026-07-31** `33621695d346` — 1 breaking
  - for the `query` request parameter `username`, default value `xata` was added
- **2026-07-27** `b62e5dfec032` — 4 info
  - added the required property `connectionString` to the response with the `200` status
  - added the required property `dbname` to the response with the `200` status
  - added the required property `hostname` to the response with the `200` status
  - added the required property `port` to the response with the `200` status

[Change history](https://skmtc.dev/xata/apis/xata-api/changes/organizations/:organizationID/projects/:projectID/branches/:branchID/credentials/get.md)

---

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