Neon API
Neon offers the most feature-complete API on the market for developers and agents that need to create, manage, and scale thousands of branches programmatically. An example of what you can do via the Neon API:
- Create a branch per PR, test run, or user/agent session
- Reset or delete branches
- Tracking compute time, data written, and storage usage at the branch level.
- Connect compute endpoints on demand
- Combine it with Neon’s hosted MCP server to manage branches in real time
POST /projects/{project_id}/branches
{
"branch": {
"name": "preview-pr-142",
"parent_id": "main"
}
}
Neon CLI
The Neon CLI lets you create, reset, and delete branches from the terminal or in scripts. deal for integrating into Git hooks, dev onboarding scripts, or CI setup steps.
# Create a new branch from main
neon branch create preview-pr-101 --parent main
# Reset a branch to match its parent
neon branch reset dev-bob
# Delete a branch
neon branch delete preview-pr-101
CI/CD
- GitHub integration. Automatically creates, resets, and deletes Neon branches in response to pull request actions using ready‑made GitHub Actions workflows.
- Vercel integration. Every Vercel preview deploy triggers a matching Neon branch, with DATABASE_URL injected automatically and seamless cleanup when previews end.
- Terraform [Community]. Manage branches with IaC.