Download OpenAPI specification:Download
Crafter Engine API
Get an Item from the content store.
This API is used to get pages, components and folders. It returns the content and other metadata such as url, descriptorUrl, folder flag, and extra properties
Note: This API also returns 'disabled' items when Crafter Engine is in preview mode to support authoring use cases.
url required | string The item’s url (e.g. /site/website/index.xml) |
flatten | boolean Indicates if included descriptors should be flattened |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "name": "website",
- "url": "/site/website",
- "descriptorUrl": "/site/website.meta.xml",
- "descriptorDom": null,
- "properties": null,
- "folder": true
}
Get the list of Items directly under a folder in the content store.
url required | string The folder’s url (e.g. /site/website/index.xml) |
flatten | boolean Indicates if included descriptors should be flattened |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
[- {
- "name": "articles",
- "url": "/site/website/articles",
- "descriptorUrl": "/site/website/articles.meta.xml",
- "descriptorDom": null,
- "properties": null,
- "folder": true
}, - {
- "name": "crafter-level-descriptor.level.xml",
- "url": "/site/website/crafter-level-descriptor.level.xml",
- "descriptorUrl": "/site/website/crafter-level-descriptor.level.xml",
- "descriptorDom": {
- "component": {
- "content-type": "/component/level-descriptor",
- "display-template": {
- "crafter-source": "/site/website/crafter-level-descriptor.level.xml",
- "crafter-source-content-type-id": "/component/level-descriptor"
}, - "merge-strategy": "inherit-levels",
- "file-name": "crafter-level-descriptor.level.xml",
- "objectGroupId": "0a68",
- "objectId": "0a68e8ad-77d8-0a58-e7bf-09a71fb3077b",
- "folder-name": {
- "crafter-source": "/site/website/crafter-level-descriptor.level.xml",
- "crafter-source-content-type-id": "/component/level-descriptor"
}, - "header_o": {
- "item": {
- "key": "/site/components/headers/header.xml",
- "value": "Header",
- "include": "/site/components/headers/header.xml",
- "disableFlattening": "false"
}
}, - "createdDate": "2017-03-13T20:26:50.000Z",
- "createdDate_dt": "2017-03-13T20:26:50.000Z",
- "lastModifiedDate": "2017-05-18T15:38:58.000Z",
- "lastModifiedDate_dt": "2017-05-18T15:38:58.000Z",
- "left_rail_o": {
- "item": {
- "key": "/site/components/left-rails/left-rail-with-no-articles.xml",
- "value": "Left Rail with No Articles",
- "include": "/site/components/left-rails/left-rail-with-no-articles.xml",
- "disableFlattening": "false"
}
}
}
}, - "properties": null,
- "folder": false
}, - {
- "name": "entertainment",
- "url": "/site/website/entertainment",
- "descriptorUrl": "/site/website/entertainment.meta.xml",
- "descriptorDom": null,
- "properties": null,
- "folder": true
}, - {
- "name": "health",
- "url": "/site/website/health",
- "descriptorUrl": "/site/website/health.meta.xml",
- "descriptorDom": null,
- "properties": null,
- "folder": true
}, - {
- "name": "index.xml",
- "url": "/site/website/index.xml",
- "descriptorUrl": "/site/website/index.xml",
- "descriptorDom": {
- "page": {
- "content-type": "/page/home",
- "display-template": "/templates/web/pages/home.ftl",
- "merge-strategy": "inherit-levels",
- "file-name": "index.xml",
- "objectGroupId": "8d7f",
- "objectId": "8d7f21fa-5e09-00aa-8340-853b7db302da",
- "folder-name": {
- "crafter-source": "/site/website/crafter-level-descriptor.level.xml",
- "crafter-source-content-type-id": "/component/level-descriptor"
}, - "header_o": {
- "crafter-source": "/site/website/crafter-level-descriptor.level.xml",
- "crafter-source-content-type-id": "/component/level-descriptor",
- "item": {
- "key": "/site/components/headers/header.xml",
- "value": "Header",
- "include": "/site/components/headers/header.xml",
- "disableFlattening": "false"
}
}, - "createdDate": "2017-01-31T16:18:14.000Z",
- "createdDate_dt": "2017-01-31T16:18:14.000Z",
- "lastModifiedDate": "2021-03-31T18:08:03.196Z",
- "lastModifiedDate_dt": "2021-03-31T18:20:09.599Z",
- "left_rail_o": {
- "item": [
- {
- "key": "/site/components/left-rails/left-rail-with-latest-articles.xml",
- "value": "Left Rail with Latest Articles",
- "include": "/site/components/left-rails/left-rail-with-latest-articles.xml",
- "disableFlattening": "false"
}
]
}, - "no-template-required": null,
- "internal-name": "Home",
- "orderDefault_f": "-1",
- "title_t": "Editorial",
- "hero_text_html": "<p>Aenean ornare velit lacus, ac varius enim ullamcorper eu. Proin aliquam facilisis ante interdum congue. Integer mollis, nisl amet convallis, porttitor magna ullamcorper, amet egestas mauris. Ut magna finibus nisi nec lacinia. Nam maximus erat id euismod egestas. Pellentesque sapien ac quam. Lorem ipsum dolor sit nullam.</p>",
- "hero_title_html": "<h1>Hi, I’m Editorial</h1>\n <h3><span style=\"font-size: 1.5em;\">by HTML5 UP</span></h3>",
- "features_o": {
- "item": [
- {
- "datasource": "features",
- "key": "/site/components/features/4be0a368-783c-8f73-7469-63a62636bd4c.xml",
- "value": "Smile",
- "include": "/site/components/features/4be0a368-783c-8f73-7469-63a62636bd4c.xml",
- "disableFlattening": "false"
}, - {
- "datasource": "features",
- "inline": "true",
- "key": "310b0c87-c3ca-4da0-4aa2-7002a318d7ce",
- "value": "Download",
- "disableFlattening": "false",
- "component": {
- "id": "310b0c87-c3ca-4da0-4aa2-7002a318d7ce",
- "content-type": "/component/feature",
- "display-template": "/templates/web/components/feature.ftl",
- "no-template-required": null,
- "merge-strategy": "inherit-levels",
- "objectGroupId": "310b",
- "objectId": "310b0c87-c3ca-4da0-4aa2-7002a318d7ce",
- "file-name": "310b0c87-c3ca-4da0-4aa2-7002a318d7ce.xml",
- "internal-name": "Download",
- "title_t": "Download",
- "disabled": "false",
- "icon_s": "fa-arrow-alt-circle-down far",
- "body_html": "<p>Download ornare velit lacus, ac varius enim lorem ullamcorper dolore.\n Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n ",
- "createdDate": "2019-10-11T19:20:07.555Z",
- "createdDate_dt": "2019-10-11T19:20:07.555Z",
- "lastModifiedDate": "2019-12-22T11:56:51.172Z",
- "lastModifiedDate_dt": "2019-12-22T11:56:51.172Z"
}
}, - {
- "datasource": "features",
- "inline": "true",
- "key": "a89386c4-a205-2681-2db1-c3606f714411",
- "value": "Build",
- "disableFlattening": "false",
- "component": {
- "id": "a89386c4-a205-2681-2db1-c3606f714411",
- "content-type": "/component/feature",
- "display-template": "/templates/web/components/feature.ftl",
- "no-template-required": null,
- "merge-strategy": "inherit-levels",
- "objectGroupId": "a893",
- "objectId": "a89386c4-a205-2681-2db1-c3606f714411",
- "file-name": "a89386c4-a205-2681-2db1-c3606f714411.xml",
- "internal-name": "Build",
- "title_t": "Build",
- "disabled": "false",
- "icon_s": "fa-building far",
- "body_html": "<p>Build enean ornare velit lacus, ac varius enim lorem ullamcorper dolore.\n Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p>\n ",
- "createdDate": "2019-10-11T19:19:53.590Z",
- "createdDate_dt": "2019-10-11T19:19:53.590Z",
- "lastModifiedDate": "2019-12-22T11:56:34.603Z",
- "lastModifiedDate_dt": "2019-12-22T11:56:34.603Z"
}
}, - {
- "datasource": "features",
- "key": "/site/components/features/72ef047f-02b7-89e2-bbd5-4763ac7dbca8.xml",
- "value": "Closed captioning",
- "include": "/site/components/features/72ef047f-02b7-89e2-bbd5-4763ac7dbca8.xml",
- "disableFlattening": "false"
}
]
}, - "hero_image_s": "/static-assets/images/strawberries.jpg",
- "features_title_t": "Erat lacinia",
- "disabled": "false"
}
}, - "properties": null,
- "folder": false
}, - {
- "name": "search-results",
- "url": "/site/website/search-results",
- "descriptorUrl": "/site/website/search-results.meta.xml",
- "descriptorDom": null,
- "properties": null,
- "folder": true
}, - {
- "name": "style",
- "url": "/site/website/style",
- "descriptorUrl": "/site/website/style.meta.xml",
- "descriptorDom": null,
- "properties": null,
- "folder": true
}, - {
- "name": "technology",
- "url": "/site/website/technology",
- "descriptorUrl": "/site/website/technology.meta.xml",
- "descriptorDom": null,
- "properties": null,
- "folder": true
}
]
Get the complete Item hierarchy under the specified folder in the content store.
url required | string The folder’s url (e.g. /site/website/index.xml) |
depth | integer Amount of levels to include (unlimited by default) |
flatten | boolean Indicates if included descriptors should be flattened |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "name": "string",
- "url": "string",
- "descriptorUrl": "string",
- "descriptorDom": { },
- "properties": "string",
- "folder": true
}
Performs a query in the GraphQL instance of the current site resolved for the request.
Note:
The query string must be a valid GraphQL query as described in the official docs
query required | string Example: query={page_article{items{title_t}}} The GraphQL query |
operationName | string The GraphQL operation name |
variables | string A JSON object containing variables for the query |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "data": {
- "page_article": {
- "items": [
- {
- "title_t": "New ACME Phone Released Today"
}, - {
- "title_t": "Top Clubs In Virginia"
}, - {
- "title_t": "Coffee is Good for Your Health"
}, - {
- "title_t": "5 Popular Diets for Women"
}, - {
- "title_t": "Top Romantic Valentine Movies"
}, - {
- "title_t": "10 Tips to Get a Six Pack"
}, - {
- "title_t": "Women Styles for Winter"
}, - {
- "title_t": "Men Styles For Winter"
}, - {
- "title_t": "Top Books For Young Women"
}
]
}
}
}
Performs a query in the GraphQL instance of the current site resolved for the request.
Note:
The query string must be a valid GraphQL query as described in the official docs
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
Search Parameters
query required | string The GraphQL query |
variables | object A JSON object containing variables for the query |
operationName | string Name you give to your query |
{- "query": "query ArticlesByAuthor($author:String) { page_article { total items { title_t author_s(filter:{equals:$author}) date_dt } } }",
- "variables": {
- "author": "Jane Doe"
}, - "operationName": "ArticlesByAuthor"
}
{- "data": {
- "page_article": {
- "total": 4,
- "items": [
- {
- "title_t": "Women Styles for Winter",
- "author_s": "Jane Doe",
- "date_dt": "2021-01-03T05:00:00Z"
}, - {
- "title_t": "Top Books For Young Women",
- "author_s": "Jane Doe",
- "date_dt": "2020-12-28T05:00:00Z"
}, - {
- "title_t": "5 Popular Diets for Women",
- "author_s": "Jane Doe",
- "date_dt": "2021-03-14T04:00:00Z"
}, - {
- "title_t": "Top Romantic Valentine Movies",
- "author_s": "Jane Doe",
- "date_dt": "2021-02-14T05:00:00Z"
}
]
}
}
}
Performs a search operation in the OpenSearch index of the current site resolved for the request and optional other indexes. See Multi-index Query for more information on performing a multiple index search.
Note:
The request body must be a valid OpenSearch JSON query as described in the official docs
index | string Comma separated list of index names to be searched in addition to the current site |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
User entity to create
_source | string |
size | integer |
query | object |
{- "_source": "localId",
- "size": 1,
- "query": {
- "match_all": { }
}
}
{- "took": 41,
- "timed_out": false,
- "_shards": {
- "total": 5,
- "successful": 5,
- "skipped": 0,
- "failed": 0
}, - "hits": {
- "total": 28,
- "max_score": 1,
- "hits": [
- {
- "_index": "editorial-preview_v1",
- "_type": "_doc",
- "_id": "f4a1af43fed0b4e246abb3a8c7d7323d",
- "_score": 1,
- "_source": {
- "localId": "/site/components/articles-widget/latest-articles-widget.xml"
}
}
]
}
}
Clear the content cache scope and the Freemarker cache for the current site context.
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "message": "Cache clear for site 'sample' started"
}
Get the statistics for all cache scopes for the current site context.
Note:
The result of this call can change based on the configuration of the system, for example when Crafter Engine is configured in preview mode the cache will be disabled and the result will always be an empty object. There could be also different statistics returned depending on the cache implementation that is being used.
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "size": 17,
- "localHeapSize": 17,
- "localOffHeapSize": 0,
- "localDiskSize": 0,
- "cacheHitRatio": 1,
- "cacheHitCount": 4,
- "cacheMissCount": 25,
- "cacheMissExpiredCount": 0,
- "cacheMissNotFoundCount": 25
}
Get the ID for the site context resolved for the current request, the value returned will depend on the SiteResolver implementation used.
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "id": "405ffc233d075b010536bd2eb786b86c"
}
Get the status for the site context resolved for the current request, the value returned will depend on the SiteResolver implementation used.
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "status": "READY"
}
Destroy the site context resolved for the current request. Destroying the context involves clearing the cache, destroying any loaded configuration and Spring beans for the site, and destroying the Groovy classloader for the site.
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "message": "Site context for 'sample' destroyed. Will be recreated on next request"
}
Rebuild the site context resolved for the current request, which means destroying and then creating the context again.
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "message": "Started rebuild for site context for 'sample'"
}
Rebuild the GraphQL schema for the site context resolved for the current request.
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "message": "Rebuild of GraphQL schema started for 'sample'"
}
Reload the mappings used to resolve sites by Crafter Engine. This endpoint is only available when Crafter Engine is in mapped multi-tenant mode.
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "message": "Mappings reloaded"
}
Returns the Crafter Engine JVM memory details.
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "totalJvmMemory": 2017984512,
- "freeJvmMemory": 1113921056,
- "maxJvmMemory": 3817865216,
- "totalOsMemory": 17179869184,
- "freeOsMemory": 2669301760,
- "totalSwapMemory": 2147483648,
- "freeSwapMemory": 1026555904
}
Returns the Crafter Engine JVM status details.
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "uptime": 2017984512,
- "startup": "2019-03-07T21:29:11.049Z"
}
Returns the Crafter Engine JVM status details.
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "packageName": "Crafter Engine",
- "packageVersion": "4.0.3-SNAPSHOT",
- "packageBuild": "48d29a56c6011f2908fb160f7648f66785d44b81",
- "packageBuildDate": "2023-03-08T21:53:22.558Z",
- "osName": "Mac OS X",
- "osVersion": "11.2",
- "osArch": "x86_64",
- "javaVersion": "11",
- "javaVendor": "Oracle Corporation",
- "javaVm": "OpenJDK 64-Bit Server VM"
}
Returns all events recorded in the Crafter Engine log for a given site in a specific time period.
site required | string Example: site=my-editorial The name of the site |
since required | integer Example: since=1396772083660 The time in milliseconds from which events should be fetched |
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
[- {
- "exception": "",
- "site": "editorial",
- "level": "INFO",
- "thread": "pool-16-thread-1",
- "message": "--------------------------------------------------",
- "timestampm": 1678683085456,
- "timestamp": "2023-03-13T04:51:25.456+0000"
}, - {
- "exception": "",
- "site": "editorial",
- "level": "INFO",
- "thread": "pool-16-thread-1",
- "message": "<Initializing context site: editorial>",
- "timestampm": 1678683085477,
- "timestamp": "2023-03-13T04:51:25.477+0000"
}, - {
- "exception": "",
- "site": "editorial",
- "level": "INFO",
- "thread": "pool-16-thread-1",
- "message": "--------------------------------------------------",
- "timestampm": 1678683085498,
- "timestamp": "2023-03-13T04:51:25.498+0000"
}, - {
- "exception": "",
- "site": "editorial",
- "level": "INFO",
- "thread": "pool-16-thread-1",
- "message": "Starting GraphQL schema build for site 'editorial'",
- "timestampm": 1678683085499,
- "timestamp": "2023-03-13T04:51:25.499+0000"
}
]
Get a list of all scheduled jobs for the current site.
token required | string Example: token=defaultManagementToken The authorization token |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
[- {
- "name": "editorial:/scripts/jobs/hourly/hourly-job.groovy",
- "nextFireTime": "2022-05-08T00:00:00Z"
}, - {
- "name": "editorial:/scripts/jobs/custom-job.groovy",
- "nextFireTime": "2022-05-08T00:00:00Z"
}
]
Get the current user’s profile from the session, if no profile is set an empty one will be created. Only use it in conjunction with Studio’s Personas.
crafterSite | string Example: crafterSite=my-editorial Used to set the project/site value |
{- "age": 30,
- "username": "john",
- "lastname": "doe"
}
Set the current user’s profile, all parameters are added to the profile and stored in the session. Only use it in conjunction with Studio’s Personas.
Note:
Any parameter included in the request will be added as a property for the user profile, if the request is made without any parameter then profile will be cleared.
crafterSite | string Example: crafterSite=my-editorial Used to set the project/site value |
property name* additional property | string |
{- "username": "john",
- "lastname": "doe",
- "age": "30"
}
{- "id": "65de6381b77c310708fbde2665de6381b77c310708fbde26",
- "username": "john",
- "lastname": "doe",
- "age": "30"
}
Get a component.
path required | string Example: path=/site/components/features/4be0a368-783c-8f73-7469-63a62636bd4c.xml Path to the component |
crafterSite required | string Example: crafterSite=my-editorial Used to set the project/site value |
"<!-- Feature Component -->\\n <article class=\"feature\" data-craftercms-model-path=\"/site/components/features/4be0a368-783c-8f73-7469-63a62636bd4c.xml\" data-craftercms-model-id=\"4be0a368-783c-8f73-7469-63a62636bd4c\" > <span class=\"icon fa-smile far\" data-craftercms-model-path=\"/site/components/features/4be0a368-783c-8f73-7469-63a62636bd4c.xml\" data-craftercms-model-id=\"4be0a368-783c-8f73-7469-63a62636bd4c\" data-craftercms-field-id=\"icon_s\" ></span> <div class=\"content\"> <h3 data-craftercms-model-path=\"/site/components/features/4be0a368-783c-8f73-7469-63a62636bd4c.xml\" data-craftercms-model-id=\"4be0a368-783c-8f73-7469-63a62636bd4c\" data-craftercms-field-id=\"title_t\" > Smile </h3> <div data-craftercms-model-path=\"/site/components/features/4be0a368-783c-8f73-7469-63a62636bd4c.xml\" data-craftercms-model-id=\"4be0a368-783c-8f73-7469-63a62636bd4c\" data-craftercms-field-id=\"body_html\" > <p>Smile, aenean ornare velit lacus, ac varius enim lorem ullamcorper dolore. Proin aliquam facilisis ante interdum. Sed nulla amet lorem feugiat tempus aliquam.</p> </div> </div> </article> <!-- /Feature Component -->"