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
}
'import requests
url = "https://app.miget.com/api/v1/stacks"
payload = {
"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
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://app.miget.com/api/v1/stacks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.miget.com/api/v1/stacks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.miget.com/api/v1/stacks"
payload := strings.NewReader("{\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"compose_path\": \"<string>\",\n \"credential_id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"new_project_name\": \"<string>\",\n \"new_project_description\": \"<string>\",\n \"env_var_overrides\": {},\n \"auto_populate_required_vars\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.miget.com/api/v1/stacks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"compose_path\": \"<string>\",\n \"credential_id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"new_project_name\": \"<string>\",\n \"new_project_description\": \"<string>\",\n \"env_var_overrides\": {},\n \"auto_populate_required_vars\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/stacks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"compose_path\": \"<string>\",\n \"credential_id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"new_project_name\": \"<string>\",\n \"new_project_description\": \"<string>\",\n \"env_var_overrides\": {},\n \"auto_populate_required_vars\": true\n}"
response = http.request(request)
puts response.read_body{
"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,
"region_code": "<string>",
"component_quantities": [
{
"code_name": "1gb-ram",
"quantity": 2
}
],
"assigned": true,
"project_ids": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"plan": {
"name": "<string>",
"code_name": "<string>",
"description": "<string>",
"plan_type": "<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"
}
}Create a stack
Creates a Docker Compose stack from a Git repository. The compose source is analyzed server-side, required environment variables are resolved from the supplied custom values and/or auto-populated, capacity is validated against the target resource, and the initial build is published. Call POST /stacks/analyze first to discover which required env vars need values.
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
}
'import requests
url = "https://app.miget.com/api/v1/stacks"
payload = {
"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
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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
})
};
fetch('https://app.miget.com/api/v1/stacks', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.miget.com/api/v1/stacks",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.miget.com/api/v1/stacks"
payload := strings.NewReader("{\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"compose_path\": \"<string>\",\n \"credential_id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"new_project_name\": \"<string>\",\n \"new_project_description\": \"<string>\",\n \"env_var_overrides\": {},\n \"auto_populate_required_vars\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.miget.com/api/v1/stacks")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"compose_path\": \"<string>\",\n \"credential_id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"new_project_name\": \"<string>\",\n \"new_project_description\": \"<string>\",\n \"env_var_overrides\": {},\n \"auto_populate_required_vars\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.miget.com/api/v1/stacks")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"repository_url\": \"<string>\",\n \"branch\": \"<string>\",\n \"resource_id\": \"<string>\",\n \"compose_path\": \"<string>\",\n \"credential_id\": \"<string>\",\n \"label\": \"<string>\",\n \"name\": \"<string>\",\n \"project_id\": \"<string>\",\n \"new_project_name\": \"<string>\",\n \"new_project_description\": \"<string>\",\n \"env_var_overrides\": {},\n \"auto_populate_required_vars\": true\n}"
response = http.request(request)
puts response.read_body{
"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,
"region_code": "<string>",
"component_quantities": [
{
"code_name": "1gb-ram",
"quantity": 2
}
],
"assigned": true,
"project_ids": [
"<string>"
],
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"plan": {
"name": "<string>",
"code_name": "<string>",
"description": "<string>",
"plan_type": "<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
Bearer token for authentication. Format: 'Bearer {token}'
Headers
Workspace ID (uses default workspace if not provided)
Body
Create a stack
Git repository URL (GitHub or public HTTPS Git)
Git branch to deploy
UUID of the target compute resource (Miget)
Path to the docker-compose file within the repository (defaults to '.')
UUID of a stored Git credential (for private repositories)
Human-readable display name for the stack
Stack codename seed (must start with a letter; derived from the repository if omitted)
UUID of an existing project to create the stack in
Name of a new project to create for the stack
Description for the new project
Custom required env var values, shaped as { service_name: { KEY: value } }
Random-fill any required env var left without a custom value (default false)
Response
Create a stack
Api_V1_Entities_Stack model
Unique stack identifier
Stack codename (unique per workspace)
Human-readable display name
Computed state (pending, validating, publishing, building, deploying, running, degraded, failed, stopped)
Associated project UUID
Path to the docker-compose file within the repository. Also returned by the list endpoint
Git deployment configuration: type (github for a stack with a credential, public_git without), repository (owner/repo slug for github, null for public_git), repository_url (the repository URL from creation as the platform stores it: public_git ends in .git, github is https://github.com//), branch, auto_deploy_enabled (null for public_git) and credential_id (UUID of the stored Git credential, null when none). Null when the stack has no deployment configuration
Total CPU allocated across stack services (cores)
Total RAM allocated across stack services, in bytes
Total disk allocated across stack services, in bytes
Creation timestamp
Last update timestamp
Api_V1_Entities_Resource model
Show child attributes
Show child attributes
Services materialized from the compose manifest
Show child attributes
Show child attributes
Api_V1_Entities_StackDeployment model
Show child attributes
Show child attributes

