{
 "openapi": "3.1.0",
 "info": {
  "title": "Agent Runs (Agentic AI)",
  "version": "20261030b",
  "description": "Every run, with what it did, what it cost and what stopped it. A run is not a record somebody edits — it is the account of what happened."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "runs": {
    "type": "object",
    "required": [],
    "properties": {
     "id": {
      "type": "string",
      "format": "uuid",
      "description": "Id",
      "readOnly": true
     },
     "org_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org id",
      "readOnly": true
     },
     "org_unit_id": {
      "type": "string",
      "format": "uuid",
      "description": "Org unit id",
      "readOnly": true
     },
     "run_no": {
      "type": "string",
      "description": "Run no",
      "readOnly": true
     },
     "workflow_id": {
      "type": "string",
      "format": "uuid",
      "description": "Workflow id",
      "readOnly": true
     },
     "workflow_version": {
      "type": "integer",
      "description": "Workflow version",
      "readOnly": true
     },
     "agent_id": {
      "type": "string",
      "format": "uuid",
      "description": "Agent id",
      "readOnly": true
     },
     "agent_version": {
      "type": "integer",
      "description": "Agent version",
      "readOnly": true
     },
     "trigger_id": {
      "type": "string",
      "format": "uuid",
      "description": "Trigger id",
      "readOnly": true
     },
     "parent_run_id": {
      "type": "string",
      "format": "uuid",
      "description": "Parent run id",
      "readOnly": true
     },
     "started_by": {
      "type": "string",
      "description": "Started by",
      "readOnly": true
     },
     "started_by_user_id": {
      "type": "string",
      "format": "uuid",
      "description": "Started by user id",
      "readOnly": true
     },
     "subject_module": {
      "type": "string",
      "description": "Subject module",
      "readOnly": true
     },
     "subject_resource": {
      "type": "string",
      "description": "Subject resource",
      "readOnly": true
     },
     "subject_id": {
      "type": "string",
      "format": "uuid",
      "description": "Subject id",
      "readOnly": true
     },
     "input": {
      "type": "object",
      "description": "Input",
      "readOnly": true
     },
     "state": {
      "type": "object",
      "description": "State",
      "readOnly": true
     },
     "output": {
      "type": "object",
      "description": "Output",
      "readOnly": true
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "current_node": {
      "type": "string",
      "description": "Current node",
      "readOnly": true
     },
     "step_count": {
      "type": "integer",
      "description": "Step count",
      "readOnly": true
     },
     "tool_call_count": {
      "type": "integer",
      "description": "Tool call count",
      "readOnly": true
     },
     "approval_count": {
      "type": "integer",
      "description": "Approval count",
      "readOnly": true
     },
     "input_tokens": {
      "type": "string",
      "format": "decimal",
      "description": "Input tokens",
      "readOnly": true
     },
     "output_tokens": {
      "type": "string",
      "format": "decimal",
      "description": "Output tokens",
      "readOnly": true
     },
     "cached_tokens": {
      "type": "string",
      "format": "decimal",
      "description": "Cached tokens",
      "readOnly": true
     },
     "cost": {
      "type": "string",
      "format": "decimal",
      "description": "Cost",
      "readOnly": true
     },
     "currency": {
      "type": "string",
      "description": "Currency",
      "readOnly": true
     },
     "records_created": {
      "type": "integer",
      "description": "Records created",
      "readOnly": true
     },
     "records_updated": {
      "type": "integer",
      "description": "Records updated",
      "readOnly": true
     },
     "messages_sent": {
      "type": "integer",
      "description": "Messages sent",
      "readOnly": true
     },
     "value_amount": {
      "type": "string",
      "format": "decimal",
      "description": "Value amount",
      "readOnly": true
     },
     "started_at": {
      "type": "string",
      "format": "date-time",
      "description": "Started at",
      "readOnly": true
     },
     "finished_at": {
      "type": "string",
      "format": "date-time",
      "description": "Finished at",
      "readOnly": true
     },
     "duration_ms": {
      "type": "integer",
      "description": "Duration ms",
      "readOnly": true
     },
     "error_code": {
      "type": "string",
      "description": "Error code",
      "readOnly": true
     },
     "error_message": {
      "type": "string",
      "description": "Error message",
      "readOnly": true
     },
     "stopped_by": {
      "type": "string",
      "description": "Stopped by",
      "readOnly": true
     },
     "guardrail_id": {
      "type": "string",
      "format": "uuid",
      "description": "Guardrail id",
      "readOnly": true
     },
     "summary": {
      "type": "string",
      "description": "Summary",
      "readOnly": true
     },
     "summary_local": {
      "type": "string",
      "description": "Summary local",
      "readOnly": true
     },
     "created_at": {
      "type": "string",
      "format": "date-time",
      "description": "Created at",
      "readOnly": true
     },
     "created_by": {
      "type": "string",
      "format": "uuid",
      "description": "Created by",
      "readOnly": true
     },
     "updated_at": {
      "type": "string",
      "format": "date-time",
      "description": "Updated at",
      "readOnly": true
     },
     "updated_by": {
      "type": "string",
      "format": "uuid",
      "description": "Updated by",
      "readOnly": true
     },
     "run_as_user_id": {
      "type": "string",
      "format": "uuid",
      "description": "Run as user id",
      "readOnly": true
     },
     "source_event_id": {
      "type": "string",
      "format": "decimal",
      "description": "Source event id",
      "readOnly": true
     },
     "provider": {
      "type": "string",
      "description": "Provider",
      "readOnly": true
     },
     "model": {
      "type": "string",
      "description": "Model",
      "readOnly": true
     },
     "cost_status": {
      "type": "string",
      "description": "Cost status",
      "readOnly": true
     },
     "partial_reason": {
      "type": "string",
      "description": "Partial reason",
      "readOnly": true
     },
     "xf_text_1": {
      "type": "string",
      "description": "Xf text 1",
      "readOnly": true
     },
     "xf_text_2": {
      "type": "string",
      "description": "Xf text 2",
      "readOnly": true
     },
     "xf_text_3": {
      "type": "string",
      "description": "Xf text 3",
      "readOnly": true
     },
     "xf_text_4": {
      "type": "string",
      "description": "Xf text 4",
      "readOnly": true
     },
     "xf_text_5": {
      "type": "string",
      "description": "Xf text 5",
      "readOnly": true
     },
     "xf_num_1": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 1",
      "readOnly": true
     },
     "xf_num_2": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 2",
      "readOnly": true
     },
     "xf_num_3": {
      "type": "string",
      "format": "decimal",
      "description": "Xf num 3",
      "readOnly": true
     },
     "xf_date_1": {
      "type": "string",
      "format": "date",
      "description": "Xf date 1",
      "readOnly": true
     },
     "xf_date_2": {
      "type": "string",
      "format": "date",
      "description": "Xf date 2",
      "readOnly": true
     }
    }
   }
  }
 },
 "security": [
  {
   "bearer": []
  }
 ],
 "paths": {
  "/api/agentic/runs": {
   "get": {
    "summary": "list runs",
    "operationId": "list_runs_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "Post agent runs",
    "operationId": "action_runs_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/agentic/runs/{id}": {
   "get": {
    "summary": "get runs",
    "operationId": "get_runs_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "Put agent runs",
    "operationId": "action_runs_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "Delete agent runs",
    "operationId": "action_runs_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/agentic/runs/{id}/trace": {
   "get": {
    "summary": "Trace",
    "operationId": "action_runs_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/agentic/runs/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_runs_0_6",
    "description": "Body keys: overrides, preview, withLines",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/agentic/runs/{id}/advance": {
   "post": {
    "summary": "Advance",
    "operationId": "action_runs_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/agentic/runs/{id}/cancel": {
   "post": {
    "summary": "Cancel",
    "operationId": "action_runs_0_6",
    "description": "Body keys: reason",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/agentic/runs/{id}/retry": {
   "post": {
    "summary": "Retry",
    "operationId": "action_runs_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}