---
updatedAt: 2025-09-05T05:45:42.000Z
agentTools:
  projectIndex: https://workduo.readme.io/llms.txt
---

# Run Query

Manually execute a query. Execution is asynchronous; a jobId is returned for polling or later retrieval.

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "title": "Workduo Core API",
    "version": "1.0.6",
    "description": "API for managing and retrieve core objects in Workduo such as query, responses and citaiton."
  },
  "servers": [
    {
      "url": "https://api.workduo.ai/core/v1"
    }
  ],
  "paths": {
    "/queries/{id}/run": {
      "post": {
        "operationId": "runQuery",
        "summary": "Run Query",
        "description": "Manually execute a query. Execution is asynchronous; a jobId is returned for polling or later retrieval.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The unique ID of the query.",
            "schema": {
              "type": "string",
              "example": "qry789jkl012mno345pqr678"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "projectId"
                ],
                "properties": {
                  "projectId": {
                    "type": "string",
                    "description": "The ID of the Project to run the query for.",
                    "example": "cjld2cjxh0000qzrmn831i7rn"
                  }
                }
              },
              "example": {
                "projectId": "cjld2cjxh0000qzrmn831i7rn"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Execution accepted",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "jobId": {
                      "type": "string",
                      "description": "Asynchronous job identifier.",
                      "example": "job_01HZY2F2BT2ZP2N9PRM3QK4X7A"
                    },
                    "status": {
                      "type": "string",
                      "description": "Initial job status.",
                      "enum": [
                        "queued",
                        "running",
                        "completed",
                        "failed"
                      ],
                      "example": "queued"
                    }
                  }
                },
                "example": {
                  "jobId": "job_01HZY2F2BT2ZP2N9PRM3QK4X7A",
                  "status": "queued",
                  "id": "qry789jkl012mno345pqr678"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized"
          },
          "404": {
            "description": "Query not found",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string",
                      "example": "Query with ID qry789jkl012mno345pqr678 not found"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "BasicAuth": []
          }
        ],
        "tags": [
          "Queries"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BasicAuth": {
        "type": "http",
        "scheme": "basic"
      }
    }
  }
}
```