> ## 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 (Table) API

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

Used to get data from Data Table.

| Field             | Value                                                                                                                           |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------- |
| **Method**        | POST                                                                                                                            |
| **Endpoint**      | `https://{{host}}/api/public/tables/{{tableName}}/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`                                                  |
| `tableName`  | Name of the Table to fetch data.                                                                          |
| `sys_limit`  | The maximum number of records to be fetched. By default this is set to 10 and the maximum allowed is 100. |
| `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/tables/{{tableName}}/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}
{
    "hasMore": true,
    "total": 2,
    "metaInfo": [
        {
            "name": "gender",
            "type": "string"
        },
        {
            "name": "lastName",
            "type": "string"
        }
    ],
    "queryResult": [
        {
            "age": "male",
            "last_name": "tony"
        }
    ]
}
```
