openapi: 3.0.3
info:
  title: Content Fragment Visualization Templates APIs
  version: '2026.10'
servers:
  - url: https://{bucket}.adobeaemcloud.com/adobe/contentFragments
    variables:
      bucket:
        default: ''
        description: The bucket to use for this request, e.g. author-p12345-e123456
security:
  - BearerAuth: []
tags:
  - name: Template Management
    description: Create, read, update, and delete model-scoped HTML templates.
  - name: Fragment Visualization
    description: Render and publish HTML visualizations of Content Fragments.
  - name: Fragment Visualization Events
    description: Events emitted for published HTML fragment lifecycle changes.
paths:
  /models/{modelId}/templates:
    post:
      tags:
        - Template Management
      summary: Create template
      description: |
        Creates a new HTML template for a Content Fragment Model. 
        The template uses Handlebars syntax for dynamic content rendering. 
        The HTML template content is provided as an escaped string in the JSON request body.

        To validate a template without creating it, use the `dryRun=true` query parameter. A successful validation will return a `204 No Content` response.

        **Permissions:** Template management operations require elevated permissions beyond the standard author role. Users must have specific template management permissions in addition to the required IMS roles.

        **Conflict scenarios:** A 409 response will be returned if a template with the specified name already exists for this Content Fragment Model. Template names must be unique within a model.
      operationId: createTemplate
      parameters:
        - $ref: '#/components/parameters/modelId'
        - $ref: '#/components/parameters/dryRun'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateTemplateRequest'
      responses:
        '201':
          $ref: '#/components/responses/TemplateCreated'
        '204':
          $ref: '#/components/responses/204_NoContent'
        '400':
          $ref: '#/components/responses/ValidationBadRequest'
        '401':
          $ref: '#/components/responses/401_Unauthorized'
        '403':
          $ref: '#/components/responses/403_Forbidden'
        '404':
          $ref: '#/components/responses/404_NotFound'
        '406':
          $ref: '#/components/responses/406_Unacceptable'
        '409':
          $ref: '#/components/responses/409_Conflict'
        '415':
          $ref: '#/components/responses/415_UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/429_TooManyRequests'
        '500':
          $ref: '#/components/responses/500_InternalServerError'
    get:
      tags:
        - Template Management
      summary: List templates
      description: |
        Retrieves a paginated list of HTML templates associated with the specified Content Fragment Model. 
        Returns lightweight template summaries containing ID and name for efficient browsing. 
        Supports cursor-based pagination for optimal performance with large template collections.

        **Permissions:** Template management operations require elevated permissions beyond the standard author role. Users must have specific template management permissions in addition to the required IMS roles.
      operationId: listTemplates
      parameters:
        - $ref: '#/components/parameters/modelId'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/cursor'
      responses:
        '200':
          description: A list of templates
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateListResponse'
        '401':
          $ref: '#/components/responses/401_Unauthorized'
        '403':
          $ref: '#/components/responses/403_Forbidden'
        '404':
          $ref: '#/components/responses/404_NotFound'
        '406':
          $ref: '#/components/responses/406_Unacceptable'
        '429':
          $ref: '#/components/responses/429_TooManyRequests'
        '500':
          $ref: '#/components/responses/500_InternalServerError'
  /models/{modelId}/templates/{templateId}:
    get:
      tags:
        - Template Management
      summary: Get template
      description: |
        Retrieves the complete template including metadata and HTML content.
        The template content includes Handlebars placeholders for dynamic Content Fragment rendering.
        Returns ETag header to support efficient caching and conditional updates.

        **Permissions:** Template management operations require elevated permissions beyond the standard author role. Users must have specific template management permissions in addition to the required IMS roles.
      operationId: getTemplate
      parameters:
        - $ref: '#/components/parameters/modelId'
        - $ref: '#/components/parameters/templateId'
        - $ref: '#/components/parameters/If-None-Match'
      responses:
        '200':
          description: Template details including metadata and HTML content
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDetail'
        '304':
          $ref: '#/components/responses/304_NotModified'
        '401':
          $ref: '#/components/responses/401_Unauthorized'
        '403':
          $ref: '#/components/responses/403_Forbidden'
        '404':
          $ref: '#/components/responses/404_NotFound'
        '406':
          $ref: '#/components/responses/406_Unacceptable'
        '429':
          $ref: '#/components/responses/429_TooManyRequests'
        '500':
          $ref: '#/components/responses/500_InternalServerError'
    head:
      tags:
        - Template Management
      summary: Check template existence
      description: |
        Same as GET but without a response body.

        **Permissions:** Template management operations require elevated permissions beyond the standard author role. Users must have specific template management permissions in addition to the required IMS roles.
      operationId: headTemplate
      parameters:
        - $ref: '#/components/parameters/modelId'
        - $ref: '#/components/parameters/templateId'
        - $ref: '#/components/parameters/If-None-Match'
      responses:
        '200':
          description: Headers returned; no body.
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
        '304':
          $ref: '#/components/responses/304_NotModified'
        '401':
          $ref: '#/components/responses/401_Unauthorized'
        '403':
          $ref: '#/components/responses/403_Forbidden'
        '404':
          $ref: '#/components/responses/404_NotFound'
        '406':
          $ref: '#/components/responses/406_Unacceptable'
        '429':
          $ref: '#/components/responses/429_TooManyRequests'
        '500':
          $ref: '#/components/responses/500_InternalServerError'
    put:
      tags:
        - Template Management
      summary: Update template
      description: |
        Replaces an existing template. PUT performs a full replacement, so both the template name and HTML content must be provided.
        The HTML template content is provided as an escaped string in the JSON request body.
        Includes ETag support for concurrent modification protection.

        **Permissions:** Template management operations require elevated permissions beyond the standard author role. Users must have specific template management permissions in addition to the required IMS roles.

        **Conflict scenarios:** A 409 response will be returned if a template with the specified name already exists for this Content Fragment Model. A 412 (Precondition Failed) response will be returned if the provided ETag doesn't match the current version.
      operationId: updateTemplate
      parameters:
        - $ref: '#/components/parameters/modelId'
        - $ref: '#/components/parameters/templateId'
        - $ref: '#/components/parameters/If-Match'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTemplateRequest'
      responses:
        '200':
          description: Template updated
          headers:
            ETag:
              $ref: '#/components/headers/ETag'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TemplateDetail'
        '400':
          $ref: '#/components/responses/400_BadRequest'
        '401':
          $ref: '#/components/responses/401_Unauthorized'
        '403':
          $ref: '#/components/responses/403_Forbidden'
        '404':
          $ref: '#/components/responses/404_NotFound'
        '406':
          $ref: '#/components/responses/406_Unacceptable'
        '409':
          $ref: '#/components/responses/409_Conflict'
        '412':
          $ref: '#/components/responses/412_PreconditionFailed'
        '415':
          $ref: '#/components/responses/415_UnsupportedMediaType'
        '428':
          $ref: '#/components/responses/428_PreconditionRequired'
        '429':
          $ref: '#/components/responses/429_TooManyRequests'
        '500':
          $ref: '#/components/responses/500_InternalServerError'
    delete:
      tags:
        - Template Management
      summary: Delete template
      description: |
        Permanently removes the specified template from the Content Fragment Model.
        This operation cannot be undone and will immediately remove the template from all associated rendering workflows.
        Returns 204 No Content on successful deletion.

        **Permissions:** Template management operations require elevated permissions beyond the standard author role. Users must have specific template management permissions in addition to the required IMS roles.
      operationId: deleteTemplate
      parameters:
        - $ref: '#/components/parameters/modelId'
        - $ref: '#/components/parameters/templateId'
        - $ref: '#/components/parameters/If-Match'
      responses:
        '204':
          $ref: '#/components/responses/204_NoContent'
        '401':
          $ref: '#/components/responses/401_Unauthorized'
        '403':
          $ref: '#/components/responses/403_Forbidden'
        '404':
          $ref: '#/components/responses/404_NotFound'
        '406':
          $ref: '#/components/responses/406_Unacceptable'
        '412':
          $ref: '#/components/responses/412_PreconditionFailed'
        '428':
          $ref: '#/components/responses/428_PreconditionRequired'
        '429':
          $ref: '#/components/responses/429_TooManyRequests'
        '500':
          $ref: '#/components/responses/500_InternalServerError'
  /{fragmentId}/preview:
    get:
      tags:
        - Fragment Visualization
      summary: Render fragment visualization
      description: |
        Generates an HTML visualization of the Content Fragment. 
        Uses the system's default template if no templateId is specified, which provides a generic visualization suitable for basic content review.
        When a templateId is provided, merges fragment data with the specified custom template's Handlebars placeholders to produce final rendered output.
        Returns fully rendered HTML ready for display or further processing.

        The `hydration` object parameter controls whether referenced content is included in the response (`enabled`) and how deep the hydration process goes when resolving references (`maxDepth`).

        **Caching:** The preview is rendered dynamically on each request and is intentionally not cacheable. This operation does not return an `ETag` and does not support conditional requests (`If-None-Match`/`304`).

        **Permissions:** Requires permission to access the specific Content Fragment. Template management permissions are not required for visualization operations.
      operationId: renderFragmentPreview
      parameters:
        - $ref: '#/components/parameters/fragmentId'
        - $ref: '#/components/parameters/templateIdQuery'
        - $ref: '#/components/parameters/variation'
        - $ref: '#/components/parameters/hydration'
      responses:
        '200':
          description: Rendered HTML fragment
          content:
            text/html:
              schema:
                type: string
        '400':
          $ref: '#/components/responses/400_BadRequest'
        '401':
          $ref: '#/components/responses/401_Unauthorized'
        '403':
          $ref: '#/components/responses/403_Forbidden'
        '404':
          $ref: '#/components/responses/404_NotFound'
        '406':
          $ref: '#/components/responses/406_Unacceptable'
        '429':
          $ref: '#/components/responses/429_TooManyRequests'
        '500':
          $ref: '#/components/responses/500_InternalServerError'
  /{fragmentId}/publishHtmlFragment:
    post:
      tags:
        - Fragment Visualization
      summary: Publish HTML fragment
      description: |
        Publishes a rendered HTML fragment to the delivery tier.
        Uses the system's default template if no templateId is specified, which provides a generic visualization suitable for basic content review.
        When a templateId is provided, merges fragment data with the specified custom template's Handlebars placeholders to produce final rendered output.
        The published HTML fragment will be available at the returned delivery URL.
        When event publishing is enabled, submission of an `aem.sites.vcf.published` event is initiated
        after successful storage and delivery URL construction, before returning the publish response.
        The payload contains the resolved fragmentId, templateId, variation, tier, and delivery URL.
        No event is submitted when publishing fails.
        Delivery is best-effort: the service does not wait for broker acknowledgement, and a successful
        publish response confirms HTML storage, not event delivery. Storage and event delivery are not atomic.

        The `hydration` object parameter controls whether referenced content is included in the response (`enabled`) and how deep the hydration process goes when resolving references (`maxDepth`).

        **Important: Hydration Configuration Responsibility**

        It is the caller's responsibility to provide hydration settings that align with the template's Handlebars expressions. The template rendering engine performs a single-pass substitution: any Handlebars placeholder (e.g., `{{reference.field}}`, `{{#each items}}`) that references data not present in the hydrated context will **not** be resolved and will remain as raw Handlebars syntax in the published HTML output.

        Specifically:
        - If the template traverses Content Fragment references (e.g., `{{relatedArticle.title}}`), `hydration.enabled` must be `true`.
        - The `hydration.maxDepth` value must be set to at least the maximum reference depth accessed by the template. For example, if the template accesses `{{author.organization.name}}` (a 2-level reference chain), `maxDepth` must be ≥ 2.
        - Insufficient hydration depth will result in unresolved placeholders appearing verbatim in the HTML (e.g., `{{author.organization.name}}`), producing malformed output.
        - The API does not validate whether hydration settings are sufficient for the selected template; this validation must be performed client-side or through prior template analysis.

        **Permissions:** Requires permission to publish the specific Content Fragment.

        **Conflict scenarios:** A 409 response is returned if the source Content Fragment has not been published to the target tier. Publish the Content Fragment before publishing its HTML fragment.
      operationId: publishHtmlFragment
      parameters:
        - $ref: '#/components/parameters/fragmentId'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishHtmlFragmentRequest'
      responses:
        '200':
          description: HTML fragment published successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublishHtmlFragmentResponse'
        '400':
          $ref: '#/components/responses/400_BadRequest'
        '401':
          $ref: '#/components/responses/401_Unauthorized'
        '403':
          $ref: '#/components/responses/403_Forbidden'
        '404':
          $ref: '#/components/responses/404_NotFound'
        '406':
          $ref: '#/components/responses/406_Unacceptable'
        '409':
          $ref: '#/components/responses/409_Conflict'
        '415':
          $ref: '#/components/responses/415_UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/429_TooManyRequests'
        '500':
          $ref: '#/components/responses/500_InternalServerError'
x-webhooks:
  vcf-published:
    post:
      summary: VCF Published Event
      operationId: vcf-published
      x-audience: development
      description: |
        When event publishing is enabled, submission of an `aem.sites.vcf.published` event is initiated
        after the rendered HTML fragment is successfully stored on the specified tier and its delivery URL
        is constructed, before returning the publish response. No event is submitted when publishing fails.

        Delivery is best-effort. The service does not wait for broker acknowledgement before returning
        the publish response. A successful publish response confirms HTML storage, not event delivery.
        Storage and event delivery are not atomic.

        The payload contains the resolved fragmentId, templateId, variation, and tier used for storage,
        along with the same delivery URL returned in the publish response.
      security: []
      tags:
        - Fragment Visualization Events
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - $ref: '#/components/schemas/CloudEvents_3rdParty'
                - type: object
                  properties:
                    type:
                      type: string
                      minLength: 1
                      enum:
                        - aem.sites.vcf.published
                    data:
                      $ref: '#/components/schemas/VcfPublishedEventData'
            example:
              specversion: '1.0'
              type: aem.sites.vcf.published
              source: acct:aem-p12345-e67890@adobe.com
              id: 7c1104e5-4cd7-47d6-a50f-2568c480f2e9
              time: '2026-11-09T10:00:00Z'
              datacontenttype: application/json
              data:
                fragmentId: f7b8c9d0-e1f2-3456-7890-123456789abc
                templateId: generic_template
                variation: main
                tier: publish
                deliveryUrl: https://publish-p12345-e67890.adobeaemcloud.net/adobe/contentFragments/generic_template/f7b8c9d0-e1f2-3456-7890-123456789abc/main.html
      responses:
        '200':
          description: Return a 200 status to indicate that the data was received successfully
  vcf-deleted:
    post:
      summary: VCF Deleted Event
      operationId: vcf-deleted
      x-audience: development
      description: |
        When event publishing is enabled, an `aem.sites.vcf.deleted` event is submitted after a stored
        HTML fragment is successfully deleted from the specified tier. This includes VCF cleanup
        triggered by deletion of the source Content Fragment. No event is submitted when VCF deletion fails.
        The payload identifies the deleted HTML fragment by its fragmentId, templateId, variation, and tier.

        Event delivery is best-effort. VCF deletion and event delivery are not atomic.
      security: []
      tags:
        - Fragment Visualization Events
      requestBody:
        content:
          application/json:
            schema:
              type: object
              allOf:
                - $ref: '#/components/schemas/CloudEvents_3rdParty'
                - type: object
                  properties:
                    type:
                      type: string
                      minLength: 1
                      enum:
                        - aem.sites.vcf.deleted
                    data:
                      $ref: '#/components/schemas/VcfDeletedEventData'
            example:
              specversion: '1.0'
              type: aem.sites.vcf.deleted
              source: acct:aem-p12345-e67890@adobe.com
              id: 7c1104e5-4cd7-47d6-a50f-2568c480f2e9
              time: '2026-11-09T10:00:00Z'
              datacontenttype: application/json
              data:
                fragmentId: f7b8c9d0-e1f2-3456-7890-123456789abc
                templateId: generic_template
                variation: main
                tier: publish
      responses:
        '200':
          description: Return a 200 status to indicate that the data was received successfully
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: IMS access token in the Authorization header using the Bearer scheme.
  parameters:
    modelId:
      name: modelId
      in: path
      required: true
      schema:
        type: string
        minLength: 1
      description: Unique identifier of the Content Fragment Model
    limit:
      in: query
      name: limit
      description: |
        For a paginated request, this parameter defines the maximum number of items to retrieve.
      schema:
        $ref: '#/components/schemas/Limit'
    cursor:
      in: query
      name: cursor
      description: |
        When the number of results for a request exceeds the allowed limit, the response will include a `cursor`.  That value can then be sent via this parameter on a subsequent request to retrieve the next set of items.
      schema:
        $ref: '#/components/schemas/Cursor'
    dryRun:
      name: dryRun
      in: query
      required: false
      schema:
        type: boolean
        default: false
      description: If true, performs a dry run validation without creating the resource.
    templateId:
      name: templateId
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
      description: Unique identifier of the template
    If-None-Match:
      name: If-None-Match
      description: |
        The `If-None-Match` header field makes the request method conditional on a recipient cache or origin server either
        not having any current representation of the target resource, when the field value is "*", or having a selected
        representation with an entity tag that does not match any of those listed in the field value.

        For more details, please head over to [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-if-none-match).
      in: header
      required: false
      schema:
        type: string
    If-Match:
      name: If-Match
      description: |
        The `If-Match` header field makes the request method conditional on the recipient origin server either having at least
        one current representation of the target resource, when the field value is "*", or having a current representation of
        the target resource that has an entity tag matching a member of the list of entity tags provided in the field value.

        For more details, please head over to [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-if-match).
      in: header
      required: true
      schema:
        type: string
        description: The value of an `ETag` received for a previous `HEAD` or `GET` request to this resource.
    fragmentId:
      name: fragmentId
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/UUID'
      description: Identifier of the Content Fragment to render
    templateIdQuery:
      name: templateId
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/UUID'
      description: Optional template ID. If not provided, uses default template.
    variation:
      name: variation
      in: query
      required: false
      schema:
        type: string
      description: Optional variation name. If not specified, the fragment's default content is rendered. If specified, that variation is rendered instead.
    hydration:
      name: hydration
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/HydrationConfig'
      description: |
        URL-encoded JSON object for hydration configuration.
        Example: ?hydration=%7B%22enabled%22%3Atrue%2C%22maxDepth%22%3A2%7D
  schemas:
    Limit:
      description: |
        For a paginated request, this parameter defines the maximum number of items to retrieve.
      type: integer
      format: int32
      minimum: 1
      maximum: 50
    Cursor:
      description: |
        A cursor is an opaque string that can be used in API calls which support paginating the response. A non-existent cursor
        signifies that the returned list does not have more elements.
      type: string
      minLength: 1
    TemplateSummary:
      type: object
      properties:
        id:
          type: string
          minLength: 1
          readOnly: true
        name:
          type: string
          minLength: 1
        etag:
          type: string
          readOnly: true
          description: |
            Entity tag for cache validation and concurrency control.
      required:
        - id
        - name
        - etag
      example:
        id: <template-id>
        name: My Awesome Template
        etag: '"33a64df551425fcc55e4d42a148795d9f25f89d4"'
    TemplateListResponse:
      type: object
      properties:
        items:
          type: array
          items:
            $ref: '#/components/schemas/TemplateSummary'
        cursor:
          $ref: '#/components/schemas/Cursor'
      required:
        - items
      example:
        items:
          - id: a1b2c3d4-e5f6-7890-1234-567890abcdef
            name: My Awesome Template
          - id: b2c3d4e5-f6a7-8901-2345-67890abcdef1
            name: Another Great Template
        cursor: eyJvZmZzZXQiOjIwfQ
    ProblemDetails:
      description: A [RFC7807](https://www.rfc-editor.org/rfc/rfc7807) JSON Problem Details Object
      type: object
      properties:
        type:
          type: string
          description: A URI reference [RFC3986](https://www.rfc-editor.org/rfc/rfc3986) to a URL, which, when dereferenced, provides human readable documentation for the problem type.  The problem type may be equivalent to the `status` or may be a "sub-type".  This URI is not intended to be parsed by clients; rather it should be treated as an opaque string that uniquely represents the error condition as-is.
          minLength: 1
        title:
          type: string
          description: A short, human-readable summary of the problem type.
          minLength: 1
        status:
          type: integer
          description: The HTTP status code ([RFC9110], Section 15) generated by the origin server for this occurrence of the problem.
          minLength: 1
        detail:
          type: string
          description: A human-readable explanation specific to this occurrence of the problem.
          minLength: 1
        requestId:
          type: string
          description: |
            A unique identifier that is assigned to the request, either by the API caller or by the service itself.
          minLength: 1
      required:
        - type
        - title
        - status
        - detail
    CreateTemplateRequest:
      type: object
      description: Request body for creating a new template.
      properties:
        name:
          type: string
          maxLength: 512
          minLength: 1
          description: Human-readable template name
        content:
          type: string
          minLength: 1
          description: Raw HTML template content with Handlebars placeholders
      required:
        - name
        - content
      example:
        name: Product Card Template
        content: |-
          <html>
            <body>
              <h1>{{title}}</h1>
              <p>{{description}}</p>
            </body>
          </html>
    InvalidField:
      type: object
      description: Details about a single placeholder that failed template validation.
      properties:
        placeholder:
          type: string
          description: The placeholder from the template that caused the validation error.
        reason:
          type: string
          description: The reason why this placeholder is invalid.
      required:
        - placeholder
        - reason
    ValidationError:
      allOf:
        - $ref: '#/components/schemas/ProblemDetails'
        - type: object
          properties:
            invalidFields:
              type: array
              items:
                $ref: '#/components/schemas/InvalidField'
          required:
            - invalidFields
    UUID:
      description: Resource unique identifier
      type: string
      format: uuid
      readOnly: true
      example: 49af775d-0e7a-46c3-913d-00f762528373
    TemplateDetail:
      description: Complete template information including metadata and HTML content.
      allOf:
        - $ref: '#/components/schemas/TemplateSummary'
        - type: object
          properties:
            content:
              type: string
              minLength: 1
              readOnly: true
              description: Raw HTML template content with Handlebars placeholders
          required:
            - content
      example:
        id: a1b2c3d4-e5f6-7890-1234-567890abcdef
        name: Product Card Template
        content: |-
          <html>
            <body>
              <h1>{{title}}</h1>
              <p>{{description}}</p>
            </body>
          </html>
    UpdateTemplateRequest:
      type: object
      description: Request body for updating an existing template. PUT performs a full replacement, so all fields are required.
      properties:
        name:
          type: string
          maxLength: 512
          minLength: 1
          description: New human-readable template name
        content:
          type: string
          minLength: 1
          description: Updated HTML template content with Handlebars placeholders
      required:
        - name
        - content
      example:
        name: Updated Product Card
        content: |-
          <html>
            <body>
              <h1>{{title}}</h1>
              <div>{{content}}</div>
            </body>
          </html>
    HydrationConfig:
      type: object
      description: Configuration for hydrating referenced Content Fragment data during rendering.
      properties:
        enabled:
          type: boolean
          default: false
          description: If true, resolves and includes referenced Content Fragment data in the rendering process.
        maxDepth:
          type: integer
          minimum: 1
          maximum: 10
          default: 1
          description: Maximum depth for hydrating referenced content. Only applies when enabled=true. Range 1-10, default is 1.
      additionalProperties: false
      example:
        enabled: true
        maxDepth: 2
    Tier:
      type: string
      description: The target tier for publishing. Defaults to `publish` if not specified.
      enum:
        - publish
        - preview
      default: publish
    PublishHtmlFragmentRequest:
      type: object
      description: Request body for publishing a Content Fragment as HTML.
      properties:
        templateId:
          type: string
          minLength: 1
          description: Optional template ID. If not provided, uses default template.
        variation:
          type: string
          description: Optional variation name. If not specified, the fragment's default content is rendered. If specified, that variation is rendered instead.
        tier:
          $ref: '#/components/schemas/Tier'
        hydration:
          $ref: '#/components/schemas/HydrationConfig'
      example:
        templateId: <template-id>
        variation: mobile
        tier: publish
        hydration:
          enabled: true
          maxDepth: 2
    PublishHtmlFragmentResponse:
      type: object
      description: Response containing the delivery URL of the published HTML fragment.
      properties:
        deliveryUrl:
          type: string
          format: uri
          description: The URL where the published HTML fragment can be accessed on the delivery tier.
      required:
        - deliveryUrl
    CloudEvents_3rdParty:
      description: |
        AEM Eventing uses the current schema definition for all eventing use cases. The schema definition is based on CloudEvents
        [1.0.2](https://github.com/cloudevents/spec/blob/v1.0.2/cloudevents/spec.md).

        h2. Changes
        All Events once published MUST be treated like API. Changes to the event schema MUST be backwards compatible,
        i.e. prefer non-breaking changes (adding a field) which don't require an event type change and don't break the consumer.
        However, if there is a breaking change, it MUST be a new event type, while the old one is still sent out until no consumer
        still requires it.
      type: object
      properties:
        id:
          description: |
            An identifier for the event.  When used in combination with the `source` property, it allows for each instance of
            an event to be uniquely identified.  That is to say, the combination of the `source` + `id` properties will be
            unique for each distinct event. If a duplicate event is re-sent (e.g. due to a network error) it may have the same 
            id and should be treated as a duplicate.
          type: string
          minLength: 1
        source:
          description: |
            An instance of the [acct URI scheme](https://www.rfc-editor.org/rfc/rfc7565.html) that uniquely identifies the
            producer of this event, of the format `acct:aem-p<programId>-e<environmentId>@adobe.com`.
          type: string
          format: uri
          pattern: ^acct:aem(-cmstg)?-p\d+-e\d+@adobe\.com$
          minLength: 1
        specversion:
          description: |
            The version of the CloudEvents specification which the event uses.  AEM events use the CloudEvents spec version 
            1.0.2, hence this value will be 1.0.
          type: string
          enum:
            - '1.0'
          minLength: 3
        type:
          description: |
            The type for the event.  This will identify the AEM solution that has dispatched the event and may also include
            the type of entity and the activity that occurred.
          type: string
          pattern: ^aem\..*$
          minLength: 4
        datacontenttype:
          description: |
            The format of the data in the event.  This will always be `application/json` for AEM events.
          type: string
          enum:
            - application/json
          minLength: 1
        dataschema:
          description: |
            An optional attribute, which may point to a JSON schema document that covers the data object.
          type: string
          format: uri
        time:
          description: |
            A timestamp of when the event occurred.
          type: string
          format: date-time
          minLength: 1
        data:
          description: |
            The event payload.
          type: object
      required:
        - id
        - source
        - specversion
        - type
        - datacontenttype
        - time
        - data
      example:
        specversion: '1.0'
        type: aem.assets.asset.created
        source: acct:aem-p56789-e12345@adobe.com
        id: 7c1104e5-4cd7-47d6-a50f-2568c480f2e9
        time: '2018-04-05T17:31:00Z'
        datacontenttype: application/json
        data:
          myProp: myValue
    UUID-2:
      description: Resource unique identifier
      type: string
      format: uuid
      minLength: 1
      example: 49af775d-0e7a-46c3-913d-00f762528373
    VcfPublishedEventData:
      type: object
      description: |
        Identifies the HTML fragment successfully stored on the target tier.
        All identifiers contain the resolved values used to store the HTML fragment.
      properties:
        fragmentId:
          $ref: '#/components/schemas/UUID-2'
        templateId:
          type: string
          minLength: 1
          description: |
            The template identifier used for rendering, or `generic_template` for default rendering.
        variation:
          type: string
          minLength: 1
          description: |
            The variation name used for rendering, or `main` for the fragment's default content.
        tier:
          minLength: 1
          allOf:
            - $ref: '#/components/schemas/Tier'
        deliveryUrl:
          type: string
          minLength: 1
          format: uri
          description: |
            The delivery URL returned in the successful publish response.
      required:
        - fragmentId
        - templateId
        - variation
        - tier
        - deliveryUrl
      example:
        fragmentId: f7b8c9d0-e1f2-3456-7890-123456789abc
        templateId: generic_template
        variation: main
        tier: publish
        deliveryUrl: https://publish-p12345-e67890.adobeaemcloud.net/adobe/contentFragments/generic_template/f7b8c9d0-e1f2-3456-7890-123456789abc/main.html
    VcfDeletedEventData:
      type: object
      description: |
        Identifies the published HTML fragment removed from the target tier.
        All identifiers contain the resolved values used to locate the stored HTML fragment.
      properties:
        fragmentId:
          $ref: '#/components/schemas/UUID-2'
        templateId:
          type: string
          minLength: 1
          description: |
            The template identifier used for rendering, or `generic_template` for default rendering.
        variation:
          type: string
          minLength: 1
          description: |
            The variation name used for rendering, or `main` for the fragment's default content.
        tier:
          minLength: 1
          allOf:
            - $ref: '#/components/schemas/Tier'
      required:
        - fragmentId
        - templateId
        - variation
        - tier
      example:
        fragmentId: f7b8c9d0-e1f2-3456-7890-123456789abc
        templateId: generic_template
        variation: main
        tier: publish
  responses:
    401_Unauthorized:
      description: |
        Unauthorized. Indicates that the request has not been applied because it lacks valid authentication credentials for the target resource.
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetails'
              - type: object
                properties:
                  status:
                    type: integer
                    default: 401
                  title:
                    type: string
                    default: Unauthorized
          example:
            type: http://api.adobeaemcloud.com/adobe/meta/errors/unauthorized
            title: Unauthorized
            status: 401
            detail: The request did not contain a valid Authorization header.
    403_Forbidden:
      description: |
        Forbidden. Indicates that the server understood the request but refuses to fulfil it.
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetails'
              - type: object
                properties:
                  status:
                    type: integer
                    default: 403
                  title:
                    type: string
                    default: Forbidden
          example:
            type: http://api.adobeaemcloud.com/adobe/meta/errors/forbidden
            title: Forbidden
            status: 403
            detail: The credentials provided do not have sufficient permissions to access this resource.
    404_NotFound:
      description: |
        Not Found. Indicates that the origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetails'
              - type: object
                properties:
                  status:
                    type: integer
                    default: 404
                  title:
                    type: string
                    default: Not Found
          example:
            type: http://api.adobeaemcloud.com/adobe/meta/errors/not_found
            title: Not Found
            status: 404
            detail: The requested resource could not be found.
    406_Unacceptable:
      description: |
        Not Acceptable.
        Indicates that the target resource does not have a current representation that would be acceptable to the user agent,
        according to the proactive negotiation header fields received in the request.
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetails'
              - type: object
                properties:
                  title:
                    type: string
                    example: Unacceptable
                  status:
                    type: integer
                    default: 406
          example:
            type: http://api.adobeaemcloud.com/adobe/meta/errors/not_acceptable
            title: Not Acceptable
            status: 406
            detail: |
              The target resource does not have a current representation that would be acceptable to the user agent, 
              according to the proactive negotiation header fields received in the request.
    429_TooManyRequests:
      description: |
        Too Many Requests. Indicates that the user has sent too many requests in a given amount of time ("rate limiting").
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetails'
              - type: object
                properties:
                  title:
                    type: string
                    default: Too Many Requests
                  status:
                    type: integer
                    default: 429
          example:
            type: http://api.adobeaemcloud.com/adobe/meta/errors/too_many_requests
            title: Too Many Requests
            status: 429
            detail: This indicates the user has sent too many requests in a given amount of time.
    500_InternalServerError:
      description: |
        Internal Server Error. Indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetails'
              - type: object
                properties:
                  status:
                    type: integer
                    default: 500
                  title:
                    type: string
                    default: Internal Server Error
          example:
            type: http://api.adobeaemcloud.com/adobe/meta/errors/internal_server_error
            title: Internal Server Error
            status: 500
            detail: The server encountered an unexpected condition that prevented it from fulfilling the request.
    TemplateCreated:
      description: Template created
      headers:
        Location:
          $ref: '#/components/headers/Location'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/TemplateSummary'
    204_NoContent:
      description: No Content
    ValidationBadRequest:
      description: Bad request due to validation errors
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ValidationError'
    409_Conflict:
      description: |
        Conflict. Indicates that the request could not be completed due to a conflict with the current state of the target resource.
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetails'
              - type: object
                properties:
                  status:
                    type: integer
                    default: 409
                  title:
                    type: string
                    default: Conflict
          example:
            type: http://api.adobeaemcloud.com/adobe/meta/errors/conflict
            title: Conflict
            status: 409
            detail: The current state of the resource on the server is incompatible with your request.
    415_UnsupportedMediaType:
      description: |
        Unsupported Media Type. Indicates that the origin server is refusing to service the request because the content is in a format not supported by this method on the target resource.
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetails'
              - type: object
                properties:
                  title:
                    type: string
                    example: Unsupported Media Type
                  status:
                    type: integer
                    default: 415
          example:
            type: http://api.adobeaemcloud.com/adobe/meta/errors/unsupported_media_type
            title: Unsupported Media Type
            status: 415
            detail: This request is not acceptable because the payload is in an unsupported format.
    304_NotModified:
      description: Not Modified
      content: {}
      headers:
        ETag:
          $ref: '#/components/headers/ETag'
        Last-Modified:
          $ref: '#/components/headers/Last-Modified'
    400_BadRequest:
      description: |
        Bad Request.
        Indicates that the server cannot or will not process the request due to something that is perceived to be a client error. The Problem Details object will provide more information about the exact cause.
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetails'
              - type: object
                properties:
                  status:
                    type: integer
                    default: 400
                  title:
                    type: string
                    default: Bad Request
          example:
            type: http://api.adobeaemcloud.com/adobe/meta/errors/bad_request
            title: Bad Request
            status: 400
            detail: Bad request, please check that you have provided the correct parameters and that they are valid.
    412_PreconditionFailed:
      description: |
        Precondition Failed. Indicates that one or more conditions given in the request header fields evaluated to false when tested on the server.
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetails'
              - type: object
                properties:
                  title:
                    type: string
                    default: Precondition Failed
                  status:
                    type: integer
                    default: 412
          example:
            type: http://api.adobeaemcloud.com/adobe/meta/errors/precondition_failed
            title: Precondition Failed
            status: 412
            detail: The provided conditional header was not fulfilled.
    428_PreconditionRequired:
      description: |
        Precondition Required. Indicates that the origin server requires the request to be conditional.
      content:
        application/problem+json:
          schema:
            allOf:
              - $ref: '#/components/schemas/ProblemDetails'
              - type: object
                properties:
                  title:
                    type: string
                    default: Precondition Required
                  status:
                    type: integer
                    default: 428
          example:
            type: http://api.adobeaemcloud.com/adobe/meta/errors/precondition_required
            title: Precondition Required
            status: 428
            detail: This operation requires the use of a conditional header.
  headers:
    Retry-After:
      schema:
        anyOf:
          - type: string
            pattern: ^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (([0-2][0-9]|3[01] Jan)|([0-2][0-9] Feb)|([0-2][0-9]|3[01] Mar)|([0-2][0-9]|30 Apr)|([0-2][0-9]|3[01] May)|([0-2][0-9]|30 Jun)|([0-2][0-9]|3[01] Jul)|([0-2][0-9]|3[01] Aug)|([0-2][0-9]|30 Sep)|([0-2][0-9]|3[01] Oct)|([0-2][0-9]|30 Nov)|([0-2][0-9]|3[01] Dec)) ([0-9]{4}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]) GMT$
            example: Fri, 31 Dec 1999 23:59:59 GMT
            description: The HTTP-date to which the user agent should wait to make a follow up request
          - type: integer
            format: int32
            minimum: 0
            example: 120
            description: The number of seconds the user agent should wait to make a follow up request
      description: |
        The `Retry-After` header indicates how long the user agent should wait before making a follow-up request.

        The Retry-After value can be either an HTTP-date or a number of seconds to delay after receiving the response.

        For more details, please head over to [RFC9110](https://datatracker.ietf.org/doc/html/rfc9110#name-retry-after).
    Location:
      schema:
        type: string
        format: uri
      description: |
        The `Location` header field is used in some responses to refer to a specific resource in relation to the response.
        The type of relationship is defined by the combination of request method and status code semantics.

        For more details, please head over to [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-location).
      required: true
    ETag:
      schema:
        type: string
      description: |
        The `ETag` field in a response provides the current entity tag for the selected representation, as determined at the
        conclusion of handling the request. An entity tag is an opaque validator for differentiating between multiple
        representations of the same resource, regardless of whether those multiple representations are due to resource state
        changes over time, content negotiation resulting in multiple representations being valid at the same time, or both.
        An entity tag consists of an opaque quoted string, possibly prefixed by a weakness indicator.

        For more details, please head over to [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-etag).
      required: true
    Last-Modified:
      schema:
        type: string
      description: |
        The "Last-Modified" header field in a response provides a timestamp indicating the date and time at which the origin
        server believes the selected representation was last modified, as determined at the conclusion of handling the
        request.

        For more details, please head over to [RFC9110](https://www.rfc-editor.org/rfc/rfc9110.html#name-last-modified).
      required: true
