POST
/
api
/
v1
/
services
Create a new service
curl --request POST \
  --url https://app.miget.com/api/v1/services \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "service_type": "postgres",
  "project_id": 123,
  "miget_id": 123,
  "label": "<string>",
  "ram_size": 123,
  "disk_size": 123,
  "cpu_size": 123,
  "postgres_version": "<string>",
  "public_access": "0",
  "environment_variables": true,
  "mount_point": "<string>",
  "storage_access": "RWO"
}
'
{
  "uuid": "<string>",
  "name": "<string>",
  "label": "<string>",
  "service_type": "<string>",
  "project_id": "<string>",
  "miget_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

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), 'shared_storage' (shared persistent volume)

Available options:
postgres,
shared_storage
project_id
integer<int32>
required

ID of the project to create the service in

miget_id
integer<int32>
required

ID of the compute resource to provision the service on

label
string
required

Human-readable display name for the service

ram_size
number<float>

RAM allocation in MiB (e.g., 64, 128, 256)

disk_size
number<float>

Disk storage in GiB (e.g., 1, 5, 10)

cpu_size
number<float>

CPU allocation in cores (e.g., 0.1, 0.25, 0.5)

postgres_version
string

PostgreSQL version (e.g., '15', '16'). Only for postgres type.

public_access
enum<string>

Enable public internet access: '0' disabled, '1' enabled. For postgres type.

Available options:
0,
1
environment_variables
boolean

Automatically inject connection environment variables into parent application

mount_point
string

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

storage_access
enum<string>

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

Available options:
RWO,
RWX

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, shared_storage)

project_id
string
required

Associated project UUID

miget_id
string
required

Assigned resource UUID

created_at
string<date-time>
required

Creation timestamp

updated_at
string<date-time>
required

Last update timestamp