---
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`

## Request

- Base URL: `https://api.xata.tech`
- URL: `https://api.xata.tech/organizations/{organizationID}/projects/{projectID}/branches/{branchID}/credentials`
- Auth: OAuth 2
  - Implicit: `https://auth.xata.io/realms/xata/protocol/openid-connect/auth`
  - Scopes: `credentials:read`

## 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-28** `ef4485f6428e`: 1 breaking
  - for the `query` request parameter `username`, default value `xata` was added
- **2026-07-27** `16f6200eae92`: 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

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

---

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