Composition API
Returns a Document Object with resolved includes and linked content.
/api/2026-03/composition/{documentId}Request Body
JSON BodySent as JSON in the request body.
| Parameter | Type | Description |
fields | array<string> | A list of the properties which should be computed and returned. Default: ['systemdata', 'content', 'metadata', 'includes', 'html', 'design'] |
metadata.preload | object | You can pass metadata properties which should be resolved. Example: |
resolveIncludes | boolean | Resolve includes. If |
renderOptions.renderDirectiveInfo | boolean | Add attributes with the directive name to directive elements. |
ignoreComponentConditions | boolean | (added in release-2024-03) Provides a way to opt out of component filtering and return all content regardless of whether each component passes the conditional checks. Default: |
componentConditions | string | (added in release-2024-03) JSON stringified object which contains the component conditions you would like to apply. Default: |
Description
The Composition API loads a Publication with all required information to render a whole document with one request.
Advantages
- Make only one request to get all the required information to render a publication
- High-performing and efficient preloading of references (e.g. lists, includes, other references)
- Useful for a pull architecture
- Deduplication of document teasers: Teasers in
li-document-searchandli-list-referenceare deduplicated across a document, taking into account teasers fromli-document-referenceandli-document-referencesas well. - The only endpoint which is able to resolve includes
Related
- Latest Publication API
Responses
Include Resolution
The Composition API is the only endpoint that can resolve includes. Other Publication endpoints (e.g. Latest Publication) always return includes unresolved.
When resolveIncludes is not set (default), the response is identical to other Publication endpoints: include directives appear in the content array with their service, params, and any overrides. See Include Directives for the data shape.
When resolveIncludes is set (e.g. resolveIncludes=article-teaser-service,embed-service), the Composition API resolves the specified include services and returns the results in a separate includes array:
{
"systemdata": {},
"metadata": {},
"content": [
{
"id": "doc-abc123",
"component": "article-teaser",
"content": {
"teaser": {
"service": "article-teaser-service",
"params": {"article": {"$ref": "document", "reference": {"id": "42"}}}
}
}
}
],
"includes": [
{
"componentId": "doc-abc123",
"directiveName": "teaser",
"resolvedValue": {
"editableContent": true,
"content": [
{
"id": "teaser-42",
"component": "teaser-standard-render",
"content": {
"title": "Article title",
"lead": "Article lead text"
}
}
]
}
}
]
}
The content array always contains the unresolved include directives (with params and overrides intact). The includes array provides the resolved output — the render components the include service would produce.
Overrides and Resolved Includes
When an include has editable content overrides, the overrides remain in the content array on the unresolved directive. The resolvedValue in the includes array contains the source values from the include service (not the overridden values). Your delivery must merge the two: use the override values from content where they exist, falling back to the resolved source values from includes.
The editableContent flag in resolvedValue indicates whether the include supports overrides. When false, any existing overrides should be ignored (this happens when the framework disables editing for dynamic teaser resolution).