Skip to main content
Branches are isolated Postgres databases created from a connector. Use them for CI runs, local development, migration testing, agent work, and short-lived review environments.

Endpoints

MethodPathDescription
POST/v1/branch/createCreate a branch
GET/v1/branches/{connector_id}List branches for a connector
For interactive deletion and switching, use the CLI: ardent branch delete and ardent branch switch.

Create a branch

curl -H "Authorization: Bearer $ARDENT_TOKEN"   -X POST https://api.tryardent.com/v1/branch/create   -H 'Content-Type: application/json'   -d '{"connector_id":"conn_123","service_type":"postgres","name":"pr-123"}'
For Postgres branches, service_type is postgres. Connector creation uses the connector type postgresql; branch creation uses the shorter branch service type. The response is the branch’s connection details:
{
  "host": "pr-123-postgres.routing.tryardent.com",
  "port": 5432,
  "username": "user",
  "password": "***",
  "database": "db",
  "connection_uri": "postgresql://user:***@pr-123-postgres.routing.tryardent.com:5432/db?sslmode=require&channel_binding=disable"
}
Treat connection_uri and the discrete credential fields as sensitive. Use connection_uri exactly as returned, including sslmode=require and channel_binding=disable. If you assemble a connection string from the discrete fields, add those same query parameters. Branch connections go through Ardent’s connection routing layer. For branch connections, set SQL clients and IDEs to SSL mode require. With no custom root certificate configured, sslmode=require encrypts the connection but does not validate a CA chain. Leave custom root certificate, CA bundle, SSL certificate authority, or sslrootcert fields blank. Do not reuse a source database CA bundle; it cannot verify the branch routing host and can cause TLS errors. Keep channel_binding=disable; clients that force channel binding can reject a valid branch connection because TLS terminates at the routing layer. When the branch is cut from a source whose WAL advanced past the snapshot, the response also includes a warning string describing the staleness. It is absent otherwise. For branch metadata such as id, status, and created_at, list the connector’s branches with GET /v1/branches/{connector_id}, or use the CLI’s ardent branch create --format json.

List branches

curl -H "Authorization: Bearer $ARDENT_TOKEN" https://api.tryardent.com/v1/branches/conn_123
Use this to populate internal dashboards or cleanup tools. For shell scripts that only need a URL, the CLI is simpler:
DATABASE_URL="$(ardent branch create pr-123 --print-url)"

Naming guidance

Use names that are unique, readable, and safe to clean up automatically:
  • pr-123-456789
  • agent-fix-login-20260601
  • migration-add-index-smoke-test
Avoid embedding secrets, customer names, or production incident details in branch names.