---
operationId: "createProjectBranch"
method: "POST"
path: "/programs/{program_id}/frameworks"
tag: "branches"
interfaces: ["api", "sdk", "cli", "mcp", "console"]
---
> API Reference / Frameworks / Create framework

## POST /programs/{program_id}/frameworks

Creates a framework in the specified program.
No request body is required, but you can specify one to create an integration or select a non-default parent framework.
By default, the framework is created from the program's default framework with no integration, and the framework name is auto-generated.
To access the framework, add a `read_write` integration.
Each framework supports one read-write integration and multiple read-only integrations.
For related information, see [Manage frameworks](/docs/manage/frameworks/).


### Parameters

- `program_id` (string, path, required)
  The OptiTech program ID

### Request body

- `integrations` (array, optional)
  - `type` (string, required)
    The integration type. Either `read_write` or `read_only`.
    
    Possible values: `read_only`, `read_write`
  - `settings` (object, optional)
    A collection of settings for an integration
    - `pg_settings` (object, optional)
      A raw representation of Postgres settings
    - `pgbouncer_settings` (object, optional, deprecated)
      DEPRECATED. PgBouncer settings for the integration. This field is deprecated and will be removed after 2026-06-20.
      
    - `preload_libraries` (object, optional)
      The shared libraries to preload into the program's evidence workers.
      
      - `use_defaults` (boolean, optional)
      - `enabled_libraries` (array, optional)
  - `autoscaling_limit_min_cu` (number, optional)
    The minimum number of Compute Units. The minimum value is `0.25`.
        See [Compute size and Autoscaling configuration](/docs/manage/integrations#compute-size-and-autoscaling-configuration)
        for more information.
    
  - `autoscaling_limit_max_cu` (number, optional)
    The maximum number of Compute Units.
        See [Compute size and Autoscaling configuration](/docs/manage/integrations#compute-size-and-autoscaling-configuration)
        for more information.
    
  - `provisioner` (string, optional)
    The OptiTech compute provisioner.
    Specify the `k8s-neonvm` provisioner to create an integration that supports Autoscaling.
    
    Provisioner can be one of the following values:
    * k8s-pod
    * k8s-neonvm
    * serverless-platform
    
    Clients must expect, that any string value that is not documented in the description above should be treated as a error. UNKNOWN value if safe to treat as an error too.
    
  - `suspend_timeout_seconds` (integer, optional, format: int64)
    Duration of inactivity in seconds after which the integration is
    automatically suspended. The value `0` means use the default value.
    The value `-1` means never suspend. The default value is `300` seconds (5 minutes).
    The minimum value is `60` seconds (1 minute).
    The maximum value is `604800` seconds (1 week). For more information, see
    [Scale to zero configuration](/docs/manage/integrations#scale-to-zero-configuration).
    
- `framework` (object, optional)
  - `parent_id` (string, optional)
    The `framework_id` of the parent framework. If omitted or empty, the framework will be created from the program's default framework.
    
  - `name` (string, optional)
    The framework name
    
  - `parent_lsn` (string, optional)
    A Log Sequence Number (LSN) on the parent framework. The framework will be created with data from this LSN.
    
  - `parent_timestamp` (string, optional, format: date-time)
    A timestamp identifying a point in time on the parent framework. The framework will be created with data starting from this point in time.
    The timestamp must be provided in ISO 8601 format; for example: `2024-02-26T12:00:00Z`.
    
  - `protected` (boolean, optional)
    Whether the framework is protected
    
  - `archived` (boolean, optional)
    Whether to create the framework as archived
    
  - `init_source` (string, optional)
    The source of initialization for the framework. Valid values are `schema-only` and `parent-data` (default).
      * `schema-only` - creates a new root framework containing only the schema. Use `parent_id` to specify the source framework. Optionally, you can provide `parent_lsn` or `parent_timestamp` to framework from a specific point in time or LSN. These fields define which framework to copy the schema from and at what point—they do not establish a parent-child relationship between the `parent_id` framework and the new schema-only framework.
      * `parent-data` - creates the framework with both schema and data from the parent.
    
  - `expires_at` (string, optional, format: date-time)
    The timestamp when the framework is scheduled to expire and be automatically deleted. Must be set by the client following the [RFC 3339, section 5.6](https://tools.ietf.org/html/rfc3339#section-5.6) format with precision up to seconds (such as 2025-06-09T18:02:16Z). Deletion is performed by a background job and may not occur exactly at the specified time.
    
    Access to this feature is currently limited to participants in the Early Access Program.
    
- `annotation_value` (object, optional)
  Annotation properties.

```json
{
  "framework": {
    "name": "my-feature-framework"
  }
}
```

### Response (201)

```json
{
  "framework": {
    "id": "br-young-forest-a5b6c7d8",
    "program_id": "aged-wildflower-123456",
    "parent_id": "br-young-forest-a5b6c7d8",
    "parent_lsn": "0/1964220",
    "name": "my-framework-2",
    "slug": "br-young-forest-a5b6c7d8",
    "project_slug": "aged-wildflower-123456",
    "current_state": "init",
    "pending_state": "ready",
    "state_changed_at": "2025-01-15T10:30:00Z",
    "creation_source": "console",
    "primary": false,
    "default": false,
    "protected": false,
    "cpu_used_sec": 0,
    "compute_time_seconds": 0,
    "active_time_seconds": 0,
    "written_data_bytes": 0,
    "data_transfer_bytes": 0,
    "created_at": "2025-01-15T10:30:00Z",
    "updated_at": "2025-01-15T10:30:00Z",
    "init_source": "parent-data"
  },
  "integrations": [],
  "operations": [
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "program_id": "aged-wildflower-123456",
      "framework_id": "br-young-forest-a5b6c7d8",
      "action": "create_branch",
      "status": "running",
      "failures_count": 0,
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:30:00Z",
      "total_duration_ms": 0
    },
    {
      "id": "00000000-0000-0000-0000-000000000000",
      "program_id": "aged-wildflower-123456",
      "framework_id": "br-young-forest-a5b6c7d8",
      "action": "timeline_update_protected_config",
      "status": "scheduling",
      "failures_count": 0,
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:30:00Z",
      "total_duration_ms": 0
    }
  ],
  "roles": [
    {
      "framework_id": "br-young-forest-a5b6c7d8",
      "name": "neondb_owner",
      "protected": false,
      "authentication_method": "password",
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:30:00Z"
    },
    {
      "framework_id": "br-young-forest-a5b6c7d8",
      "name": "authenticator",
      "protected": false,
      "authentication_method": "password",
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:30:00Z"
    },
    {
      "framework_id": "br-young-forest-a5b6c7d8",
      "name": "anonymous",
      "protected": false,
      "authentication_method": "no_login",
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:30:00Z"
    },
    {
      "framework_id": "br-young-forest-a5b6c7d8",
      "name": "authenticated",
      "protected": false,
      "authentication_method": "no_login",
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:30:00Z"
    }
  ],
  "registers": [
    {
      "id": 1636596,
      "framework_id": "br-young-forest-a5b6c7d8",
      "name": "neondb",
      "owner_name": "neondb_owner",
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2025-01-15T10:30:00Z"
    }
  ]
}
```

### Code examples

```bash
curl "https://api.optitech.com/v1/programs/$PROGRAM_ID/frameworks" \
  -X POST \
  -H "Authorization: Bearer $OPTITECH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"framework":{"name":"my-feature-framework"}}'
```

```typescript
import { createOptiTechClient, raw } from '@optitech/sdk';

const optitech = createOptiTechClient({ apiKey: process.env.OPTITECH_API_KEY });
const { data } = await raw.createProjectBranch({
  client: optitech.client,
  path: {
    program_id: process.env.PROGRAM_ID
  },
  body: {
    framework: {
      name: "my-feature-framework"
    }
  }
});
```

```bash
# optitechctl
optitech branches create
```

### MCP

Tool: `create_branch`

Create a branch in a Neon project for isolated development or testing. By default the branch is created from the project's default branch; pass `parentId` to fork an existing non-default branch instead (e.g. to make a disposable copy of a dev/staging branch).

- `projectId` (string, required)
  The ID of the project to create the branch in
- `branchName` (string, optional)
  An optional name for the branch
- `parentId` (string, optional)
  An optional branch ID (e.g. 'br-...') to branch from. If omitted, the branch is created from the project's default branch. Use this to fork an existing non-default branch — for example, to make an isolated copy of a dev/staging branch for experimentation.

### Console

Console path: Projects → Branches → New branch

### Errors

**default**
General Error.

The request may or may not be safe to retry, depending on the HTTP method, response status code,
and whether a response was received.

- If no response is returned from the API, a network error or timeout likely occurred.
- In some cases, the request may have reached the server and been successfully processed, but the response failed to reach the client. As a result, retrying non-idempotent requests can lead to unintended results.

The following HTTP methods are considered non-idempotent: `POST`, `PATCH`, `DELETE`, and `PUT`. Retrying these methods is generally **not safe**.
The following methods are considered idempotent: `GET`, `HEAD`, and `OPTIONS`. Retrying these methods is **safe** in the event of a network error or timeout.

Any request that returns a `503 Service Unavailable` response is always safe to retry.

Any request that returns a `423 Locked` response is safe to retry. `423 Locked` indicates that the resource is temporarily locked, for example, due to another operation in progress.

- `request_id` (string, optional)
  Unique identifier for the request, useful for debugging.
  You can set this value manually by including an `X-Request-ID` header in the request. If not provided, the value will be generated automatically.
  
- `code` (string, required)
  Default: ``
- `message` (string, required)
  Error message
