> ## Documentation Index
> Fetch the complete documentation index at: https://deepline.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# ClickHouse Cloud: Clickhouse Postgres Service Create

> Create a Postgres service in ClickHouse Cloud with a version, size, region and high availability. Includes inputs, outputs, SDK V2 examples, and Deepline cost.

Create a Postgres service in ClickHouse Cloud with a version, size, region and high availability.

> [!NOTE]
>
> Tool ID: `clickhouse_postgres_service_create`

## Run this action

Use the TypeScript SDK for one call. Use `ctx.tools.execute(...)` inside a Play for durable calls, scheduled calls, or CSV processing.

```ts theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
import { Deepline } from 'deepline';

const deepline = await Deepline.connect();
const result = await deepline.tools.execute(
  'clickhouse_postgres_service_create',
  {
    "organizationId": "123e4567-e89b-42d3-a456-426614174000",
    "name": "Example",
    "provider": "aws",
    "region": "example",
    "size": "c6gd.large"
  },
);

console.log(result.toolResponse.raw);
```

### CLI

```bash theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
deepline tools execute clickhouse_postgres_service_create --input '{
  "organizationId": "123e4567-e89b-42d3-a456-426614174000",
  "name": "Example",
  "provider": "aws",
  "region": "example",
  "size": "c6gd.large"
}' --json
```

## Example response

The SDK returns this shape at `result.toolResponse.raw`. The example values illustrate the response.

```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
{
  "data": {
    "status": 123,
    "requestId": "123e4567-e89b-42d3-a456-426614174000",
    "result": {
      "name": "Example",
      "provider": "aws",
      "region": "example"
    }
  }
}
```

Use `deepline describe clickhouse_postgres_service_create --json` for the latest machine-readable contract.

## Input reference

**This endpoint is in beta.** API contract is stable, and no breaking changes are expected in the future. Creates a new Postgres service in the organization and returns it. The service is started asynchronously.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `payload.organizationId` | `string` | Yes | — | ID of the organization that will own the service. Format: `uuid`. |
| `payload.name` | `string` | Yes | — | Name of the Postgres service. Alphanumerical string with whitespaces up to 50 characters. Minimum length: 1. Maximum length: 50. |
| `payload.provider` | `"aws"` | Yes | — | The cloud provider for a Postgres service. Allowed: `aws`. |
| `payload.region` | `string` | Yes | — | The cloud region for a Postgres service. |
| `payload.postgresVersion` | `"18" \| "17"` | No | — | Allowed: `18`, `17`. |
| `payload.size` | `"c6gd.large" \| "c6gd.xlarge" \| "c6gd.2xlarge" \| "c6gd.4xlarge" \| "c6gd.8xlarge" \| "c6gd.16xlarge" \| "i7i.large" \| "i7i.xlarge" \| "i7i.2xlarge" \| "i7i.4xlarge" \| "i7i.8xlarge" \| "i7i.12xlarge" \| "i7i.16xlarge" \| "i7i.24xlarge" \| "i7ie.large" \| "i7ie.xlarge" \| "i7ie.2xlarge" \| "i7ie.3xlarge" \| "i7ie.6xlarge" \| "i7ie.12xlarge" \| "i7ie.18xlarge" \| "i7ie.24xlarge" \| "i8g.large" \| "i8g.xlarge" \| "i8g.2xlarge" \| "i8g.4xlarge" \| "i8g.8xlarge" \| "i8g.16xlarge" \| "i8g.24xlarge" \| "i8ge.large" \| "i8ge.xlarge" \| "i8ge.2xlarge" \| "i8ge.3xlarge" \| "i8ge.6xlarge" \| "i8ge.12xlarge" \| "i8ge.18xlarge" \| "i8ge.24xlarge" \| "m6gd.large" \| "m6gd.xlarge" \| "m6gd.2xlarge" \| "m6gd.4xlarge" \| "m6gd.8xlarge" \| "m6gd.16xlarge" \| "m6id.large" \| "m6id.xlarge" \| "m6id.2xlarge" \| "m6id.4xlarge" \| "m6id.8xlarge" \| "m6id.16xlarge" \| "m8gd.large" \| "m8gd.xlarge" \| "m8gd.2xlarge" \| "m8gd.4xlarge" \| "m8gd.8xlarge" \| "m8gd.16xlarge" \| "r6gd.medium" \| "r6gd.large" \| "r6gd.xlarge" \| "r6gd.2xlarge" \| "r6gd.4xlarge" \| "r6gd.8xlarge" \| "r6gd.12xlarge" \| "r6gd.16xlarge" \| "r6id.large" \| "r6id.xlarge" \| "r6id.2xlarge" \| "r6id.4xlarge" \| "r6id.8xlarge" \| "r6id.12xlarge" \| "r6id.16xlarge" \| "r6id.24xlarge" \| "r6id.32xlarge" \| "r8gd.medium" \| "r8gd.large" \| "r8gd.xlarge" \| "r8gd.2xlarge" \| "r8gd.4xlarge" \| "r8gd.8xlarge" \| "r8gd.12xlarge" \| "r8gd.16xlarge" \| "r8gd.24xlarge" \| "r8gd.48xlarge"` | Yes | — | The VM size for a Postgres service. Allowed: `c6gd.large`, `c6gd.xlarge`, `c6gd.2xlarge`, `c6gd.4xlarge`, `c6gd.8xlarge`, `c6gd.16xlarge`, `i7i.large`, `i7i.xlarge`, `i7i.2xlarge`, `i7i.4xlarge`, `i7i.8xlarge`, `i7i.12xlarge`, `i7i.16xlarge`, `i7i.24xlarge`, `i7ie.large`, `i7ie.xlarge`, `i7ie.2xlarge`, `i7ie.3xlarge`, `i7ie.6xlarge`, `i7ie.12xlarge`, `i7ie.18xlarge`, `i7ie.24xlarge`, `i8g.large`, `i8g.xlarge`, `i8g.2xlarge`, `i8g.4xlarge`, `i8g.8xlarge`, `i8g.16xlarge`, `i8g.24xlarge`, See the live schema for the complete constraint. |
| `payload.haType` | `"none" \| "async" \| "sync"` | No | — | Type of high availability: “none” for no replication, “async” for asynchronous replication to a single standby, and “sync” for synchronous replication to two standbys. Allowed: `none`, `async`, `sync`. |
| `payload.tags` | `array` | No | — | Tags associated with the Postgres service. Tag keys starting with “chc\_” are reserved for internal use. Maximum items: 50. |
| `payload.pgConfig` | `object` | No | — | Postgres [runtime configuration](https://www.postgresql.org/docs/current/runtime-config.html) configuration. |
| `payload.pgBouncerConfig` | `record` | No | — | PgBouncer [runtime configuration](https://www.pgbouncer.org/config.html) configuration. |

> [!NOTE]
>
> This input schema is too large for an inline display. Read the complete live contract with `deepline describe clickhouse_postgres_service_create --json`.

## Output reference

Standard tool result payload.

| Name | Type | Required | Default | Details |
| - | - | - | - | - |
| `result.data` | `object` | Yes | — | Provider response payload. |
| `result.data.status` | `number` | No | — | HTTP status code. |
| `result.data.requestId` | `string` | No | — | Unique id assigned to every request. UUIDv4 Format: `uuid`. |
| `result.data.result` | `object` | No | — | — |
| `result.data.result.name` | `string` | No | — | Name of the Postgres service. Alphanumerical string with whitespaces up to 50 characters. Minimum length: 1. Maximum length: 50. |
| `result.data.result.provider` | `"aws"` | No | — | The cloud provider for a Postgres service. Allowed: `aws`. |
| `result.data.result.region` | `string` | No | — | The cloud region for a Postgres service. |
| `result.data.result.postgresVersion` | `"18" \| "17"` | No | — | Allowed: `18`, `17`. |
| `result.data.result.size` | `"c6gd.large" \| "c6gd.xlarge" \| "c6gd.2xlarge" \| "c6gd.4xlarge" \| "c6gd.8xlarge" \| "c6gd.16xlarge" \| "i7i.large" \| "i7i.xlarge" \| "i7i.2xlarge" \| "i7i.4xlarge" \| "i7i.8xlarge" \| "i7i.12xlarge" \| "i7i.16xlarge" \| "i7i.24xlarge" \| "i7ie.large" \| "i7ie.xlarge" \| "i7ie.2xlarge" \| "i7ie.3xlarge" \| "i7ie.6xlarge" \| "i7ie.12xlarge" \| "i7ie.18xlarge" \| "i7ie.24xlarge" \| "i8g.large" \| "i8g.xlarge" \| "i8g.2xlarge" \| "i8g.4xlarge" \| "i8g.8xlarge" \| "i8g.16xlarge" \| "i8g.24xlarge" \| "i8ge.large" \| "i8ge.xlarge" \| "i8ge.2xlarge" \| "i8ge.3xlarge" \| "i8ge.6xlarge" \| "i8ge.12xlarge" \| "i8ge.18xlarge" \| "i8ge.24xlarge" \| "m6gd.large" \| "m6gd.xlarge" \| "m6gd.2xlarge" \| "m6gd.4xlarge" \| "m6gd.8xlarge" \| "m6gd.16xlarge" \| "m6id.large" \| "m6id.xlarge" \| "m6id.2xlarge" \| "m6id.4xlarge" \| "m6id.8xlarge" \| "m6id.16xlarge" \| "m8gd.large" \| "m8gd.xlarge" \| "m8gd.2xlarge" \| "m8gd.4xlarge" \| "m8gd.8xlarge" \| "m8gd.16xlarge" \| "r6gd.medium" \| "r6gd.large" \| "r6gd.xlarge" \| "r6gd.2xlarge" \| "r6gd.4xlarge" \| "r6gd.8xlarge" \| "r6gd.12xlarge" \| "r6gd.16xlarge" \| "r6id.large" \| "r6id.xlarge" \| "r6id.2xlarge" \| "r6id.4xlarge" \| "r6id.8xlarge" \| "r6id.12xlarge" \| "r6id.16xlarge" \| "r6id.24xlarge" \| "r6id.32xlarge" \| "r8gd.medium" \| "r8gd.large" \| "r8gd.xlarge" \| "r8gd.2xlarge" \| "r8gd.4xlarge" \| "r8gd.8xlarge" \| "r8gd.12xlarge" \| "r8gd.16xlarge" \| "r8gd.24xlarge" \| "r8gd.48xlarge"` | No | — | The VM size for a Postgres service. Allowed: `c6gd.large`, `c6gd.xlarge`, `c6gd.2xlarge`, `c6gd.4xlarge`, `c6gd.8xlarge`, `c6gd.16xlarge`, `i7i.large`, `i7i.xlarge`, `i7i.2xlarge`, `i7i.4xlarge`, `i7i.8xlarge`, `i7i.12xlarge`, `i7i.16xlarge`, `i7i.24xlarge`, `i7ie.large`, `i7ie.xlarge`, `i7ie.2xlarge`, `i7ie.3xlarge`, `i7ie.6xlarge`, `i7ie.12xlarge`, `i7ie.18xlarge`, `i7ie.24xlarge`, `i8g.large`, `i8g.xlarge`, `i8g.2xlarge`, `i8g.4xlarge`, `i8g.8xlarge`, `i8g.16xlarge`, `i8g.24xlarge`, See the live schema for the complete constraint. |
| `result.data.result.haType` | `"none" \| "async" \| "sync"` | No | — | Type of high availability: “none” for no replication, “async” for asynchronous replication to a single standby, and “sync” for synchronous replication to two standbys. Allowed: `none`, `async`, `sync`. |
| `result.data.result.tags` | `array` | No | — | Tags associated with the Postgres service. Tag keys starting with “chc\_” are reserved for internal use. Maximum items: 50. |
| `result.data.result.tags[].key` | `string` | Yes | — | Tag key. Must be alphanumeric with dashes, underscores and dots. Minimum length: 1. Maximum length: 128. Pattern: `^[a-zA-Z0-9._-]+$`. |
| `result.data.result.tags[].value` | `string` | No | — | Tag value. Must be alphanumeric with dashes, underscores and dots. Maximum length: 256. Pattern: `^[a-zA-Z0-9._-]+$`. |
| `result.data.result.id` | `string` | No | — | Format: `uuid`. |
| `result.data.result.storageSize` | `integer` | No | — | The storage size, in GiB, which must be supported by the specified `size`. |
| `result.data.result.state` | `"creating" \| "restarting" \| "running" \| "replaying_wal" \| "restoring_backup" \| "finalizing_restore" \| "unavailable" \| "stopped" \| "deleting"` | No | — | Current state of the service Allowed: `creating`, `restarting`, `running`, `replaying_wal`, `restoring_backup`, `finalizing_restore`, `unavailable`, `stopped`, `deleting`. |
| `result.data.result.createdAt` | `string` | No | — | Format: `date-time`. |
| `result.data.result.isPrimary` | `boolean` | No | `false` | True if this service is the primary service in the data warehouse |
| `result.data.result.connectionString` | `string` | No | — | Connection string to the Postgres service. Embeds the service password, so it is only returned when the service is created or its password is reset. Omitted from every other response when Postgres credential redaction is enabled for the organization. Not guaranteed to be present — treat as optional. |
| `result.data.result.username` | `string` | No | — | Username for the Postgres service |
| `result.data.result.password` | `string` | No | — | Password for the Postgres service. Only returned when the service is created or its password is reset. Omitted from every other response when Postgres credential redaction is enabled for the organization. Not guaranteed to be present — treat as optional. |
| `result.data.result.hostname` | `string` | No | — | Hostname for the Postgres service |
| `result.meta` | `object` | No | — | Additional response metadata (status, paging). |

<details>
  <summary>Show raw output schema</summary>

  ### Output JSON Schema

  ```json theme={"languages":{"custom":["/languages/deepline-prompt.json"]}}
  {
    "type": "object",
    "description": "Standard tool result payload.",
    "properties": {
      "data": {
        "type": "object",
        "description": "Provider response payload.",
        "properties": {
          "status": {
            "type": "number",
            "description": "HTTP status code."
          },
          "requestId": {
            "type": "string",
            "description": "Unique id assigned to every request. UUIDv4",
            "format": "uuid"
          },
          "result": {
            "properties": {
              "name": {
                "type": "string",
                "description": "Name of the Postgres service. Alphanumerical string with whitespaces up to 50 characters.",
                "minLength": 1,
                "maxLength": 50
              },
              "provider": {
                "type": "string",
                "description": "The cloud provider for a Postgres service.",
                "enum": [
                  "aws"
                ]
              },
              "region": {
                "type": "string",
                "description": "The cloud region for a Postgres service."
              },
              "postgresVersion": {
                "type": "string",
                "enum": [
                  "18",
                  "17"
                ]
              },
              "size": {
                "type": "string",
                "description": "The VM size for a Postgres service.",
                "enum": [
                  "c6gd.large",
                  "c6gd.xlarge",
                  "c6gd.2xlarge",
                  "c6gd.4xlarge",
                  "c6gd.8xlarge",
                  "c6gd.16xlarge",
                  "i7i.large",
                  "i7i.xlarge",
                  "i7i.2xlarge",
                  "i7i.4xlarge",
                  "i7i.8xlarge",
                  "i7i.12xlarge",
                  "i7i.16xlarge",
                  "i7i.24xlarge",
                  "i7ie.large",
                  "i7ie.xlarge",
                  "i7ie.2xlarge",
                  "i7ie.3xlarge",
                  "i7ie.6xlarge",
                  "i7ie.12xlarge",
                  "i7ie.18xlarge",
                  "i7ie.24xlarge",
                  "i8g.large",
                  "i8g.xlarge",
                  "i8g.2xlarge",
                  "i8g.4xlarge",
                  "i8g.8xlarge",
                  "i8g.16xlarge",
                  "i8g.24xlarge",
                  "i8ge.large",
                  "i8ge.xlarge",
                  "i8ge.2xlarge",
                  "i8ge.3xlarge",
                  "i8ge.6xlarge",
                  "i8ge.12xlarge",
                  "i8ge.18xlarge",
                  "i8ge.24xlarge",
                  "m6gd.large",
                  "m6gd.xlarge",
                  "m6gd.2xlarge",
                  "m6gd.4xlarge",
                  "m6gd.8xlarge",
                  "m6gd.16xlarge",
                  "m6id.large",
                  "m6id.xlarge",
                  "m6id.2xlarge",
                  "m6id.4xlarge",
                  "m6id.8xlarge",
                  "m6id.16xlarge",
                  "m8gd.large",
                  "m8gd.xlarge",
                  "m8gd.2xlarge",
                  "m8gd.4xlarge",
                  "m8gd.8xlarge",
                  "m8gd.16xlarge",
                  "r6gd.medium",
                  "r6gd.large",
                  "r6gd.xlarge",
                  "r6gd.2xlarge",
                  "r6gd.4xlarge",
                  "r6gd.8xlarge",
                  "r6gd.12xlarge",
                  "r6gd.16xlarge",
                  "r6id.large",
                  "r6id.xlarge",
                  "r6id.2xlarge",
                  "r6id.4xlarge",
                  "r6id.8xlarge",
                  "r6id.12xlarge",
                  "r6id.16xlarge",
                  "r6id.24xlarge",
                  "r6id.32xlarge",
                  "r8gd.medium",
                  "r8gd.large",
                  "r8gd.xlarge",
                  "r8gd.2xlarge",
                  "r8gd.4xlarge",
                  "r8gd.8xlarge",
                  "r8gd.12xlarge",
                  "r8gd.16xlarge",
                  "r8gd.24xlarge",
                  "r8gd.48xlarge"
                ]
              },
              "haType": {
                "type": "string",
                "description": "Type of high availability: “none” for no replication, “async” for asynchronous replication to a single standby, and “sync” for synchronous replication to two standbys.",
                "enum": [
                  "none",
                  "async",
                  "sync"
                ]
              },
              "tags": {
                "type": "array",
                "description": "Tags associated with the Postgres service. Tag keys starting with “chc_” are reserved for internal use.",
                "maxItems": 50,
                "items": {
                  "type": "object",
                  "properties": {
                    "key": {
                      "type": "string",
                      "description": "Tag key. Must be alphanumeric with dashes, underscores and dots.",
                      "minLength": 1,
                      "maxLength": 128,
                      "pattern": "^[a-zA-Z0-9._-]+$"
                    },
                    "value": {
                      "type": "string",
                      "description": "Tag value. Must be alphanumeric with dashes, underscores and dots.",
                      "maxLength": 256,
                      "pattern": "^[a-zA-Z0-9._-]+$"
                    }
                  },
                  "required": [
                    "key"
                  ],
                  "additionalProperties": false
                }
              },
              "id": {
                "type": "string",
                "format": "uuid"
              },
              "storageSize": {
                "type": "integer",
                "description": "The storage size, in GiB, which must be supported by the specified `size`."
              },
              "state": {
                "type": "string",
                "description": "Current state of the service",
                "enum": [
                  "creating",
                  "restarting",
                  "running",
                  "replaying_wal",
                  "restoring_backup",
                  "finalizing_restore",
                  "unavailable",
                  "stopped",
                  "deleting"
                ]
              },
              "createdAt": {
                "type": "string",
                "format": "date-time"
              },
              "isPrimary": {
                "type": "boolean",
                "description": "True if this service is the primary service in the data warehouse",
                "default": false
              },
              "connectionString": {
                "type": "string",
                "description": "Connection string to the Postgres service. Embeds the service password, so it is only returned when the service is created or its password is reset. Omitted from every other response when Postgres credential redaction is enabled for the organization. Not guaranteed to be present — treat as optional."
              },
              "username": {
                "type": "string",
                "description": "Username for the Postgres service"
              },
              "password": {
                "type": "string",
                "description": "Password for the Postgres service. Only returned when the service is created or its password is reset. Omitted from every other response when Postgres credential redaction is enabled for the organization. Not guaranteed to be present — treat as optional."
              },
              "hostname": {
                "type": "string",
                "description": "Hostname for the Postgres service"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "meta": {
        "type": "object",
        "description": "Additional response metadata (status, paging).",
        "additionalProperties": true
      }
    },
    "required": [
      "data"
    ],
    "additionalProperties": false
  }
  ```
</details>

## Deepline cost

* Pricing model: `fixed` (per call).
* Estimated Deepline credits: `0` per pricing unit.
* Provider-native pricing may still exist outside Deepline credit billing.

## Related documentation

* [ClickHouse Cloud provider guide](https://deepline.com/docs/providers/clickhouse/guide.md)
* [SDK V2 quickstart](https://deepline.com/docs/sdk-v2/quickstart.md)
* [SDK reference](https://deepline.com/docs/sdk-v2/sdk-reference.md)
* [Run tools across a CSV](https://deepline.com/docs/sdk-v2/batch-csv.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.