{"id":4918,"date":"2026-01-26T01:51:01","date_gmt":"2026-01-26T06:51:01","guid":{"rendered":"https:\/\/chubes.net\/?documentation=api-query-tool"},"modified":"2026-04-20T00:09:32","modified_gmt":"2026-04-20T04:09:32","slug":"api-query-tool","status":"publish","type":"documentation","link":"https:\/\/chubes.net\/docs\/data-machine\/ai-tools\/api-query-tool\/","title":{"rendered":"API Query Tool"},"content":{"rendered":"<p>Internal REST API query tool for chat agents providing discovery, monitoring, and troubleshooting capabilities.<\/p><h2 class=\"wp-block-heading\">Overview<\/h2><p>The <code>api_query<\/code> tool enables chat agents to query the Data Machine REST API (via <code>rest_do_request<\/code>) for discovery and monitoring. It supports single requests and batch requests.<\/p><h2 class=\"wp-block-heading\">Parameters<\/h2><h3 class=\"wp-block-heading\">Single request<\/h3><ul class=\"wp-block-list\"><li><strong>endpoint<\/strong> (string, required): REST API endpoint path (e.g., <code>\/datamachine\/v1\/handlers<\/code>)<\/li><li><strong>method<\/strong> (string, optional): HTTP method (defaults to <code>GET<\/code>)<\/li><li><strong>data<\/strong> (object, optional): Request body data for <code>POST<\/code>, <code>PUT<\/code>, or <code>PATCH<\/code><\/li><\/ul><h3 class=\"wp-block-heading\">Batch requests<\/h3><ul class=\"wp-block-list\"><li><strong>requests<\/strong> (array): Array of requests: <code>{ endpoint, method, data?, key? }<\/code>. If <code>key<\/code> is omitted, a key is derived from the endpoint path.<\/li><\/ul><h2 class=\"wp-block-heading\">Available Endpoints<\/h2><h3 class=\"wp-block-heading\">Discovery<\/h3><ul class=\"wp-block-list\"><li><code>GET \/datamachine\/v1\/handlers<\/code> &#8211; List all handlers<\/li><li><code>GET \/datamachine\/v1\/handlers?step_type={fetch|publish|upsert}<\/code> &#8211; Filter by type<\/li><li><code>GET \/datamachine\/v1\/handlers\/{slug}<\/code> &#8211; Handler details and config schema<\/li><li><code>GET \/datamachine\/v1\/auth\/{handler}\/status<\/code> &#8211; Check OAuth connection status<\/li><li><code>GET \/datamachine\/v1\/providers<\/code> &#8211; List AI providers and models<\/li><li><code>GET \/datamachine\/v1\/tools<\/code> &#8211; List available AI tools<\/li><\/ul><h3 class=\"wp-block-heading\">Pipelines (Read-Only)<\/h3><ul class=\"wp-block-list\"><li><code>GET \/datamachine\/v1\/pipelines<\/code> &#8211; List all pipelines<\/li><li><code>GET \/datamachine\/v1\/pipelines\/{id}<\/code> &#8211; Get pipeline details with steps and flows<\/li><\/ul><h3 class=\"wp-block-heading\">Flows (Read-Only)<\/h3><ul class=\"wp-block-list\"><li><code>GET \/datamachine\/v1\/flows<\/code> &#8211; List all flows<\/li><li><code>GET \/datamachine\/v1\/flows\/{id}<\/code> &#8211; Get flow details<\/li><li><code>GET \/datamachine\/v1\/flows\/problems<\/code> &#8211; List flows flagged for review due to consecutive failures\/no items<\/li><\/ul><h3 class=\"wp-block-heading\">Jobs &amp; Monitoring<\/h3><ul class=\"wp-block-list\"><li><code>GET \/datamachine\/v1\/jobs<\/code> &#8211; List all jobs<\/li><li><code>GET \/datamachine\/v1\/jobs?flow_id={id}<\/code> &#8211; Jobs for specific flow<\/li><li><code>GET \/datamachine\/v1\/jobs?status={pending|processing|completed|failed|completed_no_items|agent_skipped}<\/code> &#8211; Filter by status.<\/li><li><code>GET \/datamachine\/v1\/jobs\/{id}<\/code> &#8211; Job details<\/li><\/ul><h3 class=\"wp-block-heading\">Logs<\/h3><ul class=\"wp-block-list\"><li><code>GET \/datamachine\/v1\/logs\/content<\/code> &#8211; Get log content<\/li><li><code>GET \/datamachine\/v1\/logs\/content?job_id={id}<\/code> &#8211; Logs for specific job<\/li><li><code>DELETE \/datamachine\/v1\/logs<\/code> &#8211; Clear logs<\/li><li><code>PUT \/datamachine\/v1\/logs\/level<\/code> &#8211; Set log level<\/li><\/ul><h3 class=\"wp-block-heading\">System<\/h3><ul class=\"wp-block-list\"><li><code>GET \/datamachine\/v1\/settings<\/code> &#8211; Get plugin settings<\/li><li><code>PATCH \/datamachine\/v1\/settings<\/code> &#8211; Update settings (partial)<\/li><\/ul><h3 class=\"wp-block-heading\">Files<\/h3><ul class=\"wp-block-list\"><li><code>GET \/datamachine\/v1\/files<\/code> &#8211; List uploaded files<\/li><li><code>POST \/datamachine\/v1\/files<\/code> &#8211; Upload file<\/li><li><code>DELETE \/datamachine\/v1\/files\/{filename}<\/code> &#8211; Delete file<\/li><\/ul><h2 class=\"wp-block-heading\">Usage Examples<\/h2><h3 class=\"wp-block-heading\">List All Handlers<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">json<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-json\"><code class=\"language-json\">{\n  &quot;endpoint&quot;: &quot;\/datamachine\/v1\/handlers&quot;,\n  &quot;method&quot;: &quot;GET&quot;\n}<\/code><\/pre><\/div><h3 class=\"wp-block-heading\">Check OAuth Status<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">json<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-json\"><code class=\"language-json\">{\n  &quot;endpoint&quot;: &quot;\/datamachine\/v1\/auth\/twitter\/status&quot;,\n  &quot;method&quot;: &quot;GET&quot;\n}<\/code><\/pre><\/div><h3 class=\"wp-block-heading\">Get Pipeline Details<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">json<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-json\"><code class=\"language-json\">{\n  &quot;endpoint&quot;: &quot;\/datamachine\/v1\/pipelines\/123&quot;,\n  &quot;method&quot;: &quot;GET&quot;\n}<\/code><\/pre><\/div><h3 class=\"wp-block-heading\">Monitor Job Status<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">json<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-json\"><code class=\"language-json\">{\n  &quot;endpoint&quot;: &quot;\/datamachine\/v1\/jobs\/456&quot;,\n  &quot;method&quot;: &quot;GET&quot;\n}<\/code><\/pre><\/div><h2 class=\"wp-block-heading\">Response Format<\/h2><h3 class=\"wp-block-heading\">Single request response<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">json<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-json\"><code class=\"language-json\">{\n  &quot;success&quot;: true,\n  &quot;data&quot;: { \/* response body *\/ },\n  &quot;status&quot;: 200,\n  &quot;tool_name&quot;: &quot;api_query&quot;\n}<\/code><\/pre><\/div><h3 class=\"wp-block-heading\">Batch request response<\/h3><div class=\"code-block-wrapper\"><div class=\"code-block-header\"><span class=\"code-block-language\">json<\/span><button class=\"code-copy-btn\" aria-label=\"Copy code\"><svg><use href=\"https:\/\/chubes.net\/wp-content\/themes\/chubes\/assets\/icons\/chubes.svg#icon-copy\"><\/use><\/svg><\/button><\/div><pre data-chubes-enhanced class=\"wp-block-code language-json\"><code class=\"language-json\">{\n  &quot;success&quot;: true,\n  &quot;batch&quot;: true,\n  &quot;data&quot;: {\n    &quot;handlers&quot;: { \/* ... *\/ },\n    &quot;pipelines&quot;: { \/* ... *\/ }\n  },\n  &quot;errors&quot;: {\n    &quot;jobs&quot;: &quot;Missing endpoint&quot;\n  },\n  &quot;partial&quot;: true,\n  &quot;request_count&quot;: 3,\n  &quot;success_count&quot;: 2,\n  &quot;error_count&quot;: 1,\n  &quot;tool_name&quot;: &quot;api_query&quot;\n}<\/code><\/pre><\/div><h2 class=\"wp-block-heading\">Error Handling<\/h2><p>Returns structured error responses for:<\/p><ul class=\"wp-block-list\"><li>Invalid endpoints or methods<\/li><li>Authentication\/authorization failures<\/li><li>Malformed request data<\/li><li>Server-side processing errors<\/li><\/ul><h2 class=\"wp-block-heading\">Integration<\/h2><p>This tool complements specialized workflow tools by providing comprehensive API access for:<\/p><ul class=\"wp-block-list\"><li>System monitoring and diagnostics<\/li><li>Configuration verification<\/li><li>Troubleshooting workflow issues<\/li><li>Administrative operations<\/li><\/ul><p>Use specialized Focused Tools like <code>create_pipeline<\/code>, <code>delete_flow<\/code>, <code>add_pipeline_step<\/code>, and <code>configure_flow_step<\/code> for mutation operations. <code>api_query<\/code> is strictly read-only for discovery and monitoring.<\/p>","protected":false},"excerpt":{"rendered":"<p>Internal REST API query tool for chat agents providing discovery, monitoring, and troubleshooting capabilities. Overview The api_query tool enables chat agents to query the Data Machine REST API (via rest_do_request)&#8230;<\/p>\n","protected":false},"featured_media":0,"template":"","meta":{"footnotes":""},"tags":[],"project":[503],"project_type":[484],"class_list":["post-4918","documentation","type-documentation","status-publish","hentry","project-ai-tools","project_type-wordpress-plugins"],"project_info":{"id":487,"name":"Data Machine","slug":"data-machine"},"project_type_info":{"id":484,"name":"WordPress Plugins","slug":"wordpress-plugins"},"_links":{"self":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/4918","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation"}],"about":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/types\/documentation"}],"version-history":[{"count":4,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/4918\/revisions"}],"predecessor-version":[{"id":11275,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/documentation\/4918\/revisions\/11275"}],"wp:attachment":[{"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/media?parent=4918"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/tags?post=4918"},{"taxonomy":"project","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project?post=4918"},{"taxonomy":"project_type","embeddable":true,"href":"https:\/\/chubes.net\/wp-json\/wp\/v2\/project_type?post=4918"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}