Automation

Read run logs

Return a log page within the 30-day retention window by default.

Return a log page within the 30-day retention window by default. Accept: text/event-stream opens a live stream using event: log; id is the resume cursor and Last-Event-ID takes precedence over cursor. : ping arrives every 20 seconds and event: end closes the stream after a terminal run.

GET /automation/v1/runs/{id}/logs

Authentication

Authorization: Bearer $PRAXIS_API_KEY

Request fields

ParameterTypeDescription
path: idstringrequired; Run ID (run_).
query: limitintegeroptional; Run ledger page size: integer 1–200, default 50; other collections are capped at 100. minimum: 1; maximum: 200
query: cursorstringoptional; Opaque next_cursor from the previous page; keep the original filters when paging.
header: Accept"application/json" / "text/event-stream"optional; application/json (default) reads a ledger page; text/event-stream subscribes to the live stream.
header: Last-Event-IDstringoptional; SSE resume cursor; read entries after this event. Takes precedence over cursor and applies only to streams.

Examples

Set these environment variables to your own resources:

: "${RUN_ID:?Set RUN_ID}"
curl --fail-with-body -X GET "https://api.deepraxis.ai/automation/v1/runs/${RUN_ID}/logs" \
  -H "Authorization: Bearer $PRAXIS_API_KEY" \
  -H "Accept: text/event-stream"
import { createAutomationClient } from '@deepraxis/sdk/automation';

function env(name: string): string {
  const value = process.env[name];
  if (!value) throw new Error(`Set ${name}`);
  return value;
}
const automation = createAutomationClient({
  apiKey: env('PRAXIS_API_KEY'),
  baseUrl: 'https://api.deepraxis.ai',
  maxRetries: 0,
  timeoutMs: 90_000,
});
for await (const event of automation.runs.logs({
  "path": {
    "id": env("RUN_ID")
  }
})) {
  console.log(event);
}

Response

HTTP 200

Success

application/json

FieldTypeDescription
dataobject[]required; Log lines (LogLine) on this page, in time order.
data[].cursorstringrequired; Cursor of this line; use it as cursor to page, or as Last-Event-ID to resume an SSE stream.
data[].tsstringrequired; Time the line was logged (RFC 3339 UTC).
data[].level"debug" / "info" / "warn" / "error"required; Log level. debug is diagnostic detail; info is general information; warn is a warning; error is an error.
data[].messagestringrequired; Log message text.
next_cursornull / stringrequired; Cursor for the next page: pass it unchanged as cursor with the same filters; null when there are no more pages. No total is returned.

text/event-stream

FieldTypeDescription
idstringoptional; Resume cursor of this entry; send it back as Last-Event-ID, or as cursor on the JSON form, to continue after it. Absent on the end event.
event"log" / "end"required; SSE event name: log carries one log line in data; end is sent once when the run has reached a terminal status and closes the stream.
dataobject / objectrequired; Decoded JSON of one log line; for the end event, an empty object.
data (variant 1).cursorstringrequired; Cursor of this line; use it as cursor to page, or as Last-Event-ID to resume an SSE stream.
data (variant 1).tsstringrequired; Time the line was logged (RFC 3339 UTC).
data (variant 1).level"debug" / "info" / "warn" / "error"required; Log level. debug is diagnostic detail; info is general information; warn is a warning; error is an error.
data (variant 1).messagestringrequired; Log message text.
(variant 1).event"log"optional; SSE event name: log, one log line is carried in data.
(variant 1).dataobjectoptional; One log line produced by a run, retained for 30 days. no additional fields.
(variant 1).data.cursorstringrequired; Cursor of this line; use it as cursor to page, or as Last-Event-ID to resume an SSE stream.
(variant 1).data.tsstringrequired; Time the line was logged (RFC 3339 UTC).
(variant 1).data.level"debug" / "info" / "warn" / "error"required; Log level. debug is diagnostic detail; info is general information; warn is a warning; error is an error.
(variant 1).data.messagestringrequired; Log message text.
(variant 2).event"end"optional; SSE event name end: sent once when the run has reached a terminal status, and the stream then closes.
(variant 2).dataobjectoptional; Always an empty object for the end event.

Measured response

HTTP 200

event: end
data: {}

Errors

HTTPCodes and description
400INVALID_PARAMS: Invalid request parameters, path, cursor, or body format.
404RUN_NOT_FOUND: The run does not exist or is not visible to this tenant.
defaultRFC 9457 automation problem. 429 includes Retry-After.

Authentication and common errors · Retain the X-Request-Id response header for troubleshooting.

Export

On this page