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

# Get email template performance

> Returns sent, delivered, opened, and started counts for each version of your email template copy, so you can compare subject lines, preview text, body copy, and CTA labels. Each presentation counts once, under the template version of its first email to a recipient outside Demand IQ and your organization's own users, using that email's own delivery and open outcomes. Manual sends from the **Send** dialog count. An open of a later reminder doesn't count toward any version.

AI Presentations leaves out sends only to Demand IQ staff (`@demand-iq.com`) addresses, sends only to your organization's own users, deleted presentations, and automatic opens. Delivered and opened counts come only from events for recipients outside Demand IQ.

Pass `deckId` to get one template's version list (`DeckTemplateList`). It includes every version the template has had, with all-time counts, from the moment the version is saved. Versions you removed are left out. The template's active version is always listed first, even before its first send. `since` and `until` are ignored when you pass `deckId`. A `deckId` that doesn't belong to your organization returns an empty `versions` list rather than `404`.

Omit `deckId` for the organization-wide view (`TemplatePerformance`). Provide `since` and `until` together to bound when the first send happened, or omit both for the last 30 days ending now.

Returns `404` when email template performance isn't enabled for your organization.



## OpenAPI

````yaml /openapi.json get /api/delivery/template-performance
openapi: 3.0.0
info:
  title: AI Presentations API
  version: 1.0.0
  description: >-
    REST API for AI Presentations — an AI-powered presentation platform with
    narrated slides, live Q&A, and deck management.


    **Authentication**: Most endpoints require a session cookie obtained from
    `POST /api/auth/login`. Presentation playback endpoints (`/api/qa`,
    `/api/narration/*`) also accept a `presentationId` for unauthenticated
    viewer access.
  contact:
    name: Demand IQ
    url: https://demand-iq.com
servers:
  - url: https://app.demand-iq.com
    description: Production
  - url: http://localhost:3000
    description: Local development
security: []
tags:
  - name: Decks
    description: Manage presentation decks
  - name: Slides
    description: Manage slides within a deck
  - name: FAQs
    description: Manage pre-built Q&A pairs
  - name: Branding
    description: Colors, logo, and call-to-action configuration
  - name: Q&A
    description: Live question answering and Q&A settings
  - name: Narration
    description: Text-to-speech synthesis
  - name: Presentations
    description: Create and manage personalized presentation instances
  - name: Generation
    description: AI-powered content generation from slide images
  - name: Images
    description: Image upload and management
  - name: Voices
    description: Available TTS voices
  - name: Utility
    description: Health check and diagnostics
  - name: Authentication
    description: Session-based login, logout, and identity
  - name: Company
    description: Organization contact info and knowledge base
  - name: Notifications
    description: Event subscriptions and delivery log
  - name: Contracts
    description: Contract template import and e-signature
  - name: Fonts
    description: Available Google Fonts for branding
  - name: Roof Measurements
    description: Request and track automated roof measurements
  - name: Actions
    description: Voice/text command detection for presentation control
  - name: Appointments
    description: Appointment scheduling for presentation viewers
  - name: Activity
    description: Recent presentation activity feed
  - name: Engagement
    description: Presentation engagement analytics
  - name: Onboarding
    description: >-
      Per-user product onboarding milestones (ENG-641). Milestone endpoints are
      idempotent and are called by the app UI — they should not be treated as
      tenant-integration surface.
paths:
  /api/delivery/template-performance:
    get:
      tags:
        - Engagement
      summary: Get email template performance
      description: >-
        Returns sent, delivered, opened, and started counts for each version of
        your email template copy, so you can compare subject lines, preview
        text, body copy, and CTA labels. Each presentation counts once, under
        the template version of its first email to a recipient outside Demand IQ
        and your organization's own users, using that email's own delivery and
        open outcomes. Manual sends from the **Send** dialog count. An open of a
        later reminder doesn't count toward any version.


        AI Presentations leaves out sends only to Demand IQ staff
        (`@demand-iq.com`) addresses, sends only to your organization's own
        users, deleted presentations, and automatic opens. Delivered and opened
        counts come only from events for recipients outside Demand IQ.


        Pass `deckId` to get one template's version list (`DeckTemplateList`).
        It includes every version the template has had, with all-time counts,
        from the moment the version is saved. Versions you removed are left out.
        The template's active version is always listed first, even before its
        first send. `since` and `until` are ignored when you pass `deckId`. A
        `deckId` that doesn't belong to your organization returns an empty
        `versions` list rather than `404`.


        Omit `deckId` for the organization-wide view (`TemplatePerformance`).
        Provide `since` and `until` together to bound when the first send
        happened, or omit both for the last 30 days ending now.


        Returns `404` when email template performance isn't enabled for your
        organization.
      parameters:
        - in: query
          name: since
          required: false
          schema:
            type: string
            format: date-time
          example: '2026-09-01T00:00:00Z'
          description: >-
            Organization-wide view only. Ignored when you pass `deckId`. Start
            of the window for the first send (inclusive), as an RFC 3339
            timestamp. Timezone offsets are accepted. Provide with `until`, or
            omit both for the last 30 days.
        - in: query
          name: until
          required: false
          schema:
            type: string
            format: date-time
          example: '2026-10-01T00:00:00Z'
          description: >-
            Organization-wide view only. Ignored when you pass `deckId`. End of
            the window for the first send (exclusive), as an RFC 3339 timestamp.
            Must be after `since`. Provide with `since`, or omit both for the
            last 30 days.
        - in: query
          name: deckId
          required: false
          schema:
            type: string
            format: uuid
          description: >-
            Return this template's all-time version list instead of the
            organization-wide view. An empty value is treated as absent.
          example: 8b2e4f10-3c6a-4d9e-a1f7-62c0b5d9e384
      responses:
        '200':
          description: >-
            The template's version list when you pass `deckId`, otherwise email
            performance per template version for your organization
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/DeckTemplateList'
                  - $ref: '#/components/schemas/TemplatePerformance'
        '400':
          description: >-
            Invalid query parameters, `since` or `until` provided without the
            other, or `since` not before `until` (organization-wide view only)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Not authenticated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Email template performance isn't enabled for your organization
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
        - sessionCookie: []
components:
  schemas:
    DeckTemplateList:
      type: object
      description: Every version of a template's email copy, with all-time counts.
      properties:
        deckId:
          type: string
          format: uuid
          example: 8b2e4f10-3c6a-4d9e-a1f7-62c0b5d9e384
        minimumDelivered:
          type: integer
          example: 10
          description: >-
            The smallest number of delivered first sends at which a version's
            rates are `reportable`.
        versions:
          type: array
          description: >-
            Every version the template has had, all-time, with removed versions
            left out. The active version comes first, then the newest by
            `firstSavedAt` or else `firstSentAt`. The unknown version row, if
            present, is last. The active version is always present. Its
            `templateVersionId` is `null` when its copy was never saved or sent.
          items:
            $ref: '#/components/schemas/DeckTemplate'
      required:
        - deckId
        - minimumDelivered
        - versions
    TemplatePerformance:
      type: object
      description: >-
        Email performance per email template version for your organization over
        the requested window.
      properties:
        window:
          type: object
          description: >-
            The window the first sends fall in: the requested `since`/`until`,
            or the last 30 days ending at request time.
          properties:
            from:
              type: string
              format: date-time
              example: '2026-09-01T00:00:00.000Z'
            until:
              type: string
              format: date-time
              example: '2026-10-01T00:00:00.000Z'
          required:
            - from
            - until
        deckId:
          type: string
          format: uuid
          nullable: true
          description: >-
            Always `null`. A request with `deckId` returns `DeckTemplateList`
            instead.
        minimumDelivered:
          type: integer
          example: 10
          description: >-
            The smallest number of delivered first sends at which a version's
            rates are `reportable`.
        versions:
          type: array
          description: >-
            One entry per email template version, newest first. The unknown
            version row, if present, is last.
          items:
            $ref: '#/components/schemas/TemplateVersionPerformance'
      required:
        - window
        - deckId
        - minimumDelivered
        - versions
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
    DeckTemplate:
      description: One version on a template's version list, with all-time counts.
      allOf:
        - $ref: '#/components/schemas/TemplateVersionPerformance'
        - type: object
          properties:
            firstSavedAt:
              type: string
              format: date-time
              nullable: true
              example: '2026-09-14T16:02:11.000Z'
              description: >-
                When this template first saved this version. `null` for a
                version that was only ever sent.
            firstSentAt:
              type: string
              format: date-time
              nullable: true
              example: '2026-09-15T13:40:02.000Z'
              description: >-
                This template's earliest counted first send of this version.
                `null` when it has none.
          required:
            - firstSavedAt
            - firstSentAt
    TemplateVersionPerformance:
      type: object
      description: >-
        Email performance for one email template version, counted on first sends
        to a recipient outside Demand IQ and your organization's own users.
      properties:
        templateVersionId:
          type: string
          format: uuid
          nullable: true
          example: 3f1c9a2e-7b4d-4e8a-9c21-5d6f0a8b1e47
          description: >-
            The email template version. `null` marks the "Unknown version" row,
            which holds first sends made before AI Presentations recorded
            template versions. These sends are never assigned to your current
            copy.
        copy:
          type: object
          nullable: true
          description: >-
            The version's email copy before tokens are filled in. `null` on the
            unknown version row.
          properties:
            subject:
              type: string
              example: '{{homeowner.first_name}}, your roof presentation is ready'
            preheader:
              type: string
              example: Watch a 3-minute walkthrough of your quote
            bodyTemplate:
              type: string
              example: |-
                Hi {{homeowner.first_name}},

                Your personalized roof presentation is ready. Watch it any time.
              description: The email body.
            ctaLabel:
              type: string
              example: Watch your presentation
            fromName:
              type: string
              nullable: true
              example: Summit Roofing
              description: The sender name. `null` means your organization's name.
            createdAt:
              type: string
              format: date-time
              example: '2026-09-14T16:02:11.000Z'
              description: >-
                When AI Presentations first recorded this copy, on a save or a
                send by any template. Use `firstSavedAt` and `firstSentAt` to
                date a version on one template's list.
          required:
            - subject
            - preheader
            - bodyTemplate
            - ctaLabel
            - fromName
            - createdAt
        kind:
          type: string
          enum:
            - deck
            - default
            - previous_default
            - unknown
          example: deck
          description: >-
            Where the version's copy came from. `deck` is copy saved on a
            template. `default` is the current Demand IQ default copy.
            `previous_default` is an earlier Demand IQ default. `unknown` is the
            row for sends made before AI Presentations recorded template
            versions.
        current:
          type: boolean
          example: true
          description: >-
            `true` for the template's active version: the copy it sends now.
            Always `false` when you omit `deckId`.
        sent:
          type: integer
          example: 148
          description: >-
            Presentations whose first send to the homeowner used this version.
            In the organization-wide view, only first sends in the window count.
        delivered:
          allOf:
            - $ref: '#/components/schemas/EngagementRate'
          description: >-
            Delivered first sends over first sends whose delivery outcome is
            known. `unknown` counts sends whose outcome is no longer available.
        emailOpened:
          allOf:
            - $ref: '#/components/schemas/EngagementRate'
          description: >-
            First sends a person opened over delivered first sends. Automatic
            opens, such as Apple Mail Privacy Protection prefetches, are
            excluded. Compare versions on this rate.
        started:
          allOf:
            - $ref: '#/components/schemas/EngagementRate'
          description: >-
            Homeowners who started the presentation after the first send over
            first sends a person opened. A start is the first time the viewer
            showed slides to a homeowner. Visits by your own team, rep-mode
            visits, and link scanners don't count. Opened sends from before AI
            Presentations began recording starts count as `unknown`.
        reportable:
          type: boolean
          example: true
          description: >-
            `false` when fewer first sends were delivered than
            `minimumDelivered`. Treat the rates as directional only.
        fallbackSent:
          type: integer
          example: 3
          description: >-
            First sends whose subject or preview text fell back to the default
            because a token rendered empty. The homeowner never saw this
            version's copy, so these sends are left out of `sent` and every
            rate.
      required:
        - templateVersionId
        - copy
        - kind
        - current
        - sent
        - delivered
        - emailOpened
        - started
        - reportable
        - fallbackSent
    EngagementRate:
      type: object
      description: >-
        A rate returned as its raw numerator and denominator rather than a
        pre-computed percentage, so you can hide rates whose denominator is too
        small to be meaningful. `unknown` counts items whose underlying data is
        no longer available, which is distinct from a real 0.
      properties:
        numerator:
          type: integer
          example: 42
        denominator:
          type: integer
          example: 120
        unknown:
          type: integer
          example: 0
      required:
        - numerator
        - denominator
        - unknown
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        A Demand IQ API key or service token, passed in the `Authorization:
        Bearer` header.
    sessionCookie:
      type: apiKey
      in: cookie
      name: session
      description: Session cookie obtained from `POST /api/auth/login`.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.