POST
/
api
/
v1
/
stacks
Create a stack
curl --request POST \
  --url https://app.miget.com/api/v1/stacks \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "repository_url": "<string>",
  "branch": "<string>",
  "resource_id": "<string>",
  "compose_path": "<string>",
  "credential_id": "<string>",
  "label": "<string>",
  "name": "<string>",
  "project_id": "<string>",
  "new_project_name": "<string>",
  "new_project_description": "<string>",
  "env_var_overrides": {},
  "auto_populate_required_vars": true
}
'
{
  "uuid": "<string>",
  "name": "<string>",
  "label": "<string>",
  "state": "<string>",
  "project_id": "<string>",
  "compose_path": "<string>",
  "deployment_config": {},
  "total_cpu_size": 123,
  "total_ram_size": 123,
  "total_disk_size": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "miget": {
    "uuid": "<string>",
    "name": "<string>",
    "state": "<string>",
    "labels": [
      "<string>"
    ],
    "total_disk_size": 123,
    "total_ram_size": 123,
    "total_cpu_size": 123,
    "total_used_disk_size": 123,
    "total_used_ram_size": 123,
    "total_used_cpu_size": 123,
    "available_cpu_size": 123,
    "available_disk_size": 123,
    "available_ram_size": 123,
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z",
    "plan": {
      "name": "<string>",
      "code_name": "<string>",
      "description": "<string>",
      "ram_size": 123,
      "disk_size": 123,
      "cpu_size": 123,
      "unit_price": 123
    },
    "components": [
      {
        "name": "<string>",
        "code_name": "<string>",
        "unit_price": 123
      }
    ]
  },
  "services": [
    {
      "compose_service_name": "<string>",
      "compose_service_type": "<string>",
      "status": "<string>",
      "item_type": "<string>",
      "item_uuid": "<string>",
      "item_name": "<string>"
    }
  ],
  "latest_deployment": {
    "uuid": "<string>",
    "state": "<string>",
    "subevent": "<string>",
    "commit_sha": "<string>",
    "validation_errors": {},
    "published_at": "2023-11-07T05:31:56Z",
    "completed_at": "2023-11-07T05:31:56Z",
    "created_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 stack

repository_url
string
required

Git repository URL (GitHub or public HTTPS Git)

branch
string
required

Git branch to deploy

resource_id
string
required

UUID of the target compute resource (Miget)

compose_path
string

Path to the docker-compose file within the repository (defaults to '.')

credential_id
string

UUID of a stored Git credential (for private repositories)

label
string

Human-readable display name for the stack

name
string

Stack codename seed (must start with a letter; derived from the repository if omitted)

project_id
string

UUID of an existing project to create the stack in

new_project_name
string

Name of a new project to create for the stack

new_project_description
string

Description for the new project

env_var_overrides
object

Custom required env var values, shaped as { service_name: { KEY: value } }

auto_populate_required_vars
boolean

Random-fill any required env var left without a custom value (default false)

Response

Create a stack

Api_V1_Entities_Stack model

uuid
string
required

Unique stack identifier

name
string
required

Stack codename (unique per workspace)

label
string
required

Human-readable display name

state
string
required

Computed state (pending, validating, publishing, building, deploying, running, degraded, failed, stopped)

project_id
string
required

Associated project UUID

compose_path
string
required

Path to the docker-compose file within the repository

deployment_config
object
required

Git deployment configuration (type, repository, branch, auto_deploy_enabled)

total_cpu_size
number<float>
required

Total CPU allocated across stack services (cores)

total_ram_size
integer<int32>
required

Total RAM allocated across stack services (MiB)

total_disk_size
integer<int32>
required

Total disk allocated across stack services (MiB)

created_at
string<date-time>
required

Creation timestamp

updated_at
string<date-time>
required

Last update timestamp

miget
object
required

Api_V1_Entities_Resource model

services
object[]
required

Services materialized from the compose manifest

latest_deployment
object
required

Api_V1_Entities_StackDeployment model