{
  "info": {
    "name": "Numu — AI Agents (Decision → Approval → Execution)",
    "description": "Complete AI Agent lifecycle API for Make. Final architecture: Numu is the business execution engine — after approval, Numu executes the action via StartupLabelActionService. Set collection variables base_url + token before running.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{token}}", "type": "string" }]
  },
  "variable": [
    { "key": "base_url", "value": "http://127.0.0.1:8080" },
    { "key": "token", "value": "naat_REPLACE_WITH_FULL_TOKEN" },
    { "key": "startup_id", "value": "457" },
    { "key": "investor_id", "value": "1" },
    { "key": "agent_key", "value": "prescreen" },
    { "key": "action_slug", "value": "request_more_info" },
    { "key": "run_id", "value": "" },
    { "key": "approval_id", "value": "" }
  ],
  "item": [
    {
      "name": "1. Agents",
      "item": [
        { "name": "POST create agent", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agents", "body": { "mode": "raw", "raw": "{\n  \"agent_key\": \"demo_agent\",\n  \"agent_type\": \"startup\",\n  \"name\": \"Demo Agent\",\n  \"environment\": \"prod\",\n  \"agent_version\": \"1.0.0\",\n  \"is_active\": true\n}" } } },
        { "name": "GET list agents", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agents?environment=prod" } },
        { "name": "GET show agent", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agents/1" } },
        { "name": "PATCH update agent", "request": { "method": "PATCH", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agents/1", "body": { "mode": "raw", "raw": "{\n  \"is_active\": false,\n  \"agent_version\": \"1.1.0\",\n  \"agent_type\": \"startup\"\n}" } } }
      ]
    },
    {
      "name": "2. Runtime",
      "item": [
        { "name": "GET global runtime-status", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agents/runtime-status" } },
        { "name": "GET agent runtime-status", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agents/{{agent_key}}/runtime-status" } },
        { "name": "POST pause agent", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agents/{{agent_key}}/pause", "body": { "mode": "raw", "raw": "{ \"reason\": \"maintenance\", \"mode\": \"pause_new_only\" }" } } },
        { "name": "POST enable agent", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agents/{{agent_key}}/enable", "body": { "mode": "raw", "raw": "{ \"reason\": \"resume\" }" } } }
      ]
    },
    {
      "name": "3. Runs",
      "item": [
        { "name": "POST create run (startup)", "event": [{ "listen": "test", "script": { "exec": ["var d = pm.response.json().data || pm.response.json();", "if (d && d.id) pm.collectionVariables.set('run_id', d.id);"] } }], "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agent-runs", "body": { "mode": "raw", "raw": "{\n  \"agent_key\": \"{{agent_key}}\",\n  \"startup_id\": {{startup_id}},\n  \"context\": { \"source\": \"make\", \"workflow\": \"startup_pipeline\" }\n}" } } },
        { "name": "POST create run (investor)", "event": [{ "listen": "test", "script": { "exec": ["var d = pm.response.json().data || pm.response.json();", "if (d && d.id) pm.collectionVariables.set('run_id', d.id);"] } }], "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agent-runs", "body": { "mode": "raw", "raw": "{\n  \"agent_key\": \"investor_review\",\n  \"investor_id\": {{investor_id}},\n  \"context\": { \"source\": \"make\", \"workflow\": \"investor_pipeline\" }\n}" } } },
        { "name": "GET list runs", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agent-runs?startup_id={{startup_id}}&limit=20" } },
        { "name": "GET show run", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agent-runs/{{run_id}}" } }
      ]
    },
    {
      "name": "4. Decision",
      "item": [
        { "name": "POST decision", "event": [{ "listen": "test", "script": { "exec": ["var d = (pm.response.json().data)||{};", "if (d.approval_id) pm.collectionVariables.set('approval_id', d.approval_id);"] } }], "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agent-runs/{{run_id}}/decision", "body": { "mode": "raw", "raw": "{\n  \"action_slug\": \"{{action_slug}}\",\n  \"confidence\": 0.87,\n  \"reason\": \"passed prescreen\",\n  \"payload\": { \"note\": \"AI recommendation\" }\n}" } } }
      ]
    },
    {
      "name": "5. Policies",
      "item": [
        { "name": "GET all policies", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/action-policies?environment=prod" } },
        { "name": "GET policies for agent", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/action-policies/{{agent_key}}?environment=prod" } },
        { "name": "GET resolve policy (agent+action)", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/action-policies/{{agent_key}}/{{action_slug}}?environment=prod&startup_id={{startup_id}}" } },
        { "name": "PUT set policy", "request": { "method": "PUT", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/action-policies/{{agent_key}}/{{action_slug}}", "body": { "mode": "raw", "raw": "{\n  \"policy\": \"needs_approval\",\n  \"environment\": \"prod\",\n  \"reason\": \"qa\"\n}" } } }
      ]
    },
    {
      "name": "6. Approvals",
      "item": [
        { "name": "GET list approvals", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/approvals?pending_only=1" } },
        { "name": "GET show approval", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/approvals/{{approval_id}}" } },
        { "name": "POST approve (Numu executes)", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/approvals/{{approval_id}}/approve", "body": { "mode": "raw", "raw": "{ \"comment\": \"agreed\" }" } } },
        { "name": "POST reject", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/approvals/{{approval_id}}/reject", "body": { "mode": "raw", "raw": "{ \"comment\": \"not now\" }" } } }
      ]
    },
    {
      "name": "7. Execution",
      "item": [
        { "name": "GET execution-requests", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/execution-requests?startup_id={{startup_id}}&limit=20" } },
        { "name": "GET execution-results", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/execution-results?limit=20" } },
        { "name": "GET execution-result by id", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/execution-results/1" } }
      ]
    },
    {
      "name": "8. Testing (one-call scenarios)",
      "item": [
        { "name": "Scenario 1 — always_allow", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/testing/startup-scenario", "body": { "mode": "raw", "raw": "{\n  \"startup_id\": {{startup_id}},\n  \"agent_key\": \"intake_triage\",\n  \"action_slug\": \"move_to_review\",\n  \"policy\": \"always_allow\",\n  \"confidence\": 0.93,\n  \"reason\": \"clean intake\",\n  \"revert\": true\n}" } } },
        { "name": "Scenario 2 — needs_approval (paused)", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/testing/approval-scenario", "body": { "mode": "raw", "raw": "{\n  \"startup_id\": {{startup_id}},\n  \"agent_key\": \"prescreen\",\n  \"action_slug\": \"request_more_info\",\n  \"confidence\": 0.77,\n  \"reason\": \"need deck\",\n  \"auto_approve\": false,\n  \"revert\": true\n}" } } },
        { "name": "Scenario 3 — blocked", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/testing/blocked-scenario", "body": { "mode": "raw", "raw": "{\n  \"startup_id\": {{startup_id}},\n  \"agent_key\": \"intake_triage\",\n  \"action_slug\": \"reject\",\n  \"reason\": \"out of scope\"\n}" } } },
        { "name": "Scenario 6 — needs_approval + auto-approve (Numu executes)", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/testing/approval-scenario", "body": { "mode": "raw", "raw": "{\n  \"startup_id\": {{startup_id}},\n  \"agent_key\": \"committee_analysis\",\n  \"action_slug\": \"move_to_prelist\",\n  \"confidence\": 0.81,\n  \"auto_approve\": true,\n  \"revert\": true\n}" } } },
        { "name": "Investor scenario — full lifecycle (always_allow)", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/testing/investor-scenario", "body": { "mode": "raw", "raw": "{\n  \"investor_id\": {{investor_id}},\n  \"agent_key\": \"investor_review\",\n  \"action_slug\": \"create_deals\",\n  \"policy\": \"always_allow\",\n  \"confidence\": 0.9,\n  \"reason\": \"investor cleared review\",\n  \"revert\": true\n}" } } },
        { "name": "Investor scenario — needs_approval + auto-approve", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/testing/investor-scenario", "body": { "mode": "raw", "raw": "{\n  \"investor_id\": {{investor_id}},\n  \"agent_key\": \"investor_review\",\n  \"action_slug\": \"approve\",\n  \"policy\": \"needs_approval\",\n  \"confidence\": 0.82,\n  \"auto_approve\": true,\n  \"revert\": true\n}" } } }
      ]
    },
    {
      "name": "9. Raw lifecycle scenarios",
      "item": [
        { "name": "Scenario 4 — unassigned → blocked (default)", "request": { "method": "GET", "header": [{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/action-policies/investment_memo/request_meeting?environment=prod" } },
        { "name": "Scenario 5 — duplicate decision (idempotency)", "description": "Call POST /agent-runs/{{run_id}}/decision TWICE with always_allow — the 2nd returns decision=duplicate, executed unchanged, native action NOT repeated.", "request": { "method": "POST", "header": [{"key":"Content-Type","value":"application/json"},{"key":"Accept","value":"application/json"}], "url": "{{base_url}}/api/v1/ai/agent-runs/{{run_id}}/decision", "body": { "mode": "raw", "raw": "{ \"action_slug\": \"{{action_slug}}\", \"confidence\": 0.9 }" } } }
      ]
    }
  ]
}
