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

# Run a report

> A report’s figures, over every lead of the organization: the total and each group (and series, when split). The saved period applies unless `period` overrides it. Figures can be up to a minute old.

Scope: `reports.read`.



## OpenAPI

````yaml /openapi.json get /api/v1/reports/{reportId}/results
openapi: 3.1.0
info:
  title: Marro API
  version: 1.0.0
  description: >-
    Server-to-server access to one organization’s data in Marro. Each key
    belongs to an organization and can use only the scopes it was given for
    modules the organization subscribes to. Keys go only in the Authorization
    header, over HTTPS, from a server: never in browser code or a URL. A key
    that was ever sent over plain HTTP or in a URL must be treated as leaked:
    revoke it and create a new one. The API sends no CORS headers.


    Every response carries `X-Request-Id`, to quote to support. Once the key is
    checked, responses also carry `RateLimit-Limit`, `RateLimit-Remaining` and
    `RateLimit-Reset` (seconds until the window resets) for whichever limit is
    closer to running out. An address that is not an endpoint answers 404
    `NOT_FOUND` in the same error shape.
servers:
  - url: https://app.marro.si
security: []
tags:
  - name: Leads
    description: >-
      Record-link custom fields accept numeric target ID arrays (one or up to 20
      according to recordLink.multiple). Reads resolve accessible targets to
      id/kind/name/href objects. Deleted, archived, disabled and inaccessible
      targets are omitted. Destinations require the corresponding leads.read or
      crm.records.read scope; user destinations have no public API scope. Object
      destinations use object:<id>, require objects.records.read and the key
      creator current object grants.
  - name: Customers
    description: >-
      Contacts, companies and enabled opportunities with record-type custom
      fields. Dedicated crm.records scopes are required.
  - name: Reference
    description: 'How this organization is set up: fields, stages, sources and people.'
  - name: Money
    description: >-
      Products, quotes, invoices and payments. Amounts are integers in the
      smallest currency unit (paise, cents); a new document is in the
      organization's own currency. Tax follows the organization's regional
      settings: under India GST an invoice carries CGST and SGST inside the
      organization's state, IGST outside it, and no GST without a supplier
      GSTIN; under a single-rate tax (Australia GST 10%, UK VAT) each taxed line
      carries that tax (singleTaxMinor), and none without the supplier's
      registration number. Each document keeps the tax it was issued under
      (tax.model).
  - name: Reports
    description: >-
      Custom reports shared with everyone in the organization, and their
      figures. Built in the app under Reports → Custom reports; a key reads them
      over every lead.
paths:
  /api/v1/reports/{reportId}/results:
    get:
      tags:
        - Reports
      summary: Run a report
      description: >-
        A report’s figures, over every lead of the organization: the total and
        each group (and series, when split). The saved period applies unless
        `period` overrides it. Figures can be up to a minute old.


        Scope: `reports.read`.
      operationId: get-report-results
      parameters:
        - name: reportId
          in: path
          required: true
          description: The report’s ID, from List reports.
          schema:
            type: integer
            minimum: 1
        - name: period
          in: query
          required: false
          description: Overrides the saved period. "custom" needs from and to.
          schema:
            type: string
            enum:
              - today
              - 7d
              - 30d
              - 90d
              - this_month
              - custom
        - name: from
          in: query
          required: false
          description: >-
            First day, YYYY-MM-DD on the organization calendar (with
            period=custom).
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
        - name: to
          in: query
          required: false
          description: Last day, YYYY-MM-DD (with period=custom).
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
      responses:
        '200':
          description: The figures.
          content:
            application/json:
              schema:
                type: object
                properties:
                  report:
                    type: object
                    properties:
                      id:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      name:
                        type: string
                    required:
                      - id
                      - name
                    additionalProperties: false
                  measure:
                    type: string
                  unit:
                    type: string
                    enum:
                      - count
                      - percent
                      - minutes
                      - seconds
                      - days
                      - number
                  groupBy:
                    type:
                      - string
                      - 'null'
                  splitBy:
                    type:
                      - string
                      - 'null'
                  period:
                    anyOf:
                      - type: object
                        properties:
                          label:
                            type: string
                          fromDay:
                            type: string
                          toDay:
                            type: string
                        required:
                          - label
                          - fromDay
                          - toDay
                        additionalProperties: false
                      - type: 'null'
                  total:
                    type:
                      - number
                      - 'null'
                  previousTotal:
                    description: The period before, for a number report of up to 92 days.
                    type:
                      - number
                      - 'null'
                  records:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  series:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          type: string
                        label:
                          type: string
                      required:
                        - key
                        - label
                      additionalProperties: false
                  groups:
                    type: array
                    items:
                      type: object
                      properties:
                        key:
                          description: >-
                            The group’s value: an ID, a fixed value or a day
                            (YYYY-MM-DD); null for "not set".
                          type:
                            - string
                            - 'null'
                        label:
                          type: string
                        value:
                          type:
                            - number
                            - 'null'
                        records:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                        values:
                          description: >-
                            With a split: the value of each series, by series
                            key.
                          type: object
                          propertyNames:
                            type: string
                          additionalProperties:
                            type:
                              - number
                              - 'null'
                      required:
                        - key
                        - label
                        - value
                        - records
                      additionalProperties: false
                  hiddenGroups:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                  truncated:
                    type: boolean
                required:
                  - report
                  - measure
                  - unit
                  - groupBy
                  - splitBy
                  - period
                  - total
                  - previousTotal
                  - records
                  - series
                  - groups
                  - hiddenGroups
                  - truncated
                additionalProperties: false
              example:
                report:
                  id: 12
                  name: Leads by source
                measure: Leads
                unit: count
                groupBy: Lead source
                splitBy: null
                period:
                  label: Last 30 days
                  fromDay: '2026-10-14'
                  toDay: '2026-11-12'
                total: 248
                previousTotal: null
                records: 248
                series: []
                groups:
                  - key: '3'
                    label: Website
                    value: 131
                    records: 131
                  - key: '5'
                    label: Facebook
                    value: 87
                    records: 87
                  - key: null
                    label: No source
                    value: 30
                    records: 30
                hiddenGroups: 0
                truncated: false
        '401':
          description: 'UNAUTHORIZED: The key is missing, wrong, revoked or expired.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            FORBIDDEN: The key lacks the scope, or the organization’s plan does
            not include it.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: >-
            NOT_FOUND: No report with this ID, or it is not shared with everyone
            in the organization.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: >-
            REPORT_INVALID: The report names something that no longer exists (a
            removed field or stage). Fix it in the app.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '429':
          description: >-
            RATE_LIMITED: More than 600 requests in an hour with this key, or
            3000 with all of the organization’s keys together. `Retry-After`
            says how many seconds to wait.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: >-
            INTERNAL: Something failed on our side. Retry; if it persists,
            contact support quoting the `X-Request-Id` response header.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '503':
          description: >-
            REPORT_UNAVAILABLE: The report took too long or could not run just
            now. Try a shorter period.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
      security:
        - ApiKey:
            - reports.read
components:
  schemas:
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              description: >-
                Stable, machine-readable: UNAUTHORIZED, FORBIDDEN, NOT_FOUND,
                VALIDATION_FAILED, DUPLICATE_LEAD, RATE_LIMITED…
            message:
              type: string
              description: A sentence for people.
            details:
              description: >-
                For VALIDATION_FAILED, `fields` maps each field key to its
                problem.
              type: object
              propertyNames:
                type: string
              additionalProperties: {}
          required:
            - code
            - message
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    ApiKey:
      type: http
      scheme: bearer
      description: >-
        An organization API key, created in Settings → Integrations → API keys.
        Keys start with `mk_live_`. Marro stores only a hash of a key, so it is
        shown once, when it is created: copy it then. Revoking a key ends its
        access at once. To replace a key without downtime, create the new one,
        switch your server to it, then revoke the old one. Changes made with a
        key appear on the lead’s timeline as made by the person who created the
        key, via the API. Scopes: `objects.records.read` (Read custom objects),
        `objects.records.write` (Create and update custom-object records),
        `objects.records.delete` (Delete custom-object records), `leads.read`
        (Read leads), `leads.write` (Create and update leads), `leads.capture`
        (Capture leads), `crm.records.read` (Read customers and opportunities),
        `crm.records.write` (Create and update customers and opportunities),
        `reports.read` (Read reports), `money.read` (Read products, quotes,
        invoices and payments), `money.write` (Create quotes and invoices and
        record payments), `agent.tools` (AI agent tools (MCP)).
      x-scopes:
        objects.records.read:
          label: Read custom objects
          description: >-
            Read definitions and records within the key creator’s current
            per-object access.
          module: objects
        objects.records.write:
          label: Create and update custom-object records
          description: >-
            Create and edit within current per-object grants. Needs
            objects.records.read.
          module: objects
        objects.records.delete:
          label: Delete custom-object records
          description: >-
            Permanently delete with current object delete grant, version and
            exact title. Needs objects.records.read.
          module: objects
        leads.read:
          label: Read leads
          description: >-
            Leads with every field, and the lists that describe them: fields,
            stages, sources and people.
          module: leads
        leads.write:
          label: Create and update leads
          description: >-
            Create leads, change their fields, stage and owner, and add notes.
            Needs leads.read.
          module: leads
        leads.capture:
          label: Capture leads
          description: >-
            Capture leads from a website or form: add a lead or update the
            existing one with the same phone or email. Cannot read, list or
            change anything else.
          module: leads
        crm.records.read:
          label: Read customers and opportunities
          description: >-
            Read contacts, companies and enabled opportunities, including their
            custom fields.
          module: customers
        crm.records.write:
          label: Create and update customers and opportunities
          description: >-
            Create and update contacts, companies and enabled opportunities with
            validated custom fields. Needs crm.records.read.
          module: customers
        reports.read:
          label: Read reports
          description: >-
            List the custom reports shared with everyone in the organization and
            read their figures for any period.
          module: reports.custom
        money.read:
          label: Read products, quotes, invoices and payments
          description: >-
            Read the product catalogue, quotes and GST invoices with their lines
            and totals, and payments received.
          module: finance.quotes
        money.write:
          label: Create quotes and invoices and record payments
          description: >-
            Create quotes and invoices (as drafts, or issued with their number)
            and record payments against invoices. Needs money.read.
          module: finance.quotes
        agent.tools:
          label: AI agent tools (MCP)
          description: >-
            Connect another AI agent over MCP: find and read leads, see what
            your agents may do, and ask Marro's agent to act on a lead within
            your agents' permissions.
          module: ai.agents
      x-key-types:
        - name: Website form
          scopes:
            - leads.capture
          lifetimeDays: 730
          description: >-
            A website or landing-page form that sends enquiries in as leads. Can
            do nothing else.
        - name: Another application
          lifetimeDays: 90
          description: >-
            Any other integration. Choose the scopes it needs when you create
            it.

````

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