---
title: "Get connection string"
method: GET
path: "/database/v1/projects/{id}/connection"
tags: ["Database"]
---

# Get connection string

`GET /database/v1/projects/{id}/connection`

Retrieves the PostgreSQL connection URI for a database project. Supports selecting specific branches and pooled vs direct connections. Connection strings include credentials and should be stored securely. Use for configuring applications and deployment environments.

## Path parameters

- `id` string, required

## Query parameters

- `branch` string
- `pooled` boolean

## Response `200`

Connection string retrieved successfully

- object
  - `connectionUri` string, uri, required — PostgreSQL connection string (includes credentials)
  - `branch` string, required — Branch name for this connection
  - `pooled` boolean, required — Whether this is a pooled connection

## Other responses

- `400` — Invalid project ID
- `401` — Invalid or missing API key
- `404` — Database project or branch not found
- `500` — Failed to get connection string or connection URI not available

---

[API](https://skmtc.net/casemark/apis/case-dev-api.md) · [All operations](https://skmtc.net/casemark/apis/case-dev-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/casemark/case-dev-api/revisions/5b7e64e6d6f9/schema)
