**Source URL:** https://limited.veevavault.dev/qualityone/vault-api/api-reference/19.1/vault-query-language-vql/submitting-a-query.md

# Submitting a Query



VQL queries go to the `/query` REST interface. Submit a query by sending a
<span class="label label-warning">POST</span> request to the following endpoint:

`/api/{version}/query`

## Headers {#headers}

<FieldTable>
| Name | Description |
| --- | --- |
| `Accept` | `application/json` (default) or `application/xml` |
| `X-VaultAPI-DescribeQuery` | Set to `true` to include static field metadata in the response for the data record. If not specified, the response does not include any static field metadata. This option eliminates the need to make additional API calls to understand the shape of query response data. |
</FieldTable>

## Request {#request}

<CodeExample title="">
```
curl -X POST -H "Authorization: {SESSION_ID}" \
-H "X-VaultAPI-DescribeQuery: true" \
https://myvault.veevavault.com/api/v14.0/query?q=SELECT id FROM documents

```
</CodeExample>

## Response {#response}

<CodeExample title="">
```
{
  "responseStatus": "SUCCESS",
    "queryDescribe": {
        "object": {
            "name": "documents",
            "label": "documents",
            "label_plural": "documents"
        },
        "fields": [
            {
                "type": "id",
                "required": true,
                "name": "id"
            }
        ]
    },
    "responseDetails": {
        "limit": 1000,
        "offset": 0,
        "size": 17,
        "total": 17
    },
    "data": [
        {
            "id": 24
        }
    ]
}

```
</CodeExample>

## Response Details {#response-details}

On SUCCESS, the response includes the following information:

<FieldTable>
| Name | Description |
| --- | --- |
| `limit` | The number of records displayed per page. This can be modified. Learn [more](/vql/clauses/pagesize). |
| `offset` | The records displayed on the current page are offset by this number of records. Learn [more](/vql/references/query-performance-best-practices#Paginating_Results). |
| `size` | The total number of records displayed on the current page. |
| `total` | The total number of records found. |
| `previous_page` | The Pagination URL to navigate to the previous page of results. This is not always available. Learn [more](/vql/references/query-performance-best-practices#Paginating_Results). |
| `next_page` | The Pagination URL to navigate to the next page of results. This is not always available. Learn [more](/vql/references/query-performance-best-practices#Paginating_Results). |
| `data` | All records found. |
</FieldTable>

## About the X-VaultAPI-DescribeQuery Header {#about-the-x-vaultapi-describequery-header}

When you include the `X-VaultAPI-DescribeQuery` header and set it to `true`, the query response includes the following static metadata description:

<FieldTable>
| Name | Description |
| --- | --- |
| `name` | The name of the queryable object. |
| `label` | The label of the queryable object. |
| `label_plural` | The plural label of the queryable object |
</FieldTable>
The field metadata may include some or all of the following:

<FieldTable>
| Metadata Field | Description |
| --- | --- |
| `name` | Name of the field. |
| `label` | The UI label of the field. |
| `type` | The data type, for example, `string` or `int` |
| `max_length` | The max length of a string field. |
| `max_value` | The max value of a number field. |
| `min_value` | The minimum value of a number field. |
| `scale` | The number of digits after a decimal point in a number field. |
| `required` | Indicates the field is required. |
| `unique` | Indicates if the value must be unique (true/false). |
| `status` | Indicates if the field is active (active/inactive). |
| `picklist` | The picklist name field value. |
</FieldTable>
<Aside>For formula fields, `QueryDescribe` should describe the field as specified in the metadata, excluding the `formula` attribute.</Aside>



---

**Previous:** [Vault Query Language (VQL)](/qualityone/vault-api/api-reference/19.1/vault-query-language-vql)  
**Next:** [Metadata Definition Language (MDL)](/qualityone/vault-api/api-reference/19.1/metadata-definition-language-mdl)