> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get a template

> Retrieve the template for the given navigation state. By default will only trigger published versions of templates, specify staging=true to instead trigger staging versions of templates.Navigation state is determined by the userQuery (for the search terms) and the filters from the DSL request (for the filter values).



## OpenAPI

````yaml /api-reference/5.9/fusion-api-templating.json post /triggerDSL/{app}
openapi: 3.0.1
info:
  title: Fusion Templating API
  description: >-
    This API lets you perform create, read, update, and delete (CRUD) operations
    on templates and zones, and retrieve and render templates for particular
    navigation states.
  termsOfService: https://lucidworks.com/legal/developer-license-agreement/
  contact:
    name: Lucidworks
    url: https://lucidworks.com
    email: support@lucidworks.com
  license:
    name: License of API
    url: https://lucidworks.com/legal/developer-license-agreement/
  version: '5.9'
servers:
  - url: https://{FUSION_HOST.com}/api/templating
    description: Fusion
    variables:
      FUSION_HOST.com:
        default: ''
security: []
tags:
  - name: page-metadata-controller
    description: Endpoints with this tag modify page metadata.
  - name: render-controller
    description: >-
      Endpoints with this tag use the GET and POST operations to retrieve,
      render, create, read, update, and delete Fusion application templates that
      are published or in staging (unpublished).
  - name: template-settings-controller
    description: >-
      Endpoints with this tag use the GET, POST, PUT, and DELETE operations to
      create, read, update, and delete configuration information for the Fusion
      Templating service.
  - name: templates-controller
    description: >-
      Endpoints with this tag use the GET, POST, PUT, and DELETE operations to
      create, read, update, and delete Fusion application template information.
  - name: trigger-controller
    description: >-
      Endpoints with this tag use the GET and POST operations to retrieve,
      create, read, and update the Fusion application templates that are
      published or in staging (unpublished) without rendering.
  - name: zones-controller
    description: >-
      Endpoints with this tag use the GET, POST, PUT, and DELETE operations to
      retrieve, create, read, update, and delete zone information (Fusion query
      profiles).
paths:
  /triggerDSL/{app}:
    post:
      tags:
        - trigger-controller
      summary: Get a template
      description: >-
        Retrieve the template for the given navigation state. By default will
        only trigger published versions of templates, specify staging=true to
        instead trigger staging versions of templates.Navigation state is
        determined by the userQuery (for the search terms) and the filters from
        the DSL request (for the filter values).
      operationId: post-triggerDSL-by-applicationId
      parameters:
        - name: app
          in: path
          description: Application ID
          required: true
          schema:
            type: string
        - name: requestParams
          in: query
          description: Request parameters (for fqs)
          required: true
          schema: {}
        - name: staging
          in: query
          description: >-
            This field indicates if the request is set to retrieve published or
            unpublished (staging) templates. The default of `false` retrieves
            published templates. If set to `true`, the request retrieves
            unpublished (staging) templates.
          schema:
            type: boolean
            default: false
        - name: templateTypes
          in: query
          description: >-
            Comma-separated list of template types, indicating which possible
            types of templates to trigger (e.g. landing, item-detail...)
          style: form
          explode: true
          schema:
            type: array
            items:
              type: string
      requestBody:
        description: DSL request
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DslRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/triggerResponse'
        '201':
          description: Created
          content: {}
        '401':
          description: Unauthorized
          content: {}
        '403':
          description: Forbidden
          content: {}
        '404':
          description: Not Found
          content: {}
components:
  schemas:
    DslRequest:
      title: DslRequest
      type: object
      properties:
        context:
          type: object
          properties: {}
        facets:
          $ref: '#/components/schemas/Facets'
        params:
          type: object
          properties: {}
        queryDefinition:
          $ref: '#/components/schemas/QueryDefinition'
        results:
          $ref: '#/components/schemas/Results'
      x-stoplight:
        id: qx4q8p2j2vmh8
    triggerResponse:
      title: triggerResponse
      x-stoplight:
        id: 287809fb042eb
      type: object
      properties:
        triggered:
          $ref: '#/components/schemas/templateWithZones'
      description: ''
    Facets:
      title: Facets
      type: object
      properties:
        fields:
          type: array
          items:
            $ref: '#/components/schemas/FacetField'
        groupFacets:
          type: boolean
        groupingMethod:
          type: string
          enum:
            - header_doc
            - unique
        ranges:
          type: array
          items:
            $ref: '#/components/schemas/FacetRange'
      x-stoplight:
        id: 5zb4qosae914t
    QueryDefinition:
      title: QueryDefinition
      type: object
      properties:
        boostsByQuery:
          type: array
          items:
            $ref: '#/components/schemas/BoostQuery'
        boostsByValues:
          type: array
          items:
            $ref: '#/components/schemas/BoostByValue'
        filters:
          type: array
          items:
            $ref: '#/components/schemas/Query'
        groupedFilters:
          type: array
          items:
            $ref: '#/components/schemas/Query'
        groupedQuery:
          $ref: '#/components/schemas/Query'
        main:
          $ref: '#/components/schemas/Query'
        namedFilters:
          type: array
          items:
            $ref: '#/components/schemas/NamedFilter'
        userQuery:
          type: string
      x-stoplight:
        id: wn51x8klmlhj9
    Results:
      title: Results
      type: object
      properties:
        cursor:
          type: string
        fields:
          type: array
          items:
            type: string
        group:
          $ref: '#/components/schemas/Group'
        highlight:
          $ref: '#/components/schemas/Highlight'
        includeRawResponse:
          type: boolean
        returnScore:
          type: boolean
        size:
          type: integer
          format: int64
        sort:
          type: array
          items:
            $ref: '#/components/schemas/SortElement'
        start:
          type: integer
          format: int64
      x-stoplight:
        id: 510xxa8iev1ly
    templateWithZones:
      title: templateWithZones
      x-stoplight:
        id: 83da126f6b52c
      type: object
      description: Ordered list of zones with associated trigger criteria.
      required:
        - app
        - id
      properties:
        app:
          type: string
          description: The Fusion application name.
          example: your-app-name
        id:
          type: string
          description: The universal unique identifier (UUID) of the Fusion application.
          format: uuid
          example: 6a163bd4-5098-466c-22aa-40bf68294303
        name:
          type: string
          description: The name of the template in this application.
          example: Item-Detail Page
        all:
          type: boolean
          description: >-
            This field indicates if the response includes published or
            unpublished (staging) templates. The default of `false` includes
            only published templates. If set to `true`, the request includes
            published and unpublished (staging) templates.
        priority:
          type: integer
          format: int64
          description: >-
            The order in which this template is processed when multiple
            templates with the same status (published or staging) are associated
            with the application. The higher the number, the earlier the
            template will be used. For example, a template with a priority of 10
            is triggered before a template with a priority of 3.
          example: 10
        dirty:
          type: boolean
          description: >-
            The status of the template. If `false`, the template is published.
            If `true`, this is the staging version of this template and it
            contains changes that have not yet been published.
          default: true
        templateDirty:
          type: boolean
          description: >-
            The status of the template. If `false`, the template does not have
            unpublished changes. If `true`, this is the staging version of this
            template and it contains changes that have not yet been published.
            This only applies to templates and is different from the status of
            the zone. Even if the associated zone (query profile) for this
            template is dirty (contains some type of changes that have not yet
            been published), the template and its status are separate.
          default: false
        markedForDeletion:
          type: boolean
          description: >-
            This field indicates if the staging version of this template has
            been marked for deletion, but the deletion has not been completed
            because it has not been published yet. If `true`, the template has
            been marked for deletion, and when it is published, it will actually
            be deleted. If `false`, the template has not been marked for
            deletion.
          default: false
        type:
          type: string
          description: >-
            The type of template associated with the response. Examples include
            landing and item-detail.
          example: lan
        metadata:
          type: object
          description: Additional data associated with the template.
          properties:
            type:
              type: string
              x-stoplight:
                id: 33ngpb0pkd3t7
              description: >-
                The type of template associated with the response. Examples
                include landing and item-detail.
              example: landing
        zones:
          type: array
          items:
            $ref: '#/components/schemas/zone'
        neverPublished:
          type: boolean
          description: >-
            The status of the template in the zone. If `false`, the template has
            been published at some point. If `true`, this template has never
            been published.
          default: false
        published:
          type: boolean
          description: >-
            This field indicates if the template is a published template. If
            `true`, this template has a status of published. If `false`, this
            template is not a template with a status of published.
        staging:
          type: boolean
          description: >-
            This field indicates if the template is a staging template. If
            `true`, this template has a status of staging. If `false`, this
            template is not a template with a status of staging.
        dirtyZoneIds:
          type: array
          description: >-
            The comma-delimited list of universal unique identifiers (UUIDs) of
            the zones (query profiles) that are associated with the template and
            have unpublished changes. This only applies to zones and is
            different from the status of the template. Even if the associated
            template is dirty (contains some type of changes that have not yet
            been published), the zones and their respective changes are
            separate.
          items:
            type: string
            example: >-
              a3e0e22-9e6a-45h9-a2e7-5hjk72b9a3ea,
              5avc1e65-162d-5b8e-92f0-6a962e0f43c5
        startTime:
          type: string
          description: >-
            The beginning date and time (in Epoch time format) when the template
            can be used.
          format: date-time
          example: '2024-08-24T14:15:22Z'
        endTime:
          type: string
          description: >-
            The template cannot be used after this date and time. The format is
            Epoch time format.
          format: date-time
          example: '2024-08-24T14:15:22Z'
        triggers:
          type: array
          description: >-
            Triggers - only one trigger needs to be satisfied in order for this
            template to trigger.
          items:
            $ref: '#/components/schemas/trigger'
    FacetField:
      title: FacetField
      type: object
      properties:
        domain:
          $ref: '#/components/schemas/FacetDomain'
        ensuredValues:
          type: array
          items:
            type: string
        field:
          type: string
        limit:
          type: integer
          format: int32
        minCount:
          type: integer
          format: int32
        missing:
          type: boolean
        offset:
          type: integer
          format: int32
        prefix:
          type: string
        sort:
          type: string
          enum:
            - count
            - index
      x-stoplight:
        id: 5p6x82nzscw48
    FacetRange:
      title: FacetRange
      type: object
      properties:
        domain:
          $ref: '#/components/schemas/FacetDomain'
        end:
          type: string
        field:
          type: string
        gap:
          type: string
        hardEnd:
          type: boolean
        include:
          type: array
          items:
            type: string
            enum:
              - all
              - edge
              - lower
              - outer
              - upper
        minCount:
          type: integer
          format: int32
        other:
          type: array
          items:
            type: string
            enum:
              - after
              - all
              - before
              - between
              - non
        start:
          type: string
      x-stoplight:
        id: m3t96yjzlsa8m
    BoostQuery:
      title: BoostQuery
      type: object
      properties:
        boost:
          type: number
          format: double
        query:
          $ref: '#/components/schemas/Query'
        type:
          type: string
      x-stoplight:
        id: kvorjutf2l279
    BoostByValue:
      title: BoostByValue
      type: object
      properties:
        boosts:
          type: array
          items:
            $ref: '#/components/schemas/KeyAndBoost'
        field:
          type: string
      x-stoplight:
        id: nrck2ixy1nbxx
    Query:
      title: Query
      type: object
      properties:
        type:
          type: string
      x-stoplight:
        id: sqow6lcj7y8i2
    NamedFilter:
      title: NamedFilter
      type: object
      properties:
        name:
          type: string
        query:
          $ref: '#/components/schemas/Query'
      x-stoplight:
        id: o5otfs5za3ozv
    Group:
      title: Group
      type: object
      properties:
        field:
          type: string
        leaderStrategy:
          $ref: '#/components/schemas/GroupLeaderStrategy'
        size:
          type: integer
          format: int64
        sort:
          type: array
          items:
            $ref: '#/components/schemas/SortElement'
      x-stoplight:
        id: p76e8iyw8vzjb
    Highlight:
      title: Highlight
      type: object
      properties:
        count:
          type: integer
          format: int32
        defaultHighlight:
          type: boolean
        fields:
          type: array
          items:
            type: string
        length:
          type: integer
          format: int32
        post:
          type: string
        pre:
          type: string
      x-stoplight:
        id: d1w9kdfh85tk4
    SortElement:
      title: SortElement
      type: object
      properties:
        order:
          type: string
          enum:
            - asc
            - desc
        query:
          $ref: '#/components/schemas/Query'
        type:
          type: string
          enum:
            - expression
            - field
            - query
            - relevancy
        value:
          type: string
      x-stoplight:
        id: rntopyhn8wjd3
    zone:
      title: Zone
      x-stoplight:
        id: 7d2ff9dde3cbb
      type: object
      required:
        - id
      properties:
        name:
          type: string
          description: >-
            The name of the zone that contains the specified query profiles to
            search in the query.
          example: Results List
        id:
          type: string
          description: The universal unique identifier (UUID) of the zone.
          example: 6a092bd4-5098-466c-94aa-40bf68294303
          format: uuid
        type:
          type: string
          description: >-
            Read-only value that classifies the zone in the Fusion Predictive
            Merchandiser UI. This value does not affect the triggering/rendering
            logic. 
          example: result-list
        queryProfile:
          type: string
          x-stoplight:
            id: zi250yjpgkfrx
          description: >-
            The query profile for this zone, that designates the endpoint that
            is searched.
          example: fusion-query-profile-name
        omitFilters:
          type: boolean
          x-stoplight:
            id: qoqbd8mfoq6b2
          description: >-
            Specifies whether to include filters `fq` parameters in the search.
            If set to `Off`, all query parameters in the original request are
            passed on to the defined query profile when a template is being
            rendered. If set to `On`, all filters (`fq` parameters) from the
            original request are omitted from the query to the query profile.
            For example, if you have a category landing page where the category
            is used to filter the displayed items, this setting can allow a zone
            to display items outside of that category (by omitting the category
            filter).
          default: false
        dirty:
          type: boolean
          description: >-
            The status of the template. If `false`, the template is published.
            If `true`, this is the staging version of this template and it
            contains changes that have not yet been published.
        neverPublished:
          type: boolean
          description: >-
            The status of the template in the zone. If `false`, the template has
            been published at some point. If `true`, this template has never
            been published.
        metadata:
          type: object
          description: Additional data associated with this zone.
          properties:
            image:
              type: string
              x-stoplight:
                id: ng7twgf49w0wo
              description: ID for the image associated with the zone.
              example: image-id
            primary:
              type: string
              x-stoplight:
                id: pd68k7gfs977m
              description: The unique ID for the primary metadata associated with the zone.
              example: primary-metadata-id
            secondary:
              type: string
              x-stoplight:
                id: za5f0vppycwja
              description: Additional text data for the zone.
              example: _text_
        inTemplates:
          type: array
          description: >-
            IDs of the staging and/or published templates in which this zone
            appears. The IDs are not displayed in any particular order. The
            `staging` and `published` boolean fields specify if that type of
            template ID is returned in this field.
          items:
            type: string
            example: >-
              e123f4bc-5e7e-46dd-9be8-71a4f73e511a,
              8084969c-bd23-40f7-9acf-c68d6798bec2,
              441eb3be-7de6-470a-8141-e416a15c7db1,
              fb148491-b39e-46d1-af33-44cd964d8ee0
        staging:
          type: boolean
          description: >-
            Specifies if IDs are returned for staging templates associated with
            this zone.
          default: false
        published:
          type: boolean
          description: >-
            Specifies if IDs are returned for published templates associated
            with this zone.
          default: false
        layout:
          type: string
          x-stoplight:
            id: fpwelumw4uze6
          description: The type of layout for the template. Values include grid and list.
          example: grid
    trigger:
      title: Trigger
      x-stoplight:
        id: c2653282c4224
      type: object
      description: >-
        An individual trigger criteria for a template. All the conditions
        indicated in the trigger must be met for the trigger to be a match on a
        particular nav state. A trigger consists of search (q) and filter (fq)
        criteria.
      properties:
        exact:
          type: boolean
          description: >-
            This field specifies if the template status (published or staging)
            must match this trigger's criteria. If `true`, the status must be an
            exact match. No extra filters are allowed, and no search terms are
            allowed if this trigger does not define them. This is not the same
            as `exact` match mode, which specifically defines the search term
            matching logic.
        filters:
          type: array
          description: >-
            Filters (fq) values required in the query for this trigger to match.
            Additional filters may be present in the query (and still satisfy
            this trigger) unless 'exact: true' is specified for this trigger, in
            which case the filters in the query must exactly match the filters
            in this trigger, no more and no less.
          items:
            $ref: '#/components/schemas/KeyAndValue'
        matchMode:
          type: string
          description: >-
            Defines search terms matching criteria. 'phrase' (the default)
            requires the search tokens of this trigger to exist as a phrase
            within the search terms of the query, in the same order. 'all'
            requires the search tokens of this trigger to exist within the
            search terms of the query in any order. 'exact' requires that the
            search tokens in this trigger exactly match the search tokens in the
            query, in the same order. As with all match modes, 'exact' still
            applies the configured analysis, such as stemming, so singular /
            plural forms will be considered identical despite not being
            'exactly' the same.
          enum:
            - all
            - exact
            - phrase
        search:
          type: string
          description: >-
            Search terms required in the query for this trigger to match. The
            configured analysis will be applied to tokenize and process these
            terms.
        urlContext:
          type: string
          description: >-
            The context for the URL used in this trigger. The URL context and
            path must match the request to trigger this template.
        urlPath:
          type: string
          description: The URL path for this trigger.
    FacetDomain:
      title: FacetDomain
      type: object
      properties:
        additionalFilters:
          type: array
          items:
            $ref: '#/components/schemas/Query'
        excludedFiltersByName:
          type: array
          items:
            type: string
      x-stoplight:
        id: ufxdk8lv1hh97
    KeyAndBoost:
      title: KeyAndBoost
      type: object
      properties:
        boost:
          type: number
          format: double
        key:
          type: string
      x-stoplight:
        id: 2vyokrrnbo2nk
    GroupLeaderStrategy:
      title: GroupLeaderStrategy
      type: object
      properties:
        type:
          type: string
      x-stoplight:
        id: iucusioyfm2fi
    KeyAndValue:
      title: KeyAndValue
      type: object
      properties:
        inheritable:
          type: boolean
          description: >-
            This field specifies if the `key:value` pair can be inherited or
            overridden based on the parent/child relationship. If `true`, the
            `key:value` pair can be inherited.
        key:
          type: string
          description: The name of the property for the trigger.
          example: key1
        value:
          type: string
          description: The value of the property of the trigger.
          example: value1
      x-stoplight:
        id: 8vlfjjk96dt0n

````