Canonical: https://weaveos.com/reference/neon/create-neon-preview-branch

1. [Software capabilities](https://weaveos.com/reference)
2. /[Neon](https://weaveos.com/reference/neon)
3. /Create a Neon preview database branch

[![](https://weaveos.com/reference/logos/neon.svg)Neon](https://weaveos.com/reference/neon)

# Create a Neon preview database branch

Create a branch for preview or test data through Neon’s API or CLI. Add a read-write compute endpoint when the branch needs to accept connections.

Documentation reviewed November 27, 2026 · 2 methods with sources

## Ways to do it

1. [1API: POST /api/v2/projects/{project\_id}/branches](https://weaveos.com/reference/neon/create-neon-preview-branch#method-1)
2. [2CLI: neon branches create](https://weaveos.com/reference/neon/create-neon-preview-branch#method-2)

API

### POST /api/v2/projects/{project\_id}/branches

Create a branch in a Neon project from its default branch or a specified parent branch.

[Read source: Neon create project branch API](https://neon.com/docs/reference/api/branches/create-project-branch)

- Requirements

  A Neon API key authorized for the project and the project ID. Supply a parent branch ID when the default branch is not the intended source.

- Limitations

  The API creates a branch without a compute endpoint by default. Add a read-write endpoint before connecting; each branch supports one read-write endpoint and multiple read-only endpoints.

Example shell

Copy

```
curl --fail -X POST "https://console.neon.tech/api/v2/projects/$PROJECT_ID/branches" -H "Authorization: Bearer $NEON_API_KEY"
```

CLI

### neon branches create

Create a named branch with the Neon CLI and optionally connect to its new branch.

[Read source: Neon CLI branches](https://neon.com/docs/cli/branches)

- Requirements

  The Neon CLI authenticated with access to the target project, and a project ID or current project context.

- Limitations

  The CLI creates a read-write compute by default. Use Neon CLI 4.9.0 or later with --no-secrets to omit the connection string from output.

Example shell

Copy

```
neon branches create --project-id "$PROJECT_ID" --name preview-branch --no-secrets
```

## More from Neon

[View all 1 Neon tasks](https://weaveos.com/reference/neon)
