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

# Query Data (View) API

<Badge icon="arrow-left" color="gray">[Back to API List](/ai-for-service/apis/automation/api-list)</Badge>

Used to get data from Table View.

| Field             | Value                                                                                                                           |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **Method**        | POST                                                                                                                            |
| **Endpoint**      | `https://{{host}}/api/public/views/{{viewName}}/query?sys_limit={{limit_value}}&sys_offset={{offset_value}}`                    |
| **Content Type**  | `application/json`                                                                                                              |
| **Authorization** | `auth: {{JWT}}` See [How to generate the JWT Token](/ai-for-service/apis/automation/api-introduction#generating-the-jwt-token). |
| **App Access**    | Read access to the Data Table from the Data Definition in DaaS.                                                                 |

## Path Parameters

| Parameter    | Description                                                                    |
| ------------ | ------------------------------------------------------------------------------ |
| `host`       | Environment URL, for example, `https://platform.kore.ai`                       |
| `viewName`   | The table view from which to fetch data.                                       |
| `sys_limit`  | The maximum number of records to be fetched.                                   |
| `sys_offset` | The number of records to be skipped from the beginning of the results dataset. |

## Sample Request

```json theme={null}
curl -X POST 'https://{{host}}/api/public/views/{{viewName}}/query?sys_limit=4&sys_offset=0' \
  -H 'auth: {{YOUR_JWT_ACCESS_TOKEN}}' \
  -H 'content-type: application/json' \
  -d '{
      "query":{
        "expressions": [
            {"field": "firstName", "operand": "=", "value": "Jane"},
            {"field": "lastName", "operand": "=", "value": "Doe"}
        ],
        "operator": "or"
      }
}'
```

## Body Parameters

| Parameter | Description                                                                                                                                      |
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `query`   | Filter criteria identifying the rows to be fetched. Accepts `expressions` (array of field/operand/value objects) and `operator` (`and` or `or`). |

## Sample Response

```json theme={null}
{
    "metaInfo": [
        {
            "name": "gender",
            "type": "string"
        },
        {
            "name": "lastName",
            "type": "string"
        }
    ],
    "queryResult": [
        {
            "age": "male",
            "last_name": "Doe"
        }
    ]
}
```
