curl --request POST \
--url https://api.tryardent.com/v1/branch/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connector_id": "<string>",
"name": "<string>",
"service_type": "<string>"
}
'import requests
url = "https://api.tryardent.com/v1/branch/create"
payload = {
"connector_id": "<string>",
"name": "<string>",
"service_type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({connector_id: '<string>', name: '<string>', service_type: '<string>'})
};
fetch('https://api.tryardent.com/v1/branch/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryardent.com/v1/branch/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connector_id' => '<string>',
'name' => '<string>',
'service_type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tryardent.com/v1/branch/create"
payload := strings.NewReader("{\n \"connector_id\": \"<string>\",\n \"name\": \"<string>\",\n \"service_type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tryardent.com/v1/branch/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connector_id\": \"<string>\",\n \"name\": \"<string>\",\n \"service_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryardent.com/v1/branch/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connector_id\": \"<string>\",\n \"name\": \"<string>\",\n \"service_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"operation_id": "<string>",
"resource_id": "<string>",
"status": "pending",
"type": "connector_engine_setup"
}Create a branch
Start an async branch create and get an operation handle
curl --request POST \
--url https://api.tryardent.com/v1/branch/create \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"connector_id": "<string>",
"name": "<string>",
"service_type": "<string>"
}
'import requests
url = "https://api.tryardent.com/v1/branch/create"
payload = {
"connector_id": "<string>",
"name": "<string>",
"service_type": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({connector_id: '<string>', name: '<string>', service_type: '<string>'})
};
fetch('https://api.tryardent.com/v1/branch/create', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tryardent.com/v1/branch/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'connector_id' => '<string>',
'name' => '<string>',
'service_type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tryardent.com/v1/branch/create"
payload := strings.NewReader("{\n \"connector_id\": \"<string>\",\n \"name\": \"<string>\",\n \"service_type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tryardent.com/v1/branch/create")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"connector_id\": \"<string>\",\n \"name\": \"<string>\",\n \"service_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tryardent.com/v1/branch/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"connector_id\": \"<string>\",\n \"name\": \"<string>\",\n \"service_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"operation_id": "<string>",
"resource_id": "<string>",
"status": "pending",
"type": "connector_engine_setup"
}service_type is postgres — not the connector type postgresql.
The response is 202 Accepted with an operation handle:
{
"operation_id": "op_123",
"status": "pending",
"type": "branch_create",
"resource_id": "br_123"
}
completed, its result holds the branch details:
curl -H "Authorization: Bearer $ARDENT_TOKEN" "https://api.tryardent.com/v1/operations/op_123?wait=10"
{
"id": "op_123",
"status": "completed",
"result": {
"branch_id": "br_123",
"name": "pr-123",
"connector_id": "conn_123",
"service_type": "postgres",
"status": "active",
"branch_url": "postgresql://user:***@pr-123-postgres.routing.tryardent.com:5432/db?sslmode=require&channel_binding=disable",
"pooled_branch_url": null,
"pooled_branch_prisma_url": null,
"created_at": "2026-06-01T12:00:00Z",
"read_ready_at": "2026-06-01T12:00:05Z",
"write_ready_at": "2026-06-01T12:00:05Z",
"masked_ready_at": null
}
}
?wait= parameter.
branch_url as sensitive, and use it exactly as returned — including sslmode=require and channel_binding=disable. A completed operation can still return a null result or a null branch_url, so confirm result.branch_url is present and non-empty before using it. If it’s missing, fail closed: never fall back to the main connection string or any other configured URL.X-Idempotency-Key header with the create request; re-sending the same connector, service type, and name resumes the original request instead of creating a duplicate.
Create can fail with: 400 (a required field is missing), 409 (this create is already in flight, or the idempotency key was reused for a different request), 422 (the connector’s engine isn’t ready to branch), or 503 (Ardent could not start the work — retry).Authorizations
Ardent API key (sk-ard_live_… / sk-ard_test_…) or a dashboard session token.
Headers
Makes retries safe: re-sending the same connector, service type, and name resumes the original request instead of creating a duplicate.
Body
Body of POST /v1/branch/create.
Spec-only today: the handler parses the raw body by hand so a missing field keeps returning the documented 400, not Pydantic's 422. Keep the fields in sync with the hand parsing below.
Response
Create accepted. Poll GET /v1/operations/{operation_id} for the branch details. Idempotent replays carry an X-Idempotency-Replay: true response header.
Operation to poll at GET /v1/operations/{operation_id}.
ID of the resource being created or acted on (the branch ID for branch create).
Status at acceptance time.
pending, running, completed, failed The kind of work this operation tracks, for example branch_create.
connector_engine_setup, connector_reset, connector_deep_reset, connector_discovery, connector_delete, connector_secret_purge, connector_rollout, connector_replication_rollback, connector_debezium_cutover, connector_debezium_shadow_cleanup, environment_deploy, environment_destroy, branch_create, branch_delete