curl --request GET \
--url https://api.tela.com/environment/versions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tela.com/environment/versions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tela.com/environment/versions', 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.tela.com/environment/versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.tela.com/environment/versions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.tela.com/environment/versions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/environment/versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"publicationId": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
"environmentId": "2f1c9a7e-3b4d-4e5f-8a6b-1c2d3e4f5a6b",
"environmentName": "staging",
"environmentIsSystem": false,
"versionId": "76065caa-c519-441a-8fe2-cc43e29664ab",
"promptId": "95cec438-6080-44fe-8275-28b16bd40178",
"title": "Contract analysis v3",
"promoted": false,
"draft": false,
"originVersionId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
"versionIndex": 3,
"createdBy": "jane@example.com",
"updatedBy": "jane@example.com",
"createdAt": "2025-06-02T15:40:00.000Z",
"updatedAt": "2025-06-03T10:12:45.000Z",
"publishedAt": "2025-06-03T10:12:45.000Z",
"publishedBy": "jane@example.com",
"unpublishedAt": null,
"isActive": true
},
{
"publicationId": "4c3b2a19-0e1f-4c8b-9a7f-5e4d3c2b1a09",
"environmentId": "2f1c9a7e-3b4d-4e5f-8a6b-1c2d3e4f5a6b",
"environmentName": "staging",
"environmentIsSystem": false,
"versionId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
"promptId": "95cec438-6080-44fe-8275-28b16bd40178",
"title": "Contract analysis v2",
"promoted": false,
"draft": false,
"originVersionId": null,
"versionIndex": 2,
"createdBy": "jane@example.com",
"updatedBy": "jane@example.com",
"createdAt": "2025-05-28T11:00:00.000Z",
"updatedAt": "2025-06-01T12:30:00.000Z",
"publishedAt": "2025-06-01T12:30:00.000Z",
"publishedBy": "jane@example.com",
"unpublishedAt": "2025-06-03T10:12:45.000Z",
"isActive": false
}
],
"meta": {
"totalCount": 2,
"limit": 20,
"offset": 0,
"currentPage": 1,
"totalPages": 1,
"links": {
"first": "?resourceType=prompt&resourceId=95cec438-6080-44fe-8275-28b16bd40178&envName=staging&limit=20&offset=0",
"last": "?resourceType=prompt&resourceId=95cec438-6080-44fe-8275-28b16bd40178&envName=staging&limit=20&offset=0",
"next": null,
"previous": null
}
}
}List environment publication history
Returns the publication history of one environment, newest publication first. Every time a version is published to the environment a new publication record is created and the previous one is marked unpublished, so the item with isActive: true (and unpublishedAt: null) is the version currently served by the environment.
curl --request GET \
--url https://api.tela.com/environment/versions \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.tela.com/environment/versions"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.tela.com/environment/versions', 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.tela.com/environment/versions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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.tela.com/environment/versions"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
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.tela.com/environment/versions")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tela.com/environment/versions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"publicationId": "5d4c3b2a-1f0e-4d9c-8b7a-6f5e4d3c2b1a",
"environmentId": "2f1c9a7e-3b4d-4e5f-8a6b-1c2d3e4f5a6b",
"environmentName": "staging",
"environmentIsSystem": false,
"versionId": "76065caa-c519-441a-8fe2-cc43e29664ab",
"promptId": "95cec438-6080-44fe-8275-28b16bd40178",
"title": "Contract analysis v3",
"promoted": false,
"draft": false,
"originVersionId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
"versionIndex": 3,
"createdBy": "jane@example.com",
"updatedBy": "jane@example.com",
"createdAt": "2025-06-02T15:40:00.000Z",
"updatedAt": "2025-06-03T10:12:45.000Z",
"publishedAt": "2025-06-03T10:12:45.000Z",
"publishedBy": "jane@example.com",
"unpublishedAt": null,
"isActive": true
},
{
"publicationId": "4c3b2a19-0e1f-4c8b-9a7f-5e4d3c2b1a09",
"environmentId": "2f1c9a7e-3b4d-4e5f-8a6b-1c2d3e4f5a6b",
"environmentName": "staging",
"environmentIsSystem": false,
"versionId": "1b2c3d4e-5f60-4718-9a2b-3c4d5e6f7a8b",
"promptId": "95cec438-6080-44fe-8275-28b16bd40178",
"title": "Contract analysis v2",
"promoted": false,
"draft": false,
"originVersionId": null,
"versionIndex": 2,
"createdBy": "jane@example.com",
"updatedBy": "jane@example.com",
"createdAt": "2025-05-28T11:00:00.000Z",
"updatedAt": "2025-06-01T12:30:00.000Z",
"publishedAt": "2025-06-01T12:30:00.000Z",
"publishedBy": "jane@example.com",
"unpublishedAt": "2025-06-03T10:12:45.000Z",
"isActive": false
}
],
"meta": {
"totalCount": 2,
"limit": 20,
"offset": 0,
"currentPage": 1,
"totalPages": 1,
"links": {
"first": "?resourceType=prompt&resourceId=95cec438-6080-44fe-8275-28b16bd40178&envName=staging&limit=20&offset=0",
"last": "?resourceType=prompt&resourceId=95cec438-6080-44fe-8275-28b16bd40178&envName=staging&limit=20&offset=0",
"next": null,
"previous": null
}
}
}Authorizations
Query Parameters
Environment name (production or a custom name).
Environment name. Lowercase letters, digits and single hyphens between segments (no leading, trailing
or consecutive hyphens), at most 64 characters. Leading/trailing whitespace is trimmed before validation.
production is the system environment every canvas has; it is the only reserved name you can publish to.
The names production, promoted, latest and draft are reserved and cannot be used for custom
environments, and a custom name cannot be a UUID.
The same rules apply to the environment_name field of POST /v2/chat/completions, which runs the
version currently published to that environment of the given canvas_id (environment_name cannot be
combined with version_id or application_id, and returns 404 when the environment does not exist or
has no published version).
64^[a-z0-9]+(?:-[a-z0-9]+)*$"staging"