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

# Get daily event analytics

> Daily event-count time-series for a merchant over a date range (the admin-portal analytics events graph), scoped to the merchant from the JWT or the optional merchant_id override. Optionally drilled to a single interview. Capped at 1000 records per page.



## OpenAPI

````yaml https://cool.jobmojito.com/functions/v1/openapi get /merchant-analytics
openapi: 3.1.0
info:
  title: JobMojito API
  version: 1.0.0
  description: >-
    Public API for JobMojito, served by Supabase Edge Functions. Authenticate
    with a Supabase JWT access token via the Authorization header.
servers:
  - url: https://cool.jobmojito.com/functions/v1
    description: Production
security: []
tags:
  - name: Interviews
    description: >-
      Create, configure and manage interview / coaching / assessment
      definitions.
  - name: Results
    description: >-
      Interview results, transcripts, reports, re-attempt requests and
      analytics.
  - name: Candidates
    description: List and manage candidates.
  - name: Knowledge base
    description: Upload documents used to generate knowledge-base interviews.
  - name: Resume & Form verification
    description: Pre-screen candidates from resumes and forms.
  - name: Admin
    description: >-
      Account administration — invite team/coaching users, manage sub-merchants
      and avatar templates.
paths:
  /merchant-analytics:
    get:
      tags:
        - Results
      summary: Get daily event analytics
      description: >-
        Daily event-count time-series for a merchant over a date range (the
        admin-portal analytics events graph), scoped to the merchant from the
        JWT or the optional merchant_id override. Optionally drilled to a single
        interview. Capped at 1000 records per page.
      parameters:
        - schema:
            type: string
            format: uuid
            description: >-
              Optional merchant to scope the results to. Honoured only when the
              caller is an admin or a sub-merchant operator; otherwise the
              merchant from the JWT is always used.
            example: 28106cba-1c27-4e53-b149-32113e5e8e31
          required: false
          name: merchant_id
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: Start of the date range (inclusive), YYYY-MM-DD.
            example: '2026-01-01'
          required: true
          name: date_from
          in: query
        - schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
            description: End of the date range (inclusive), YYYY-MM-DD.
            example: '2026-01-01'
          required: true
          name: date_to
          in: query
        - schema:
            type: string
            format: uuid
            description: >-
              Optional interview definition id to drill the event counts down to
              a single interview.
          required: false
          name: interview_id
          in: query
        - schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 50
            description: Maximum number of records to return (1–1000).
            example: 50
          required: false
          name: limit
          in: query
        - schema:
            type: integer
            nullable: true
            minimum: 0
            default: 0
            description: Number of records to skip from the start of the result set.
            example: 0
          required: false
          name: offset
          in: query
      responses:
        '200':
          description: A page of daily event counts with pagination metadata.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MerchantAnalyticsResponse'
        '401':
          description: Missing or invalid access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Caller is not permitted to read this merchant.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Validation error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    MerchantAnalyticsResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              day:
                type: string
                description: Calendar day (YYYY-MM-DD).
                example: '2026-01-15'
              event:
                type: string
                description: >-
                  Event type (e.g. interview, interview_invitation,
                  interview_page_visit).
              event_number:
                type: number
                description: Count of this event on this day.
                example: 12
            required:
              - day
              - event
              - event_number
            additionalProperties:
              nullable: true
          description: >-
            Daily event counts for the requested range, ordered by day
            ascending.
        pagination:
          $ref: '#/components/schemas/Pagination'
      required:
        - data
        - pagination
    Error:
      type: object
      properties:
        error:
          type: string
          example: Field is required.
        name:
          type: string
          example: interview_result_id
      required:
        - error
    Pagination:
      type: object
      properties:
        total:
          type: integer
          description: Total matching records across all pages.
          example: 137
        limit:
          type: integer
          description: Page size used for this response.
          example: 50
        offset:
          type: integer
          description: Offset used for this response.
          example: 0
        has_more:
          type: boolean
          description: >-
            True when more records exist beyond this page (offset + returned <
            total).
          example: true
      required:
        - total
        - limit
        - offset
        - has_more
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Supabase JWT access token, passed as `Authorization: Bearer <token>`.'

````