API Reference

Terminal Logs

Get Terminal Logs

  • API Name: Get Terminal Logs
  • API Route: GET /api/v1/terminal-logs
  • Request:
    • Query Params:

- workspaceId (string, required) - projectId (string, required) - logId (string, optional) — fetch a specific log by ID - latest (boolean, optional) — if true, return only the most recent log

  • What it does: Flexible endpoint for retrieving terminal/run logs associated with a workspace. Depending on the query parameters:
    • If logId is provided: returns the specific log entry.
    • If latest=true: returns only the most recent log entry.
    • Otherwise: returns up to the last 50 log entries for the workspace, ordered by most recent first.
  • Returns:
    • Single log: { id, workspaceId, projectId, runType, status, output, metadata, startedAt, endedAt }
    • Latest log: same object, or { "log": null } if no logs exist
    • All logs: { "logs": [...] }
    • 400 if workspaceId or projectId are missing.
    • 404 if a specific logId is not found.