Skip to content

VQL queries go to the /query REST interface. Submit a query by sending a POST request to the following endpoint:

/api/{version}/query

NameDescription
Acceptapplication/json (default) or application/xml
X-VaultAPI-DescribeQuerySet 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.
curl -X POST -H "Authorization: {SESSION_ID}" \ -H "X-VaultAPI-DescribeQuery: true" \ https://myvault.veevavault.com/api/v17.3/query?q=SELECT id FROM documents
{ "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 } ] }

On SUCCESS, the response includes the following information:

NameDescription
limitThe number of records displayed per page. This can be modified. Learn more.
offsetThe records displayed on the current page are offset by this number of records. Learn more.
sizeThe total number of records displayed on the current page.
totalThe total number of records found.
previous_pageThe Pagination URL to navigate to the previous page of results. This is not always available. Learn more.
next_pageThe Pagination URL to navigate to the next page of results. This is not always available. Learn more.
dataAll records found.

About the X-VaultAPI-DescribeQuery Header

Section link for 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:

NameDescription
nameThe name of the queryable object.
labelThe label of the queryable object.
label_pluralThe plural label of the queryable object

The field metadata may include some or all of the following:

Metadata FieldDescription
nameName of the field.
labelThe UI label of the field.
typeThe data type, for example, string or int
max_lengthThe max length of a string field.
max_valueThe max value a number field.
min_valueThe minimum value of a number field.
scaleThe number of digits after a decimal point in a number field.
requiredIndicates the field is required.
uniqueIndicates if the value must be unique (true/false).
statusIndicates if the field is active (active/inactive).
picklistThe picklist name field value.