Create Application from Image
curl --request POST \
--url https://api.vertracloud.app/v1/apps/image \
--header 'Content-Type: application/json' \
--data '
{
"image_id": "<string>",
"name": "<string>",
"memory": 123,
"description": "<string>",
"web": true,
"subdomain": "<string>",
"port": 123,
"envs": [
{}
],
"workspace_id": "<string>"
}
'import requests
url = "https://api.vertracloud.app/v1/apps/image"
payload = {
"image_id": "<string>",
"name": "<string>",
"memory": 123,
"description": "<string>",
"web": True,
"subdomain": "<string>",
"port": 123,
"envs": [{}],
"workspace_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
image_id: '<string>',
name: '<string>',
memory: 123,
description: '<string>',
web: true,
subdomain: '<string>',
port: 123,
envs: [{}],
workspace_id: '<string>'
})
};
fetch('https://api.vertracloud.app/v1/apps/image', 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://api.vertracloud.app/v1/apps/image",
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([
'image_id' => '<string>',
'name' => '<string>',
'memory' => 123,
'description' => '<string>',
'web' => true,
'subdomain' => '<string>',
'port' => 123,
'envs' => [
[
]
],
'workspace_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.vertracloud.app/v1/apps/image"
payload := strings.NewReader("{\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"memory\": 123,\n \"description\": \"<string>\",\n \"web\": true,\n \"subdomain\": \"<string>\",\n \"port\": 123,\n \"envs\": [\n {}\n ],\n \"workspace_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.vertracloud.app/v1/apps/image")
.header("Content-Type", "application/json")
.body("{\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"memory\": 123,\n \"description\": \"<string>\",\n \"web\": true,\n \"subdomain\": \"<string>\",\n \"port\": 123,\n \"envs\": [\n {}\n ],\n \"workspace_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/apps/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"memory\": 123,\n \"description\": \"<string>\",\n \"web\": true,\n \"subdomain\": \"<string>\",\n \"port\": 123,\n \"envs\": [\n {}\n ],\n \"workspace_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"response": {
"id": "app-abc123def456",
"name": "my-api-prod",
"status": "building",
"ram": 512,
"subdomain": "myapp.vertraweb.app",
"custom_image": {
"id": "app-abc123def456",
"name": "my-api-prod",
"version_id": null,
"outdated": false,
"image_id": "img-abc123def456",
"port": 3000
}
}
}
Applications
Create Application from Image
Creates an application that runs from a custom Docker image.
POST
/
v1
/
apps
/
image
Create Application from Image
curl --request POST \
--url https://api.vertracloud.app/v1/apps/image \
--header 'Content-Type: application/json' \
--data '
{
"image_id": "<string>",
"name": "<string>",
"memory": 123,
"description": "<string>",
"web": true,
"subdomain": "<string>",
"port": 123,
"envs": [
{}
],
"workspace_id": "<string>"
}
'import requests
url = "https://api.vertracloud.app/v1/apps/image"
payload = {
"image_id": "<string>",
"name": "<string>",
"memory": 123,
"description": "<string>",
"web": True,
"subdomain": "<string>",
"port": 123,
"envs": [{}],
"workspace_id": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
image_id: '<string>',
name: '<string>',
memory: 123,
description: '<string>',
web: true,
subdomain: '<string>',
port: 123,
envs: [{}],
workspace_id: '<string>'
})
};
fetch('https://api.vertracloud.app/v1/apps/image', 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://api.vertracloud.app/v1/apps/image",
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([
'image_id' => '<string>',
'name' => '<string>',
'memory' => 123,
'description' => '<string>',
'web' => true,
'subdomain' => '<string>',
'port' => 123,
'envs' => [
[
]
],
'workspace_id' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"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://api.vertracloud.app/v1/apps/image"
payload := strings.NewReader("{\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"memory\": 123,\n \"description\": \"<string>\",\n \"web\": true,\n \"subdomain\": \"<string>\",\n \"port\": 123,\n \"envs\": [\n {}\n ],\n \"workspace_id\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://api.vertracloud.app/v1/apps/image")
.header("Content-Type", "application/json")
.body("{\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"memory\": 123,\n \"description\": \"<string>\",\n \"web\": true,\n \"subdomain\": \"<string>\",\n \"port\": 123,\n \"envs\": [\n {}\n ],\n \"workspace_id\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/apps/image")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"image_id\": \"<string>\",\n \"name\": \"<string>\",\n \"memory\": 123,\n \"description\": \"<string>\",\n \"web\": true,\n \"subdomain\": \"<string>\",\n \"port\": 123,\n \"envs\": [\n {}\n ],\n \"workspace_id\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"response": {
"id": "app-abc123def456",
"name": "my-api-prod",
"status": "building",
"ram": 512,
"subdomain": "myapp.vertraweb.app",
"custom_image": {
"id": "app-abc123def456",
"name": "my-api-prod",
"version_id": null,
"outdated": false,
"image_id": "img-abc123def456",
"port": 3000
}
}
}
The image must be ready (
status: "success"). Several applications can share one image, each with its own variables. The language, version, main file, start and build commands do not apply: they come from the image. Needs the apps:write scope when called with an API key. See Custom Docker images.
string
required
The ID of the image the app runs from.
string
required
The application display name. Maximum 50 characters.
integer
required
The amount of RAM to allocate, in MB.
string
An application description.
boolean
required
true publishes the app on the web (subdomain and port apply). false creates an app without traffic, such as a bot or worker.string
The subdomain for the app. Send
random to let the platform pick one. Only with web: true.integer
The port the app listens on. Only with
web: true. Default: the first EXPOSE of the image’s Dockerfile, or 80. The platform injects it as the PORT environment variable.object[]
Environment variables, each with
key, value and an optional note. Maximum key length 255, maximum value length 3072, maximum note length 50.string
The workspace to associate with the application.
Response
Creation is asynchronous: the response is202 Accepted with the application in status: "building" and custom_image filled in (image_id, port, version_id, outdated). The application has the same fields as in Create Application. Follow it with Application Details until status is up or down.
{
"response": {
"id": "app-abc123def456",
"name": "my-api-prod",
"status": "building",
"ram": 512,
"subdomain": "myapp.vertraweb.app",
"custom_image": {
"id": "app-abc123def456",
"name": "my-api-prod",
"version_id": null,
"outdated": false,
"image_id": "img-abc123def456",
"port": 3000
}
}
}
Error Responses
string
The error code indicating the reason for the failure. Possible values:
API_KEY_SCOPE_DENIED: The API key does not have theapps:writescope (403).VALIDATION_ERROR: The body failed validation (400).IMAGE_NOT_FOUND: The image does not exist or you cannot access it (404).IMAGE_NOT_READY: The image has no successful build yet (409).MAX_APPS_REACHED: The plan’s application limit was reached (403).MEMORY_BELOW_MINIMUM,MEMORY_LIMIT_EXCEEDED: The memory is below the minimum or above what the plan still has (400).SUBDOMAIN_TAKEN,SUBDOMAIN_FORBIDDEN: The subdomain is in use or reserved (409,400).PLAN_DOES_NOT_SUPPORT_WEB_PUBLISH:web: trueon a plan without web publishing (403).DEPLOY_RATE_LIMITED: The account’s hourly deploy budget was reached (429).INTERNAL_SERVER_ERROR: Unexpected failure (500).
{
"code": "IMAGE_NOT_READY"
}