**Source URL:** https://general.veevavault.dev/vault-api/api-reference/26.1/configuration-migration/component-definition-query.md

# Component Definition Query



Retrieve MDL definitions (`mdl_definition__v`) and JSON definitions (`json_definition__v`) of Vault components using a VQL query on the `vault_component__v` and `vault_package_component__v` query targets. Learn more in the [VQL documentation](/vql/query-targets/vault-component-definitions).

<Endpoint path="/api/{version}/query/components" method="POST"></Endpoint>

## Headers {#headers}

<FieldTable>
| Name | Description |
| --- | --- |
| `Accept` | `application/json` (default) or `application/xml` |
| `Content-Type` | `application/x-www-form-urlencoded` or `multipart/form-data` |
| `X-VaultAPI-RecordProperties` | Optional: If present, the response includes the record properties object. Possible values are `all`, `hidden`, `redacted`, and `weblink`. If omitted, the record properties object is not included in the response. [Learn more](/vault-api/api-reference/26.1/vault-query-language-vql/submitting-a-query/#RecordProperties_Header). |
</FieldTable>

## Body Parameters {#body-parameters}

<FieldTable>
| Name | Description |
| --- | --- |
| `q` | A VQL query on the `vault_component__v` or `vault_package_component__v` [query targets](/vql/query-targets/vault-component-definitions). The query can be up to 50,000 characters, formatted as `q={query}`. For example, `q=SELECT id FROM vault_component__v`. Note that submitting the query as a query parameter instead may cause you to exceed the maximum URL length. |
</FieldTable>

## Request {#request}

<CodeExample title="">
```
curl -X POST -H "Authorization: {SESSION_ID}" \
-H "Content-Type: application/x-www-form-urlencoded" \
-H "Accept: application/json" \
--data-urlencode "q=SELECT id, mdl_definition__v FROM vault_component__v WHERE component_type__v = 'Reporttype'"
https://myvault.veevavault.com/api/v25.1/query/components

```
</CodeExample>

## Response {#response}

<CodeExample title="">
```
{
   "responseStatus": "SUCCESS",
   "responseDetails": {
       "pagesize": 1000,
       "pageoffset": 0,
       "size": 3,
       "total": 3
   },
   "data": [
   {
       "id": "0CD000000000111",
       "mdl_definition__v": "RECREATE Reporttype binder_section_with_document_and_bind__v (\n   label('Binder Section with Document and Binder'),\n   active(true),\n   description(),\n   primary_object('binder_section'),\n   primary_objects(),\n   configuration({<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<vrt:reportType xmlns:vrt=\"VaultReporttype\">\n  <vrt:upRelationships>\n    <vrt:upRelationship key=\"binder_section.root_binder_id__v\" />\n  </vrt:upRelationships>\n  <vrt:downRelationships>\n    <vrt:downRelationship key=\"documents\" />\n  </vrt:downRelationships>\n</vrt:reportType>\n}),\n   class('Standard')\n);"
   },
   {
       "id": "0CD000000000112",
       "mdl_definition__v": "RECREATE Reporttype binder_with_document__v (\n   label('Binder with Document'),\n   active(true),\n   description(),\n   primary_object('binder'),\n   primary_objects(),\n   configuration({<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<vrt:reportType xmlns:vrt=\"VaultReporttype\">\n  <vrt:downRelationships>\n    <vrt:downRelationship key=\"documents\" />\n  </vrt:downRelationships>\n</vrt:reportType>\n}),\n   class('Standard')\n);"
   },
   {
       "id": "0CD000000000113",
       "mdl_definition__v": "RECREATE Reporttype product_with_document__c (\n   label('Product with Document'),\n   active(true),\n   description('Product with Product (Document)'),\n   primary_object('product__v'),\n   primary_objects(),\n   configuration({<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<vrt:reportType xmlns:vrt=\"VaultReporttype\">\n  <vrt:downRelationships>\n    <vrt:downRelationship key=\"documents.product__v\" />\n  </vrt:downRelationships>\n</vrt:reportType>\n}),\n   class('Standard')\n);"
   }
  ]
}

```
</CodeExample>

## Response Details {#response-details}

On `SUCCESS`, the response includes the following information:

<FieldTable>
| Name | Description |
| --- | --- |
| `pagesize` | The number of records displayed per page. This can be modified. [Learn more](/vql/clauses/pagesize). |
| `pageoffset` | 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` | The set of field values specified in the VQL query. |
</FieldTable>

---

**Previous:** [Retrieve Outbound Package Dependencies](/vault-api/api-reference/26.1/configuration-migration/retrieve-outbound-package-dependencies)  
**Next:** [Vault Compare](/vault-api/api-reference/26.1/configuration-migration/vault-compare)