POST
Create a new service

Authorizations

Authorization
string
header
required

Bearer token for authentication. Format: 'Bearer {token}'

Headers

X-Workspace-Id
string

Workspace ID (uses default workspace if not provided)

Body

application/json

Create a new service

service_type
enum<string>
required

Service type: 'postgres' (PostgreSQL database), 'mysql' (MySQL database), 'valkey' (Valkey cache), 'shared_storage' (shared persistent volume)

Available options:
postgres,
mysql,
valkey,
shared_storage
project_id
string
required

UUID of the project to create the service in

label
string
required

Human-readable display name for the service

resource_id
string

UUID of the compute resource to provision the service on

miget_id
string

DEPRECATED: use resource_id instead

billing
enum<string>

Where it runs: 'resource' (default, on the resource named by resource_id), 'pay_per_use' (without a resource, paying for what it reserves while it runs; not on an enterprise contract) or 'workspace_pool' (without a resource, in an enterprise contract's pool; refused with 422 when the pool has no room)

Available options:
resource,
pay_per_use,
workspace_pool
region_code
string

Region to run in when billing is pay_per_use or workspace_pool, e.g. eu-east-1. Defaults to a region the workspace already runs in, or in a workspace with nothing placed yet to the first active region: send it when the region matters.

tier
enum<string>

With billing pay_per_use or workspace_pool, the CPU class: 'hobby' (shared CPU) or 'pro' (dedicated). Implied by size when one is named. Hobby and Pro workloads run in separate namespaces, so it cannot be changed afterwards. Ignored for shared_storage, which uses no CPU.

Available options:
hobby,
pro
ram_size
number<float>

RAM allocation in MiB (e.g., 64, 128, 256). On a resource only; a workload on Usage Billing or in the workspace pool takes size.

disk_size
number<float>

Disk storage in GiB (e.g., 1, 5, 10). For shared_storage 0.1 when not sent; under 100 MiB is refused.

cpu_size
number<float>

CPU allocation in cores (e.g., 0.1, 0.25, 0.5). On a resource only; a workload on Usage Billing or in the workspace pool takes size.

size
string

With billing pay_per_use or workspace_pool, one of the size codes from GET /api/v1/workspace/pay_per_use/sizes, e.g. hobby-1c-2g. cpu_size and ram_size are refused for such a workload.

public_access
boolean

Enable public internet access. Accepts true/false or '1'/'0'. For postgres, mysql and valkey types. A mysql or valkey service is reached on a random TCP port of the region's TCP endpoint, given in external_connection_url.

environment_variables
boolean

Automatically inject connection environment variables into parent application

instances
enum<integer>

Number of database instances (1 for standalone, 3/5/7 for HA cluster). For postgres type.

Available options:
1,
3,
5,
7
auto_sleep
boolean

Sleep when idle (default false), for a postgres service on Usage Billing: true lets the database sleep after a period without connections and wake on the next one. Refused for other types and on free compute, which always sleeps. Requires services:operate.

creation_mode
enum<string>

Creation mode: 'fresh' (new database, default), 'external_replica' (replica of external PostgreSQL). For postgres type.

Available options:
fresh,
external_replica
external_host
string

Hostname of the external PostgreSQL source database. Required for external_replica mode.

external_port
integer<int32>

Port of the external PostgreSQL source database. Required for external_replica mode.

auth_type
enum<string>

Authentication method for external replica: 'password' or 'tls'. Required for external_replica mode.

Available options:
password,
tls
replication_username
string

Username for replication connection to external database.

replication_password
string

Password for replication connection (password auth). Required when auth_type is 'password'.

ca_crt
string

CA certificate for TLS authentication. Required when auth_type is 'tls'.

tls_crt
string

TLS client certificate. Required when auth_type is 'tls'.

tls_key
string

TLS client key. Required when auth_type is 'tls'.

s3_enabled
boolean

Enable S3 WAL archive fallback. Accepts true/false or '1'/'0'. For external_replica mode.

s3_endpoint
string

S3 endpoint URL. Required when s3_enabled is true.

s3_bucket
string

S3 bucket name. Required when s3_enabled is true.

s3_path
string

S3 path prefix. Required when s3_enabled is true.

s3_access_key
string

S3 access key. Required when s3_enabled is true.

s3_secret_key
string

S3 secret key. Required when s3_enabled is true.

s3_server_name
string

Archive server name from barman-cloud-wal-archive. Required when s3_enabled is true.

storage_access
enum<string>

Access mode: 'RWO' (single node read-write), 'RWX' (multi-node read-write). For shared_storage type.

Available options:
RWO,
RWX
postgres_version
enum<string>

PostgreSQL major version. Required for postgres type.

Available options:
18,
17,
16,
15,
14,
13
mysql_version
enum<string>

MySQL major version. Required for mysql type.

Available options:
8.2,
8.0
valkey_version
enum<string>

Valkey version. Required for valkey type.

Available options:
7,
7.2
mount_point
string

Container mount path (e.g., /data). Required for shared_storage type.

Response

Create a new service

Api_V1_Entities_Service model

uuid
string
required

Service UUID

name
string
required

Service name

label
string
required

Display name

service_type
string
required

Service type (postgres, mysql, valkey, shared_storage)

state
string
required

Current state. While provisioning: pending, processing, creating, stopped. Once running, the live Kubernetes status: healthy (postgres/mysql/valkey), bound (storage), or running when the status is unavailable. Unhealthy: degraded, degradated, failing, lost, crashloopbackoff, failed

project_id
string
required

Associated project UUID

billing
enum<string>
required

Where it runs: 'resource' on its resource, 'pay_per_use' without a resource paying for what it reserves while it runs, 'workspace_pool' without a resource in an enterprise contract's pool

Available options:
resource,
pay_per_use,
workspace_pool
resource_id
string
required

Assigned resource UUID, the value POST /services accepts as resource_id; null unless billing is 'resource'

miget_id
string
required

DEPRECATED: use resource_id instead

ram_size
number<float>
required

RAM allocation in MiB, the unit POST and PUT /services accept, rounded to 6 decimal places. Read from the service add-on's quota. Null when the service has no add-on

disk_size
number<float>
required

Disk allocation in GiB, the unit POST and PUT /services accept, rounded to 6 decimal places. Read from the service add-on's quota. Null when the service has no add-on

cpu_size
number<float>
required

CPU allocation in cores, the unit POST and PUT /services accept. Read from the service add-on's quota. On a free plan, creating a postgres service stores 0.1 whatever cpu_size was sent; PUT stores the value sent. Null when the service has no add-on

public_access
boolean
required

Whether public internet access is enabled, as stored on the add-on and accepted by POST and PUT /services. Null for service types without the setting (shared_storage) or when the service has no add-on

instances
integer<int32>
required

Number of database instances (1 for standalone, 3, 5 or 7 for an HA cluster). Postgres only, null for other service types

postgres_version
string
required

PostgreSQL major version, as accepted by POST /services. Null for other service types

mount_point
string
required

Container mount path of the shared volume. shared_storage only, null for other service types

mounts
object[]
required

Applications mounting this shared storage service, one entry per mount created by POST /services/{id}/mount_app, limited to apps in projects you can access. Empty for other service types

Example:
auto_sleep
boolean
required

Whether the database hibernates when idle: a postgres service that is not a replica, on free compute or with auto_sleep set by PUT /services

backup_enabled
boolean
required

Postgres only, null for other service types or when the service has no add-on. The effective value the platform applies, as accepted by PUT /services: false on a free plan whatever was stored, otherwise the stored value, true when never set

scheduled_backup
string
required

Postgres only, null for other service types or when the service has no add-on. The effective backup schedule as a 6-field cron expression, as accepted by PUT /services: the stored schedule, or 0 0 3 * * * when none was set

created_at
string<date-time>
required

Creation timestamp

updated_at
string<date-time>
required

Last update timestamp

connection_details
object
required

Connection details for the service

Example: