{
 "openapi": "3.1.0",
 "info": {
  "title": "Agents (Agentic AI)",
  "version": "20261030b",
  "description": "What each agent is for, what it may do, and what it has actually been doing. An agent with no tools is not broken — it is one that can only think, which is a legitimate and common thing to want."
 },
 "servers": [
  {
   "url": "https://{tenant}.tranxact.ai",
   "variables": {
    "tenant": {
     "default": "demo"
    }
   }
  }
 ],
 "components": {
  "securitySchemes": {
   "bearer": {
    "type": "http",
    "scheme": "bearer"
   }
  },
  "schemas": {
   "agents": {
    "type": "object",
    "required": [
     "code",
     "name"
    ],
    "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
     },
     "agent_no": {
      "type": "string",
      "description": "Agent no",
      "readOnly": true
     },
     "code": {
      "type": "string",
      "description": "Code"
     },
     "name": {
      "type": "string",
      "description": "Name"
     },
     "name_local": {
      "type": "string",
      "description": "Name in local language"
     },
     "purpose": {
      "type": "string",
      "description": "What it is for"
     },
     "purpose_local": {
      "type": "string",
      "description": "Purpose local"
     },
     "module": {
      "type": "string",
      "description": "Module",
      "enum": [
       "agentic",
       "crm",
       "scm",
       "accounting",
       "hrms",
       "mfg",
       "ats",
       "ehr",
       "slcm",
       "platform"
      ]
     },
     "category": {
      "type": "string",
      "description": "Kind of work"
     },
     "template_code": {
      "type": "string",
      "description": "Template code"
     },
     "avatar": {
      "type": "string",
      "description": "Avatar"
     },
     "provider": {
      "type": "string",
      "description": "Engine"
     },
     "model": {
      "type": "string",
      "description": "Model"
     },
     "temperature": {
      "type": "string",
      "format": "decimal",
      "description": "Temperature"
     },
     "max_tokens": {
      "type": "integer",
      "description": "Reply size limit"
     },
     "system_prompt": {
      "type": "string",
      "description": "Instructions"
     },
     "instructions": {
      "type": "string",
      "description": "Opening instruction"
     },
     "output_schema": {
      "type": "object",
      "description": "Output schema",
      "readOnly": true
     },
     "version": {
      "type": "integer",
      "description": "Version",
      "readOnly": true
     },
     "autonomy": {
      "type": "string",
      "description": "Autonomy",
      "readOnly": true
     },
     "run_as_user_id": {
      "type": "string",
      "format": "uuid",
      "description": "Runs as"
     },
     "owner_user_id": {
      "type": "string",
      "format": "uuid",
      "description": "Owner"
     },
     "max_steps": {
      "type": "integer",
      "description": "Step limit"
     },
     "max_tool_calls": {
      "type": "integer",
      "description": "Tool-call limit"
     },
     "max_run_seconds": {
      "type": "integer",
      "description": "Time limit (seconds)"
     },
     "max_cost_per_run": {
      "type": "string",
      "format": "decimal",
      "description": "Cost ceiling per run (company currency)"
     },
     "max_cost_per_day": {
      "type": "string",
      "format": "decimal",
      "description": "Cost ceiling per day (company currency)"
     },
     "currency": {
      "type": "string",
      "description": "Currency"
     },
     "memory_mode": {
      "type": "string",
      "description": "Memory"
     },
     "memory_ttl_days": {
      "type": "integer",
      "description": "Forget after (days)"
     },
     "locale": {
      "type": "string",
      "description": "Writes in"
     },
     "status": {
      "type": "string",
      "description": "Status",
      "readOnly": true
     },
     "last_run_at": {
      "type": "string",
      "format": "date-time",
      "description": "Last run at",
      "readOnly": true
     },
     "run_count": {
      "type": "string",
      "format": "decimal",
      "description": "Run count",
      "readOnly": true
     },
     "success_count": {
      "type": "string",
      "format": "decimal",
      "description": "Success count",
      "readOnly": true
     },
     "failure_count": {
      "type": "string",
      "format": "decimal",
      "description": "Failure count",
      "readOnly": true
     },
     "total_cost": {
      "type": "string",
      "format": "decimal",
      "description": "Total cost",
      "readOnly": true
     },
     "notes": {
      "type": "string",
      "description": "Notes"
     },
     "is_active": {
      "type": "boolean",
      "description": "Enabled"
     },
     "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
     },
     "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/agents": {
   "get": {
    "summary": "list agents",
    "operationId": "list_agents_0_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "post": {
    "summary": "create agents",
    "operationId": "create_agents_1_4",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/agentic/agents/{id}": {
   "get": {
    "summary": "get agents",
    "operationId": "get_agents_0_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "put": {
    "summary": "change agents",
    "operationId": "change_agents_1_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   },
   "delete": {
    "summary": "delete agents",
    "operationId": "delete_agents_2_5",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/agentic/agents/{id}/copy": {
   "post": {
    "summary": "Copy",
    "operationId": "action_agents_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/agents/{id}/publish": {
   "post": {
    "summary": "Publish",
    "operationId": "action_agents_0_6",
    "description": "Body keys: note",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/agentic/agents/{id}/autonomy": {
   "post": {
    "summary": "Autonomy",
    "operationId": "action_agents_0_6",
    "description": "Body keys: autonomy, reason; autonomy one of suggest|approve|supervise|auto",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/agentic/agents/{id}/switch-on": {
   "post": {
    "summary": "Switch on",
    "operationId": "action_agents_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/agents/{id}/switch-off": {
   "post": {
    "summary": "Switch off",
    "operationId": "action_agents_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/agents/{id}/tools": {
   "get": {
    "summary": "Tools",
    "operationId": "action_agents_0_6",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  },
  "/api/agentic/agents/{id}/run": {
   "post": {
    "summary": "Run",
    "operationId": "action_agents_0_6",
    "description": "Body keys: input, subject",
    "responses": {
     "200": {
      "description": "OK"
     },
     "401": {
      "description": "No or bad credential"
     },
     "403": {
      "description": "Not granted"
     },
     "422": {
      "description": "Refused by validation"
     }
    }
   }
  }
 }
}