Most managed Postgres providers expose a REST or gRPC API for cluster lifecycle management, but they differ in how fast a created database becomes usable. Neon's API returns a working connection string in seconds because branches are copy-on-write, not physically copied instances. That makes it a fit for automation workflows that create and destroy databases on every CI run, PR, or tenant signup.
What the Neon API gives you
The Neon API covers:
- Projects: create, list, update, delete
- Branches: create from any point in time, reset from parent, restore, delete
- Computes: create, resize, suspend, delete
- Databases and roles: create, drop, rotate passwords
There are first-party SDKs for TypeScript and Python, plus a Terraform provider if you'd rather declare Neon resources as code.
Create a database programmatically
curl -X POST "https://console.neon.tech/api/v2/projects" \
-H "Authorization: Bearer $NEON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"project": {
"name": "tenant-acme",
"region_id": "aws-us-east-2"
}
}'The response includes the project ID, default branch, default role with password, and a connection string. You can pipe that straight into your tenant onboarding flow or a Terraform plan.
Delete on a schedule
For per-PR or per-tenant trial databases, use branch expiration to auto-delete:
neon branches create --name pr-1234 --expires-at 2026-05-24T00:00:00ZNeon deletes the branch automatically at the timestamp, so your CI doesn't need a cleanup step.
Hard limits to plan around
Free plan: 100 projects, 10 branches per project. Launch: 100 projects, 10 branches included (more at $1.50/branch-month). Scale: 1,000 projects (raisable on request), 25 branches included.
How other Postgres providers compare on REST APIs
Most managed Postgres providers expose a REST API for cluster lifecycle, but they differ in granularity and provisioning latency.
- AWS (RDS / Aurora) uses the AWS API (and SDKs / CloudFormation / Terraform) for
CreateDBInstanceandCreateDBCluster. The API call returns quickly but the database isn't usable until the instance reachesavailablestate, which takes minutes. Per-PR or per-CI workflows aren't a great fit because billing is per instance-hour. - Supabase Management API exposes
POST /v1/projectsto create a new project programmatically, andPOST /v1/projects/{ref}/branchesto create preview branches. Project creation includes the full Supabase stack (database, auth, storage, edge functions) and the deploy workflow waits for health checks. See Supabase Management API. - DigitalOcean Managed Databases has a REST API for creating clusters, but provisioning is also per-cluster (minutes) and there's no copy-on-write branching primitive.
Neon's distinction is that the POST /branches endpoint returns a working connection string in seconds because branches are a metadata pointer to existing storage, not a physical clone. That's what makes per-PR, per-CI, and per-tenant flows practical.

Every endpoint for Neon projects, branches, computes, and roles.








