Composition API

Returns a Document Object with resolved includes and linked content.

POST/api/2026-03/composition/{documentId}
public-api:read
Latest version (since 2025-03)

Request Body

JSON Body

Sent as JSON in the request body.

ParameterTypeDescription
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.
This only works for properties of type li-document-reference, li-document-references, li-list-reference and li-tree.

Example: {"metadata": {"preload": {"myProp": true}}}

resolveIncludes
boolean

Resolve includes. If true then 'includes' will be populated and includes will be resolved in the rendered html. If 'includes' is added to the fields array as above, they are resolved in a separate array from the content.

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: false

componentConditions
string

(added in release-2024-03)

JSON stringified object which contains the component conditions you would like to apply.

Default: dateTime: new Date()
Example: ?componentConditions={"dateTime":"2024-02-14T17:25:10.391Z"}

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-search and li-list-reference are deduplicated across a document, taking into account teasers from li-document-reference and li-document-references as 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).

⌘ K to search