Skip to main content
POST
/
database
/
v1
/
projects
/
{id}
/
branches
Create database branch
curl --request POST \
  --url https://api.case.dev/database/v1/projects/{id}/branches \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "staging",
  "parentBranchId": "branch_main_123"
}
'
{
  "id": "branch_staging_456",
  "name": "staging",
  "parentBranchId": "branch_main_123",
  "isDefault": false,
  "status": "active",
  "createdAt": "2025-01-15T10:30:00Z"
}

Authorizations

Authorization
string
header
required

API key starting with sk_case_

Path Parameters

id
string
required

Database project ID

Body

application/json
name
string
required

Branch name (letters, numbers, hyphens, underscores only)

parentBranchId
string

Parent branch ID to clone from (defaults to main branch)

Response

Branch created successfully

id
string
required

Branch ID

name
string
required

Branch name

parentBranchId
string | null
required

Parent branch ID

isDefault
boolean
required

Whether this is the default branch (always false for new branches)

status
string
required

Branch status

createdAt
string<date-time>
required

Branch creation timestamp