{ "opencollection": "1.0.0", "info": { "name": "Amigo Account Functions API", "version": "0.1.0" }, "request": { "auth": { "type": "bearer", "token": "{{bearerToken}}" } }, "items": [ { "info": { "name": "Functions", "type": "folder" }, "items": [ { "info": { "name": "List every platform function registered in the workspace", "type": "http" }, "http": { "method": "GET", "url": "https://api.amigo.ai/v1/:workspace_id/functions", "params": [ { "name": "workspace_id", "value": "", "type": "path" } ] }, "docs": "List every platform function registered in the workspace.\n\nPermissions: ``Workspace.view`` (read role and above)." }, { "info": { "name": "Get a registered platform function by name", "type": "http" }, "http": { "method": "GET", "url": "https://api.amigo.ai/v1/:workspace_id/functions/:function_name", "params": [ { "name": "workspace_id", "value": "", "type": "path" }, { "name": "function_name", "value": "", "type": "path" } ] }, "docs": "Resolve a function by name.\n\nPermissions: ``Workspace.view`` (read role and above)." }, { "info": { "name": "Deploy (validate + upsert) a platform function", "type": "http" }, "http": { "method": "PUT", "url": "https://api.amigo.ai/v1/:workspace_id/functions/:function_name", "params": [ { "name": "workspace_id", "value": "", "type": "path" }, { "name": "function_name", "value": "", "type": "path" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Validate + upsert a platform function row.\n\nAtomic: validation + (python/udtf only) UC UDF materialization +\nupsert into ``platform.functions`` happen as one logical operation.\nRepeat deploys against the same ``(workspace, name)`` replace the\nrow in place and clear stale ``last_test_*`` telemetry.\n\nThe function name comes from the URL path; the request body's\n``name`` field must match or a 400 is raised. The URL is the\nauthoritative source.\n\nPermissions: admin, owner." }, { "info": { "name": "Remove a registered platform function", "type": "http" }, "http": { "method": "DELETE", "url": "https://api.amigo.ai/v1/:workspace_id/functions/:function_name", "params": [ { "name": "workspace_id", "value": "", "type": "path" }, { "name": "function_name", "value": "", "type": "path" } ] }, "docs": "Remove a registered function row.\n\nPermissions: admin, owner." }, { "info": { "name": "Execute a registered platform function", "type": "http" }, "http": { "method": "POST", "url": "https://api.amigo.ai/v1/:workspace_id/functions/:function_name/invoke", "params": [ { "name": "workspace_id", "value": "", "type": "path" }, { "name": "function_name", "value": "", "type": "path" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Execute a registered function and return its rows.\n\nBound parameters are validated against the stored schema; ``ws_id``\nis auto-injected from the request context. Returns the executor's\nshaped response (``rows`` for ``returns=table``, scalar value for\n``returns=scalar``).\n\nPermissions: ``Workspace.view`` (read role and above). Read-only\nkeys are intentionally allowed — invocation runs a stored,\npre-validated SELECT against catalogs the workspace SP already has\nSELECT on; the gate on what can run" }, { "info": { "name": "Test invoke + persist last_test_* telemetry on the row", "type": "http" }, "http": { "method": "POST", "url": "https://api.amigo.ai/v1/:workspace_id/functions/:function_name/test", "params": [ { "name": "workspace_id", "value": "", "type": "path" }, { "name": "function_name", "value": "", "type": "path" } ], "body": { "type": "json", "data": "{}" } }, "docs": "Test invoke — same as invoke + persists last_test_* on the row.\n\nReturns 200 with ``status=\"fail\"`` + populated ``error`` on\nexecution failure (instead of a 5xx) so the DC has a single\nhappy-path rendering.\n\nPermissions: admin, owner." } ] } ], "bundled": true }