curl -N "https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/build-logs" \
-H "Authorization: Bearer runtm_xxx" \
-H "X-Organization-Id: org_abc123"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/build-logs",
headers={
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
},
stream=True,
)
for line in response.iter_lines():
if line:
text = line.decode("utf-8")
if text.startswith("data: "):
import json
event = json.loads(text[6:])
print(f"[{event['type']}] {event['message']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/build-logs",
{
headers: {
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
},
}
);
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const text = decoder.decode(value);
for (const line of text.split("\n")) {
if (line.startsWith("data: ")) {
const event = JSON.parse(line.slice(6));
console.log(`[${event.type}] ${event.message}`);
}
}
}
{"type": "status", "message": "Build started", "timestamp": "2026-05-09T21:00:00Z"}
{"type": "log", "message": "Cloning repository...", "timestamp": "2026-05-09T21:00:01Z"}
{"type": "log", "message": "Installing dependencies...", "timestamp": "2026-05-09T21:00:15Z"}
{"type": "log", "message": "Building template...", "timestamp": "2026-05-09T21:01:00Z"}
{"type": "complete", "message": "Build completed successfully", "timestamp": "2026-05-09T21:03:00Z"}
Builds
Build Logs
Stream current build logs via Server-Sent Events
GET
/
api
/
org-templates
/
{template_id}
/
build-logs
curl -N "https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/build-logs" \
-H "Authorization: Bearer runtm_xxx" \
-H "X-Organization-Id: org_abc123"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/build-logs",
headers={
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
},
stream=True,
)
for line in response.iter_lines():
if line:
text = line.decode("utf-8")
if text.startswith("data: "):
import json
event = json.loads(text[6:])
print(f"[{event['type']}] {event['message']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/build-logs",
{
headers: {
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
},
}
);
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const text = decoder.decode(value);
for (const line of text.split("\n")) {
if (line.startsWith("data: ")) {
const event = JSON.parse(line.slice(6));
console.log(`[${event.type}] ${event.message}`);
}
}
}
{"type": "status", "message": "Build started", "timestamp": "2026-05-09T21:00:00Z"}
{"type": "log", "message": "Cloning repository...", "timestamp": "2026-05-09T21:00:01Z"}
{"type": "log", "message": "Installing dependencies...", "timestamp": "2026-05-09T21:00:15Z"}
{"type": "log", "message": "Building template...", "timestamp": "2026-05-09T21:01:00Z"}
{"type": "complete", "message": "Build completed successfully", "timestamp": "2026-05-09T21:03:00Z"}
Streams the current build logs for a template as Server-Sent Events. If a build is in progress, logs are streamed in real-time. If the build is complete, historical logs are returned immediately.
Required scope:
templates:read
Path Parameters
string
required
The template ID (e.g.
tmpl_abc123).Headers
string
required
Bearer token. Example:
Bearer runtm_xxxstring
required
Organization ID.
Response
Returns atext/event-stream with log events. Each line is prefixed with data: and contains a JSON object.
string
Log entry type:
log, status, error, complete.string
Log message content.
string
ISO 8601 timestamp.
curl -N "https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/build-logs" \
-H "Authorization: Bearer runtm_xxx" \
-H "X-Organization-Id: org_abc123"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/build-logs",
headers={
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
},
stream=True,
)
for line in response.iter_lines():
if line:
text = line.decode("utf-8")
if text.startswith("data: "):
import json
event = json.loads(text[6:])
print(f"[{event['type']}] {event['message']}")
const response = await fetch(
"https://app.runtm.com/api/cloud/org-templates/tmpl_abc123/build-logs",
{
headers: {
"Authorization": "Bearer runtm_xxx",
"X-Organization-Id": "org_abc123",
},
}
);
const reader = response.body.getReader();
const decoder = new TextDecoder();
while (true) {
const { done, value } = await reader.read();
if (done) break;
const text = decoder.decode(value);
for (const line of text.split("\n")) {
if (line.startsWith("data: ")) {
const event = JSON.parse(line.slice(6));
console.log(`[${event.type}] ${event.message}`);
}
}
}
{"type": "status", "message": "Build started", "timestamp": "2026-05-09T21:00:00Z"}
{"type": "log", "message": "Cloning repository...", "timestamp": "2026-05-09T21:00:01Z"}
{"type": "log", "message": "Installing dependencies...", "timestamp": "2026-05-09T21:00:15Z"}
{"type": "log", "message": "Building template...", "timestamp": "2026-05-09T21:01:00Z"}
{"type": "complete", "message": "Build completed successfully", "timestamp": "2026-05-09T21:03:00Z"}