> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hypermodel.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Query Status

> Retrieve the status and results of a specific query (for async queries)

## Authentication

<ParamField header="X-API-Key" type="string" required>
  Your API key for authentication
</ParamField>

## Path Parameters

<ParamField path="id" type="string" required>
  The query ID returned from the create query endpoint
</ParamField>

## Response Fields

<ResponseField name="id" type="string">
  The unique query identifier
</ResponseField>

<ResponseField name="status" type="string">
  Current status: `pending`, `processing`, `completed`, or `failed`
</ResponseField>

<ResponseField name="destination" type="object">
  Destination configuration for the query

  <Expandable title="Destination Properties">
    <ResponseField name="type" type="string">
      Destination type: `URL`, `Snowflake`, `Sheets`, or `Clay`
    </ResponseField>

    <ResponseField name="url" type="string">
      The destination URL (for URL type destinations)
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="error" type="string | null">
  Error message if status is `failed`, otherwise null
</ResponseField>

<ResponseField name="createdAt" type="string">
  ISO 8601 timestamp when query was created
</ResponseField>

<ResponseField name="updatedAt" type="string">
  ISO 8601 timestamp when query was last updated
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://api.hypermodel.ai/api/v1/query/query_1234567890_abc123 \
    -H "X-API-Key: your-api-key"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.hypermodel.ai/api/v1/query/query_1234567890_abc123',
    {
      method: 'GET',
      headers: {
        'X-API-Key': 'your-api-key',
      },
    }
  );

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      'https://api.hypermodel.ai/api/v1/query/query_1234567890_abc123',
      headers={
          'X-API-Key': 'your-api-key',
      },
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK (Completed) theme={null}
  {
    "id": "query_1234567890_abc123",
    "status": "completed",
    "destination": {
      "type": "URL",
      "url": "https://webhook.site/your-unique-id"
    },
    "error": null,
    "createdAt": "2025-01-01T00:00:00Z",
    "updatedAt": "2025-01-01T00:01:00Z"
  }
  ```

  ```json 200 OK (Processing) theme={null}
  {
    "id": "query_1234567890_abc123",
    "status": "processing",
    "destination": {
      "type": "URL"
    },
    "error": null,
    "createdAt": "2025-01-01T00:00:00Z",
    "updatedAt": "2025-01-01T00:00:30Z"
  }
  ```

  ```json 200 OK (Failed) theme={null}
  {
    "id": "query_1234567890_abc123",
    "status": "failed",
    "destination": {
      "type": "URL"
    },
    "error": "Failed to process query: Invalid schema",
    "createdAt": "2025-01-01T00:00:00Z",
    "updatedAt": "2025-01-01T00:00:45Z"
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "error": "Query not found"
  }
  ```
</ResponseExample>

## Status Values

<CardGroup cols={2}>
  <Card title="Pending" icon="clock">
    Query is queued for processing
  </Card>

  <Card title="Processing" icon="spinner">
    Query is currently being processed
  </Card>

  <Card title="Completed" icon="check">
    Query completed successfully
  </Card>

  <Card title="Failed" icon="xmark">
    Query failed with an error
  </Card>
</CardGroup>
