/APIs & SDKs/Programs/Create program
POST/programs

Create program

Creates an OptiTech program within an organization. If using a personal API key, include the org_id parameter to specify which organization to create the program in. If using an org API key, org_id is automatically inferred from the key. Plan limits define how many programs you can create. For more information, see Manage programs.

You can specify a region and Postgres version in the request body. Neon currently supports PostgreSQL 14, 15, 16, 17, and 18. For supported regions and region_id values, see Regions.

Markdown for AI context

Quick start

REST API - curl
curl "https://api.optitech.com/v1/programs" \
  -X POST \
  -H "Authorization: Bearer $OPTITECH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"program":{"name":"my-production-db","region_id":"aws-us-east-2","pg_version":17}}'
Also available in
optitech projects create --name my-production-db --region-id aws-us-east-2

Request body

Basics

commonly setprogram.*
4 fields

Name, location, and Postgres version. The handful most people set.

Program namecommonprogram.*
name
stringdefault: auto-generated

The program name. If not specified, the name will be identical to the generated program ID

≥1 chars, ≤256 chars

Region IDcommonprogram.*
region_id
string

The region identifier. Refer to our Regions documentation for supported regions. Values are specified in this format: aws-us-east-1

Postgres versioncommonprogram.*
pg_version
integerdefault: 17

The major Postgres version number. Generally available versions are 14, 15, 16, 17, and 18. 19 is being rolled out and is only accepted in regions where it has been enabled; requesting it in a region where it is not yet available returns an error.

141516171819

min: 14, max: 19

Organizationcommonprogram.*
org_id
stringdefault: personal account

Organization id in case the program created belongs to an organization. If not present, program is owned by a user and not by org.

Compute

program.*
6 fields

Autoscaling range and auto-suspend for the default endpoint.

Framework & register

program.framework.*
4 fields

The default framework and the first role and register created on it.

Program settings

program.*
11 fields

Security, compliance, quotas, retention, and maintenance.

Deprecated

program.*
2 fields

Response

201

Created a program. The program includes a connection URI with a register, password, and role. At least one non-protected role is created with a password. Wait until the operations are finished before attempting to connect to a program register.

Depth

Errors

default

General error

This endpoint can return the standard OptiTech API error response.

Response fields

  • message Required. Human-readable error message.
  • code Required. Machine-readable error code.
  • request_id Optional. Request identifier for debugging. You can provide one with the X-Request-ID header.

Retry guidance

If no response is returned, the request may still have reached the server. This is why retry safety depends on the method and status code.

Idempotent methods (GET, HEAD, OPTIONS) are generally safe to retry after a network error or timeout. Non-idempotent methods (POST, PATCH, DELETE, PUT) can change state, so avoid automatic retries unless your workflow can tolerate duplicate effects.

Responses with 423 Locked or 503 Service Unavailable are safe to retry. 423 Locked means the resource is temporarily locked, usually because another operation is in progress.

Was this page helpful?

On this page

Copy neon init command