List template builds
curl --request GET \
--url https://api.e2b.app/templates/{templateID}/builds \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.e2b.app/templates/{templateID}/builds"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.e2b.app/templates/{templateID}/builds', 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.e2b.app/templates/{templateID}/builds",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.e2b.app/templates/{templateID}/builds"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.e2b.app/templates/{templateID}/builds")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.e2b.app/templates/{templateID}/builds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"buildID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "building",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"cpuCount": 2,
"memoryMB": 129,
"tags": [
"<string>"
],
"finishedAt": "2023-11-07T05:31:56Z",
"maxCpuCount": 2,
"diskSizeMB": 1,
"envdVersion": "<string>"
}
]
Templates
List template builds
List the builds of a template, newest first. The template is given by its ID or name. A template named aliases is given by its ID or by its name with the team prefix. Give a namespaced name as team/name with the slash encoded as %2F, for example my-team%2Fmy-template. Returns 100 builds per page by default. Pass the X-Next-Token response header as nextToken to get the next page. A tag points at the latest ready build it was assigned to, so a pending or failed rebuild carries no tag. A reference with a tag (for example my-template:v2) returns 400. A template that is missing, deleted or owned by another team returns 404.
GET
/
templates
/
{templateID}
/
builds
List template builds
curl --request GET \
--url https://api.e2b.app/templates/{templateID}/builds \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.e2b.app/templates/{templateID}/builds"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.e2b.app/templates/{templateID}/builds', 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.e2b.app/templates/{templateID}/builds",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <api-key>"
],
]);
$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.e2b.app/templates/{templateID}/builds"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<api-key>")
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.e2b.app/templates/{templateID}/builds")
.header("X-API-Key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.e2b.app/templates/{templateID}/builds")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<api-key>'
response = http.request(request)
puts response.read_body[
{
"buildID": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "building",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"cpuCount": 2,
"memoryMB": 129,
"tags": [
"<string>"
],
"finishedAt": "2023-11-07T05:31:56Z",
"maxCpuCount": 2,
"diskSizeMB": 1,
"envdVersion": "<string>"
}
]
Query Parameters
Response
Successfully returned the template builds
Was this page helpful?