VTEX Headless CMS (0.31.2)
The VTEX Headless CMS is a no-code management system for storefront content. That means you can store your content as structured data in a layer decoupled from the frontend and use the VTEX Headless CMS to access and deliver your content to your storefront project.
Notice that the VTEX Headless CMS typically works with FastStore projects only. In this case, you can use this API to fetch data using SSR (NextJS and Gatsby v4+) or SSG (NextJS).
Servers
https://{account}.myvtex.com/
https://{workspace}--{account}.myvtex.com/
Server variables
accountName
: Name of your VTEX account.workspace
: Name of your VTEX workspace.
Get all CMS pages
Gets all data from all CMS pages.
path Parameters
builderId required | string Example: faststore Builder ID specified in the settings of the CMS app. |
Responses
Response samples
- 200
{- "contentTypes": [
- {
- "id": "plp",
- "name": "PLP",
- "configurationSchemaSets": {
- "name": "Parameters",
- "configurations": {
- "name": "Collection",
- "schema": {
- "title": "Collection",
- "description": "Definition of a Collection for the CMS",
- "oneOf": [
- {
- "title": "Category",
- "description": "Configure a Category",
- "type": "object",
- "required": [
- "categoryId",
- "sort"
], - "properties": {
- "categoryId": {
- "title": null,
- "type": null
}, - "sort": {
- "title": null,
- "type": null,
- "default": null,
- "enum": [ ],
- "enumNames": [ ]
}
}
}
]
}
}
}
}
]
}
Get CMS page
Gets all data from a given page or Content Type.
Usage
Check the following suggestions on how to use this endpoint:
- Get data by document ID:
/_v/cms/api/:builderId/:content-type/:document-id
- Get an specific version of the document:
/_v/cms/api/:builderId/:content-type/:document-id?versionId=:version-id
- Get the content of a release:
/_v/cms/api/:builderId/:content-type/:document-id?releaseId=:release-id
Use filters on the URL to get only what you need.
- Filter by props on the first level of the document:
/_v/cms/api/faststore/plp?filters[status]=published
- Filter results by nested props
- SEO Slug:
/_v/cms/api/faststore/plp?filters[parameters.collection.seo.slug]=/summer
- SEO Title:
/_v/cms/api/faststore/plp?filters[parameters.collection.seo.title]=Summer%20Deals
- Category ID:
/_v/cms/api/faststore/plp?filters[parameters.collection.categoryId]=25
- SEO Slug:
- Filter by multiple fields:
/_v/cms/api/faststore/plp?filters[parameters.collection.clusterId]=1970&filters[name]=Summer
path Parameters
builderId required | string Example: faststore Builder ID specified in the settings of the CMS app. |
content-type required | string Example: plp Content Type ID defined in the FastStore project. |
document-id | string Example: 5af643b5-9a6d-48f2-9b34-919dd762c908 Document ID presented in the URL path of a CMS preview. |
query Parameters
versionId | string Example: versionId=e7263fc8-bc68-4052-9e25-dd5a2572d3bb Version ID presented in the URL path of a CMS preview. |
releaseId | string Example: releaseId=6196c277c6dce15f9709a2a7 Release ID presented in the URL path of a CMS preview. |
filters[status] | string Example: filters[status]=draft&filters[status]=published&filters[status]=publishing&filters[status]=unpublishing Filter by the status of the page. |
filters[parameters.collection.seo.slug] | string Example: filters[parameters.collection.seo.slug]=Summer%20Deals Filter by the SEO slug of a collection. |
filters[parameters.collection.seo.title] | string Example: filters[parameters.collection.seo.title]=Summer%20Deals Filter by the SEO title of a collection. |
filters[parameters.collection.categoryId] | string Example: filters[parameters.collection.categoryId]=25 Filter by the category ID of a collection. |
filters[name] | string Example: filters[name]=Summer Filter by the page name. |
Responses
Response samples
- 200
{- "id": "7db1406b-f5fd-486c-b549-25cda55b308c",
- "name": "Home Page",
- "type": "home",
- "status": "published",
- "versionId": "4e840369-505a-49ab-98aa-dc0c27f53e1e",
- "versionStatus": "published",
- "sections": {
- "id": 1641388937280,
- "name": "Hero",
- "data": {
- "title": "New Products Available",
- "subtitle": "Lorem ipsum dolor amet, consectetur adipiscing elit. Lorem ipsum.",
- "linkText": "See all",
- "link": "/",
- "imageAlt": "Gadgets"
}
}
}