Image Build Logs
curl --request GET \
--url https://api.vertracloud.app/v1/images/{image_id}/logsimport requests
url = "https://api.vertracloud.app/v1/images/{image_id}/logs"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.vertracloud.app/v1/images/{image_id}/logs', 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/images/{image_id}/logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/images/{image_id}/logs"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vertracloud.app/v1/images/{image_id}/logs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/images/{image_id}/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyevent: log
data: Step 1/6 : FROM node:22-slim
event: log
data: Step 2/6 : WORKDIR /srv
Docker Images
Image Build Logs
Streams the build log of an image as a text event stream.
GET
/
v1
/
images
/
{image_id}
/
logs
Image Build Logs
curl --request GET \
--url https://api.vertracloud.app/v1/images/{image_id}/logsimport requests
url = "https://api.vertracloud.app/v1/images/{image_id}/logs"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.vertracloud.app/v1/images/{image_id}/logs', 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/images/{image_id}/logs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.vertracloud.app/v1/images/{image_id}/logs"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.vertracloud.app/v1/images/{image_id}/logs")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vertracloud.app/v1/images/{image_id}/logs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyevent: log
data: Step 1/6 : FROM node:22-slim
event: log
data: Step 2/6 : WORKDIR /srv
Needs the
images:read scope when called with an API key.
string
required
The image ID.
string
The version whose build log to read. Absent: the latest build.
string
If the image belongs to a workspace, the workspace’s ID. Required for workspace members acting on an image they don’t own.
Response
The response is a Server-Sent Events stream (text/event-stream), not JSON. It first repeats the log that already came out and then follows the build live, with keep-alive heartbeats. Each log event carries one line of the build log as plain text. Up to 2 streams per image can be open at the same time. After the build ends, the log of the latest build and of each version stays available.
event: log
data: Step 1/6 : FROM node:22-slim
event: log
data: Step 2/6 : WORKDIR /srv
Error Responses
string
The error code indicating the reason for the failure. Possible values:
API_KEY_SCOPE_DENIED: The API key does not have the required scope (403).IMAGE_NOT_FOUND: The image does not exist or you cannot access it (404).IMAGE_VERSION_NOT_FOUND: The image has no version with thatversion_id(404).INTERNAL_SERVER_ERROR: Unexpected failure (500).
{
"code": "IMAGE_VERSION_NOT_FOUND"
}