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

> ## Agent Instructions
> Internal links on these pages omit the .md extension. Append .md to a docs page URL, or send an Accept: text/markdown header, to get that page as markdown.

# Get email stats

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Returns delivery and engagement counts for the emails the app sent, for each template and in total, over the last `days` days. Each count has a daily breakdown and the totals for the same number of days before, so you can compare periods.

Days are UTC. A send counts on the day it was sent, and a delivery, open or click on the day it happened, so a rate can include outcomes of emails sent before the period. Opens and clicks are counted only for emails sent with tracking on. Emails the app sends from its own email domain aren't counted yet, so an app that sends from its own domain gets zeros for those.

`templates` is paginated. Pass `next_cursor` back as `cursor`, with the same `days` and `limit`, to get the next page. Every page carries the same app-wide `totals`, `previous_totals` and `daily`.

Email stats need a paid workspace plan.

This is limited to 60 requests per minute per app for each workspace's personal API keys, so every key in a workspace shares one allowance. Some workspaces have a different limit. [List email templates](/api-reference/list-email-templates) shares it.

<Note>This endpoint accepts a personal API key belonging to a user with access to the app. A read-only key is refused, and workspace API keys are not accepted.</Note>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json get /api/apps/{app_id}/emails/stats
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/emails/stats:
    get:
      summary: Get email stats
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Returns delivery and engagement counts for the emails the app sent, for
        each template and in total, over the last `days` days. Each count has a
        daily breakdown and the totals for the same number of days before, so
        you can compare periods.


        Days are UTC. A send counts on the day it was sent, and a delivery, open
        or click on the day it happened, so a rate can include outcomes of
        emails sent before the period. Opens and clicks are counted only for
        emails sent with tracking on. Emails the app sends from its own email
        domain aren't counted yet, so an app that sends from its own domain gets
        zeros for those.


        `templates` is paginated. Pass `next_cursor` back as `cursor`, with the
        same `days` and `limit`, to get the next page. Every page carries the
        same app-wide `totals`, `previous_totals` and `daily`.


        Email stats need a paid workspace plan.


        This is limited to 60 requests per minute per app for each workspace's
        personal API keys, so every key in a workspace shares one allowance.
        Some workspaces have a different limit. [List email
        templates](/api-reference/list-email-templates) shares it.


        <Note>This endpoint accepts a personal API key belonging to a user with
        access to the app. A read-only key is refused, and workspace API keys
        are not accepted.</Note>
      operationId: get_email_stats_api_apps__app_id__emails_stats_get
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: ID of the app the emails belong to.
            title: App Id
          description: ID of the app the emails belong to.
          example: 6820f3a4e7b91d003c45a1f2
        - name: days
          in: query
          required: false
          schema:
            type: integer
            maximum: 90
            minimum: 1
            description: >-
              Number of days to count, from 1 to 90, ending today in UTC.
              Defaults to 30. The previous totals cover the same number of days
              just before.
            default: 30
            title: Days
          description: >-
            Number of days to count, from 1 to 90, ending today in UTC. Defaults
            to 30. The previous totals cover the same number of days just
            before.
          example: 30
        - name: limit
          in: query
          required: false
          schema:
            type: integer
            maximum: 200
            minimum: 1
            description: >-
              Maximum number of entries in `templates` per page, from 1 to 200.
              Defaults to 50.
            default: 50
            title: Limit
          description: >-
            Maximum number of entries in `templates` per page, from 1 to 200.
            Defaults to 50.
          example: 50
        - name: cursor
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              `next_cursor` from the previous page. Send the same `days` and
              `limit` with it. A cursor expires after 24 hours.
            title: Cursor
          description: >-
            `next_cursor` from the previous page. Send the same `days` and
            `limit` with it. A cursor expires after 24 hours.
          example: eyJuIjoiYXBwX2VtYWlsX3N0YXRzIiwicCI6eyJhZnRlciI6IldlbGNvbWUifX0
      responses:
        '200':
          description: The app's email stats.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailStats'
        '400':
          description: >-
            `cursor` is invalid or expired, or doesn't match the `days` and
            `limit` you sent with it.
        '401':
          description: Missing or invalid credentials.
        '402':
          description: The workspace's plan doesn't include email stats.
        '403':
          description: >-
            You don't have access to this app, the app is blocked, your API key
            is read-only, or you used a workspace API key.
        '404':
          description: App not found.
        '422':
          description: '`days` is outside 1 to 90, or `limit` is outside 1 to 200.'
        '429':
          description: >-
            Rate limit exceeded. The base limit is 60 requests per minute. See
            [Rate
            limits](/developers/references/apps-api/get-started/rate-limits) for
            the multiplier your plan gets.
components:
  schemas:
    EmailStats:
      properties:
        days:
          type: integer
          title: Days
          description: Number of days counted, as requested.
          example: 30
        templates:
          items:
            $ref: '#/components/schemas/TemplateEmailStatsDoc'
          type: array
          title: Templates
          description: >-
            Counts for each template that sent email in either period, ordered
            by `template_key`.
          example:
            - daily:
                - bounced: 1
                  clicked: 5
                  day: '2026-09-14'
                  delivered: 41
                  opened: 18
                  sent: 42
                  spam: 0
                  unsubscribed: 0
              template_key: Welcome
              totals:
                bounce_rate: 0.025
                bounced: 31
                clicked: 143
                delivered: 1198
                delivered_rate: 0.966
                opened: 512
                sent: 1240
                spam: 2
                unsubscribed: 4
              tracked: true
        totals:
          $ref: '#/components/schemas/EmailStatTotalsDoc'
          description: >-
            Totals for the period across every template and emails sent without
            one, on every page.
        previous_totals:
          anyOf:
            - $ref: '#/components/schemas/EmailStatTotalsDoc'
            - type: 'null'
          description: >-
            Totals for the same number of days just before the period, or `null`
            when nothing was sent then.
        daily:
          items:
            $ref: '#/components/schemas/EmailStatDayDoc'
          type: array
          title: Daily
          description: >-
            One entry per day of the period, oldest first, with zeros on days
            with no activity. Covers every template, on every page.
          example:
            - bounced: 1
              clicked: 5
              day: '2026-09-14'
              delivered: 41
              opened: 18
              sent: 42
              spam: 0
              unsubscribed: 0
        next_cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Next Cursor
          description: >-
            Pass it as `cursor` to get the next page of `templates`, or `null`
            on the last page.
          example: eyJuIjoiYXBwX2VtYWlsX3N0YXRzIiwicCI6eyJhZnRlciI6IldlbGNvbWUifX0
      type: object
      required:
        - days
        - templates
        - totals
        - previous_totals
        - daily
        - next_cursor
      title: EmailStats
      description: Delivery and engagement counts for the app's sent emails.
    TemplateEmailStatsDoc:
      properties:
        template_key:
          type: string
          title: Template Key
          description: >-
            Which template the counts are for: its `name`, or its `id` for
            emails sent by template ID. `_none` groups emails sent without a
            template. A deleted template keeps its entry for the emails it sent.
          example: Welcome
        totals:
          $ref: '#/components/schemas/EmailStatTotalsDoc'
          description: Totals for the period.
        previous_totals:
          anyOf:
            - $ref: '#/components/schemas/EmailStatTotalsDoc'
            - type: 'null'
          description: >-
            Totals for the same number of days just before the period, or `null`
            when nothing was sent then.
        daily:
          items:
            $ref: '#/components/schemas/EmailStatDayDoc'
          type: array
          title: Daily
          description: >-
            One entry per day of the period, oldest first, with zeros on days
            with no activity.
          example:
            - bounced: 1
              clicked: 5
              day: '2026-09-14'
              delivered: 41
              opened: 18
              sent: 42
              spam: 0
              unsubscribed: 0
        tracked:
          type: boolean
          title: Tracked
          description: >-
            `false` when the template has no `{{unsubscribe_url}}` and recorded
            no opens or clicks in either period. Its `opened` and `clicked`
            zeros then mean opens and clicks weren't measured, not that nobody
            opened it.
          example: true
      type: object
      required:
        - template_key
        - totals
        - previous_totals
        - daily
        - tracked
      title: TemplateEmailStatsDoc
    EmailStatTotalsDoc:
      properties:
        sent:
          type: integer
          title: Sent
          description: Emails sent.
          example: 1240
        delivered:
          type: integer
          title: Delivered
          description: Emails the recipient's mail server accepted.
          example: 1198
        opened:
          type: integer
          title: Opened
          description: >-
            Opens, counting each open, so one recipient can count more than
            once.
          example: 512
        clicked:
          type: integer
          title: Clicked
          description: >-
            Link clicks, counting each click, so one recipient can count more
            than once.
          example: 143
        bounced:
          type: integer
          title: Bounced
          description: Emails that bounced.
          example: 31
        spam:
          type: integer
          title: Spam
          description: Emails recipients marked as spam.
          example: 2
        unsubscribed:
          type: integer
          title: Unsubscribed
          description: Recipients who unsubscribed through the email.
          example: 4
        delivered_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Delivered Rate
          description: >-
            `delivered` divided by `sent`, from 0 to 1, or `null` when nothing
            was sent.
          example: 0.966
        bounce_rate:
          anyOf:
            - type: number
            - type: 'null'
          title: Bounce Rate
          description: >-
            `bounced` divided by `sent`, from 0 to 1, or `null` when nothing was
            sent.
          example: 0.025
      type: object
      required:
        - sent
        - delivered
        - opened
        - clicked
        - bounced
        - spam
        - unsubscribed
        - delivered_rate
        - bounce_rate
      title: EmailStatTotalsDoc
    EmailStatDayDoc:
      properties:
        sent:
          type: integer
          title: Sent
          description: Emails sent.
          example: 1240
        delivered:
          type: integer
          title: Delivered
          description: Emails the recipient's mail server accepted.
          example: 1198
        opened:
          type: integer
          title: Opened
          description: >-
            Opens, counting each open, so one recipient can count more than
            once.
          example: 512
        clicked:
          type: integer
          title: Clicked
          description: >-
            Link clicks, counting each click, so one recipient can count more
            than once.
          example: 143
        bounced:
          type: integer
          title: Bounced
          description: Emails that bounced.
          example: 31
        spam:
          type: integer
          title: Spam
          description: Emails recipients marked as spam.
          example: 2
        unsubscribed:
          type: integer
          title: Unsubscribed
          description: Recipients who unsubscribed through the email.
          example: 4
        day:
          type: string
          format: date
          title: Day
          description: The UTC day the counts are for.
          example: '2026-09-14'
      type: object
      required:
        - sent
        - delivered
        - opened
        - clicked
        - bounced
        - spam
        - unsubscribed
        - day
      title: EmailStatDayDoc
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: 'Personal access token, sent as `Authorization: Bearer <token>`.'

````

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