> ## 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.

# Run a custom report

> Runs every block of a saved report and returns its rows. Filters start from the report's defaults, then your own saved filters, then `filters` if you pass it. Each block runs on its own: a block that fails returns ok=false with an error while the others still return data. Numbers are aggregated; no block returns more than 500 rows.



## OpenAPI

````yaml https://cool.jobmojito.com/functions/v1/openapi get /report-run
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: Coaching catalogue
    description: >-
      Directories (pages) of the coaching portal catalogue that group coaching
      sessions and carry custom content pages.
  - name: Results
    description: >-
      Interview results, transcripts, reports, re-attempt requests and
      analytics.
  - name: Reports
    description: >-
      Custom reports: read the catalogue of datasets, build a report definition,
      check it, save it and run it.
  - 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:
  /report-run:
    get:
      tags:
        - Reports
      summary: Run a custom report
      description: >-
        Runs every block of a saved report and returns its rows. Filters start
        from the report's defaults, then your own saved filters, then `filters`
        if you pass it. Each block runs on its own: a block that fails returns
        ok=false with an error while the others still return data. Numbers are
        aggregated; no block returns more than 500 rows.
      parameters:
        - schema:
            type: string
            format: uuid
            description: >-
              Optional merchant to scope to. Admins and sub-merchant operators
              only; other callers always use their token's merchant.
            example: 28106cba-1c27-4e53-b149-32113e5e8e31
          required: false
          name: merchant_id
          in: query
        - schema:
            type: string
            format: uuid
            description: Report id (from list_reports).
          required: true
          name: id
          in: query
        - schema:
            type: string
            description: >-
              Optional JSON ReportFilters to apply on top, e.g.
              {"period":{"preset":"last_month"}}.
          required: false
          name: filters
          in: query
        - schema:
            type: string
            description: Run only this block.
          required: false
          name: block_id
          in: query
        - schema:
            type: string
            enum:
              - 'true'
              - 'false'
            default: 'false'
            description: >-
              Run the unpublished draft instead (only if you can edit the
              report).
            example: 'false'
          required: false
          name: draft
          in: query
      responses:
        '200':
          description: Block results.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReportRunResponse'
        '401':
          description: Missing, expired or invalid access token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Your token or role may not do this (for example a hiring manager
            sharing, or a dataset your account does not include).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: No report with this id, or it is not shared with you.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            Validation error. The message names the block and field, and lists
            valid ids.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Server error.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - bearerAuth: []
components:
  schemas:
    ReportRunResponse:
      type: object
      properties:
        report_id:
          type: string
          format: uuid
        title:
          type: string
        version:
          type: integer
        filters:
          type: object
          additionalProperties:
            nullable: true
          description: >-
            The filters the blocks ran with (report defaults, then your saved
            filters, then the ones you passed).
        blocks:
          type: array
          items:
            $ref: '#/components/schemas/ReportBlockResult'
      required:
        - filters
        - blocks
      additionalProperties:
        nullable: true
    Error:
      type: object
      properties:
        error:
          type: string
          example: Field is required.
        name:
          type: string
          example: interview_result_id
      required:
        - error
    ReportBlockResult:
      type: object
      properties:
        block_id:
          type: string
        ok:
          type: boolean
          description: >-
            false when this block could not run; see error. Other blocks are
            unaffected.
        columns:
          type: array
          items:
            type: object
            additionalProperties:
              nullable: true
          description: >-
            Each column: id, kind (dimension | measure), type, label, and for
            measures a format.
        rows:
          type: array
          items:
            type: object
            additionalProperties:
              nullable: true
          description: One object per row, keyed by column id.
        truncated:
          type: boolean
          description: More rows exist than the block limit.
        previous:
          type: object
          additionalProperties:
            nullable: true
          description: 'compare previous_period: the same measures for the period before.'
        period:
          type: object
          additionalProperties:
            nullable: true
          description: >-
            The period the block covered: from, to (inclusive), snapshot (true
            when the dataset ignores the period).
        error:
          type: string
      required:
        - block_id
        - ok
      additionalProperties:
        nullable: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Supabase JWT — `Authorization: Bearer <token>`.'

````

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