Matomo Goals API

Goals API lets you Manage existing goals, via "updateGoal" and "deleteGoal", create new Goals via "addGoal", or list existing Goals for one or several websites via "getGoals" If you are tracking Ecommerce orders and products on your site, the functions "getItemsSku", "getItemsName" and "getItemsCategory" will return the list of products purchased on your site, either grouped by Product SKU, Product Name or Product Category. For each name, SKU or category, the following metrics are returned: Total revenue, Total quantity, average price, average quantity, number of orders (or abandoned carts) containing this product, number of visits on the Product page, Conversion rate. By default, these functions return the 'Products purchased'. These functions also accept an optional parameter &abandonedCarts=1. If the parameter is set, it will instead return the metrics for products that were left in an abandoned cart therefore not purchased. The API also lets you request overall Goal metrics via the method "get": Conversions, Visits with at least one conversion, Conversion rate and Revenue. If you wish to request specific metrics about Ecommerce goals, you can set the parameter &idGoal=ecommerceAbandonedCart to get metrics about abandoned carts (including Lost revenue, and number of items left in the cart) or &idGoal=ecommerceOrder to get metrics about Ecommerce orders (number of orders, visits with an order, subtotal, tax, shipping, discount, revenue, items ordered) See also the documentation about Tracking Goals in Matomo.

Operations 11

GET /index.php?module=API&method=Goals.getGoal #
GET /index.php?module=API&method=Goals.getGoals #
GET /index.php?module=API&method=Goals.addGoal #
GET /index.php?module=API&method=Goals.updateGoal #
GET /index.php?module=API&method=Goals.deleteGoal #
GET /index.php?module=API&method=Goals.getItemsSku #
GET /index.php?module=API&method=Goals.getItemsName #
GET /index.php?module=API&method=Goals.getItemsCategory #
GET /index.php?module=API&method=Goals.get #
GET /index.php?module=API&method=Goals.getDaysToConversion #
GET /index.php?module=API&method=Goals.getVisitsUntilConversion #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/matomo-goals-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

matomo-goals-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Matomo Reporting API for plugin Goals API
  version: 1.0.0
  description: 'Goals API lets you Manage existing goals, via "updateGoal" and "deleteGoal", create new Goals via "addGoal", or list existing Goals for one or several websites via "getGoals"  If you are <a href=''https://matomo.org/docs/ecommerce-analytics/'' target=''_blank''>tracking Ecommerce orders and products</a> on your site, the functions "getItemsSku", "getItemsName" and "getItemsCategory" will return the list of products purchased on your site, either grouped by Product SKU, Product Name or Product Category. For each name, SKU or category, the following metrics are returned: Total revenue, Total quantity, average price, average quantity, number of orders (or abandoned carts) containing this product, number of visits on the Product page, Conversion rate.  By default, these functions return the ''Products purchased''. These functions also accept an optional parameter &abandonedCarts=1. If the parameter is set, it will instead return the metrics for products that were left in an abandoned cart therefore not purchased.  The API also lets you request overall Goal metrics via the method "get": Conversions, Visits with at least one conversion, Conversion rate and Revenue. If you wish to request specific metrics about Ecommerce goals, you can set the parameter &idGoal=ecommerceAbandonedCart to get metrics about abandoned carts (including Lost revenue, and number of items left in the cart) or &idGoal=ecommerceOrder to get metrics about Ecommerce orders (number of orders, visits with an order, subtotal, tax, shipping, discount, revenue, items ordered)  See also the documentation about <a href=''https://matomo.org/docs/tracking-goals-web-analytics/'' rel=''noreferrer'' target=''_blank''>Tracking Goals</a> in Matomo.'
servers:
- url: https://demo-proxy.innocraft.cloud/
  description: Current Matomo instance
security:
- MatomoToken: []
tags:
- name: Goals
  description: 'Goals API lets you Manage existing goals, via "updateGoal" and "deleteGoal", create new Goals via "addGoal", or list existing Goals for one or several websites via "getGoals"  If you are <a href=''https://matomo.org/docs/ecommerce-analytics/'' target=''_blank''>tracking Ecommerce orders and products</a> on your site, the functions "getItemsSku", "getItemsName" and "getItemsCategory" will return the list of products purchased on your site, either grouped by Product SKU, Product Name or Product Category. For each name, SKU or category, the following metrics are returned: Total revenue, Total quantity, average price, average quantity, number of orders (or abandoned carts) containing this product, number of visits on the Product page, Conversion rate.  By default, these functions return the ''Products purchased''. These functions also accept an optional parameter &abandonedCarts=1. If the parameter is set, it will instead return the metrics for products that were left in an abandoned cart therefore not purchased.  The API also lets you request overall Goal metrics via the method "get": Conversions, Visits with at least one conversion, Conversion rate and Revenue. If you wish to request specific metrics about Ecommerce goals, you can set the parameter &idGoal=ecommerceAbandonedCart to get metrics about abandoned carts (including Lost revenue, and number of items left in the cart) or &idGoal=ecommerceOrder to get metrics about Ecommerce orders (number of orders, visits with an order, subtotal, tax, shipping, discount, revenue, items ordered)  See also the documentation about <a href=''https://matomo.org/docs/tracking-goals-web-analytics/'' rel=''noreferrer'' target=''_blank''>Tracking Goals</a> in Matomo.'
paths:
  /index.php?module=API&method=Goals.getGoal:
    get:
      tags:
      - Goals
      description: Return a single goal.
      operationId: Goals.getGoal
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: The numeric ID of the website to query.
        required: true
        schema:
          type: integer
          example: 1
      - name: idGoal
        in: query
        description: The numeric ID of the goal to query.
        required: true
        schema:
          type: integer
          example: 1
      responses:
        '200':
          description: 'Goal attributes, or `null` if the goal does not exist.


            Example responses require Super User access. Use Try it out to see a live response.'
          content:
            text/xml: []
            application/json: []
            application/vnd.ms-excel: []
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/DefaultError'
  /index.php?module=API&method=Goals.getGoals:
    get:
      tags:
      - Goals
      description: Returns all goals for one or more websites.
      operationId: Goals.getGoals
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: Website ID(s) to query. - Single site ID (e.g. 1) - Multiple site IDs (e.g. [1, 4, 5]) - Comma-separated list ("1,4,5") or "all"
        required: true
        schema:
          oneOf:
          - type: integer
            example: 1
          - type: string
            example: '1'
          - type: array
            items:
              type: integer
            example: 1
      - name: orderByName
        in: query
        description: Whether to sort the returned goals alphabetically by name.
        required: false
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: 'Goal attributes, indexed by goal ID for single-site requests and returned as a numeric list for multi-site requests.


            Example responses require Super User access. Use Try it out to see a live response.'
          content:
            text/xml: []
            application/json: []
            application/vnd.ms-excel: []
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/DefaultError'
  /index.php?module=API&method=Goals.addGoal:
    get:
      tags:
      - Goals
      description: Creates a goal for a website.
      operationId: Goals.addGoal
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: The numeric ID of the website to configure the goal for.
        required: true
        schema:
          type: integer
          example: 1
      - name: name
        in: query
        description: Goal name.
        required: true
        schema:
          type: string
          example: Pricing
      - name: matchAttribute
        in: query
        description: Attribute used to match conversions.
        required: true
        schema:
          type: string
          example: url
      - name: pattern
        in: query
        description: Match pattern. Use a URL, title, filename, external website, or event value for string match attributes; use a numeric threshold for visit duration, actions, or pageview match attributes; this value is ignored for `manually`.
        required: true
        schema:
          type: string
          example: https://example.org/pricing
      - name: patternType
        in: query
        description: Matching operator. Numeric match attributes only accept `greater_than`; string match attributes accept `exact`, `contains`, or `regex`; use an empty string for `manually`.
        required: true
        schema:
          type: string
          example: equals
      - name: caseSensitive
        in: query
        description: Whether string matching should be case-sensitive.
        required: false
        schema:
          type: boolean
          default: false
      - name: revenue
        in: query
        description: Default revenue to assign to conversions. Pass `false` or `0` to disable a fixed revenue value.
        required: false
        schema:
          type: number
      - name: allowMultipleConversionsPerVisit
        in: query
        description: Whether multiple conversions may be recorded within one visit.
        required: false
        schema:
          type: boolean
          default: false
      - name: description
        in: query
        description: Optional goal description shown in the Goals management UI.
        required: false
        schema:
          type: string
          default: ''
      - name: useEventValueAsRevenue
        in: query
        description: Whether to use the tracked event value as goal revenue. This is only valid for event-based goals.
        required: false
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: 'ID of the new goal.


            Example responses require Super User access. Use Try it out to see a live response.'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/DefaultError'
  /index.php?module=API&method=Goals.updateGoal:
    get:
      tags:
      - Goals
      description: Updates an existing goal without reprocessing already recorded conversions.
      operationId: Goals.updateGoal
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: The numeric ID of the website the goal belongs to.
        required: true
        schema:
          type: integer
          example: 1
      - name: idGoal
        in: query
        description: Goal ID to update.
        required: true
        schema:
          type: integer
          example: 1
      - name: name
        in: query
        description: Goal name.
        required: true
        schema:
          type: string
          example: Pricing
      - name: matchAttribute
        in: query
        description: Attribute used to match conversions.
        required: true
        schema:
          type: string
          example: url
      - name: pattern
        in: query
        description: Match pattern. Use a URL, title, filename, external website, or event value for string match attributes; use a numeric threshold for visit duration, actions, or pageview match attributes; this value is ignored for `manually`.
        required: true
        schema:
          type: string
          example: https://example.org/pricing
      - name: patternType
        in: query
        description: Matching operator. Numeric match attributes only accept `greater_than`; string match attributes accept `exact`, `contains`, or `regex`; use an empty string for `manually`.
        required: true
        schema:
          type: string
          example: equals
      - name: caseSensitive
        in: query
        description: Whether string matching should be case-sensitive.
        required: false
        schema:
          type: boolean
          default: false
      - name: revenue
        in: query
        description: Default revenue to assign to conversions. Pass `false` or `0` to disable a fixed revenue value.
        required: false
        schema:
          type: number
      - name: allowMultipleConversionsPerVisit
        in: query
        description: Whether multiple conversions may be recorded within one visit.
        required: false
        schema:
          type: boolean
          default: false
      - name: description
        in: query
        description: Optional goal description shown in the Goals management UI.
        required: false
        schema:
          type: string
          default: ''
      - name: useEventValueAsRevenue
        in: query
        description: Whether to use the tracked event value as goal revenue. This is only valid for event-based goals.
        required: false
        schema:
          type: boolean
          default: false
      responses:
        '200':
          $ref: '#/components/responses/GenericSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/DefaultError'
  /index.php?module=API&method=Goals.deleteGoal:
    get:
      tags:
      - Goals
      description: Soft deletes a given Goal.
      operationId: Goals.deleteGoal
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: The numeric ID of the website to query.
        required: true
        schema:
          type: integer
          example: 1
      - name: idGoal
        in: query
        description: The numeric ID of the goal to delete.
        required: true
        schema:
          type: integer
          example: 1
      responses:
        '200':
          $ref: '#/components/responses/GenericSuccess'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/DefaultError'
  /index.php?module=API&method=Goals.getItemsSku:
    get:
      tags:
      - Goals
      description: Returns ecommerce product metrics grouped by product SKU.
      operationId: Goals.getItemsSku
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: Website ID(s) to query. - Single site ID (e.g. 1) - Multiple site IDs (e.g. [1, 4, 5]) - Comma-separated list ("1,4,5") or "all"
        required: true
        schema:
          oneOf:
          - type: integer
            example: 1
          - type: string
            example: '1'
          - type: array
            items:
              type: integer
            example: 1
      - name: period
        in: query
        description: The period to process, processes data for the period containing the specified date.
        required: true
        schema:
          type: string
          enum:
          - day
          - week
          - month
          - year
          - range
          example: day
      - name: date
        in: query
        description: The date or date range to process. 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
        required: true
        schema:
          type: string
          example: yesterday
      - name: abandonedCarts
        in: query
        description: Whether to return abandoned-cart product metrics instead of purchased products.
        required: false
        schema:
          type: boolean
          default: false
      - name: segment
        in: query
        description: 'Custom segment to filter the report. Example: "referrerName==example.com" Supports AND (;) and OR (,) operators.'
        required: false
        schema:
          type: string
      responses:
        '200':
          description: 'Ecommerce product metrics grouped by SKU.


            Example responses require Super User access. Use Try it out to see a live response.'
          content:
            text/xml: []
            application/json: []
            application/vnd.ms-excel: []
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/DefaultError'
  /index.php?module=API&method=Goals.getItemsName:
    get:
      tags:
      - Goals
      description: Returns ecommerce product metrics grouped by product name.
      operationId: Goals.getItemsName
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: Website ID(s) to query. - Single site ID (e.g. 1) - Multiple site IDs (e.g. [1, 4, 5]) - Comma-separated list ("1,4,5") or "all"
        required: true
        schema:
          oneOf:
          - type: integer
            example: 1
          - type: string
            example: '1'
          - type: array
            items:
              type: integer
            example: 1
      - name: period
        in: query
        description: The period to process, processes data for the period containing the specified date.
        required: true
        schema:
          type: string
          enum:
          - day
          - week
          - month
          - year
          - range
          example: day
      - name: date
        in: query
        description: The date or date range to process. 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
        required: true
        schema:
          type: string
          example: yesterday
      - name: abandonedCarts
        in: query
        description: Whether to return abandoned-cart product metrics instead of purchased products.
        required: false
        schema:
          type: boolean
          default: false
      - name: segment
        in: query
        description: 'Custom segment to filter the report. Example: "referrerName==example.com" Supports AND (;) and OR (,) operators.'
        required: false
        schema:
          type: string
      responses:
        '200':
          description: 'Ecommerce product metrics grouped by name.


            Example responses require Super User access. Use Try it out to see a live response.'
          content:
            text/xml: []
            application/json: []
            application/vnd.ms-excel: []
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/DefaultError'
  /index.php?module=API&method=Goals.getItemsCategory:
    get:
      tags:
      - Goals
      description: Returns ecommerce product metrics grouped by product category.
      operationId: Goals.getItemsCategory
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: Website ID(s) to query. - Single site ID (e.g. 1) - Multiple site IDs (e.g. [1, 4, 5]) - Comma-separated list ("1,4,5") or "all"
        required: true
        schema:
          oneOf:
          - type: integer
            example: 1
          - type: string
            example: '1'
          - type: array
            items:
              type: integer
            example: 1
      - name: period
        in: query
        description: The period to process, processes data for the period containing the specified date.
        required: true
        schema:
          type: string
          enum:
          - day
          - week
          - month
          - year
          - range
          example: day
      - name: date
        in: query
        description: The date or date range to process. 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
        required: true
        schema:
          type: string
          example: yesterday
      - name: abandonedCarts
        in: query
        description: Whether to return abandoned-cart product metrics instead of purchased products.
        required: false
        schema:
          type: boolean
          default: false
      - name: segment
        in: query
        description: 'Custom segment to filter the report. Example: "referrerName==example.com" Supports AND (;) and OR (,) operators.'
        required: false
        schema:
          type: string
      responses:
        '200':
          description: 'Ecommerce product metrics grouped by category.


            Example responses require Super User access. Use Try it out to see a live response.'
          content:
            text/xml: []
            application/json: []
            application/vnd.ms-excel: []
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/DefaultError'
  /index.php?module=API&method=Goals.get:
    get:
      tags:
      - Goals
      description: Returns goal and ecommerce metrics, including new and returning visitor variants.
      operationId: Goals.get
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: Website ID(s) to query. - Single site ID (e.g. 1) - Multiple site IDs (e.g. [1, 4, 5]) - Comma-separated list ("1,4,5") or "all"
        required: true
        schema:
          oneOf:
          - type: integer
            example: 1
          - type: string
            example: '1'
          - type: array
            items:
              type: integer
            example: 1
      - name: period
        in: query
        description: The period to process, processes data for the period containing the specified date.
        required: true
        schema:
          type: string
          enum:
          - day
          - week
          - month
          - year
          - range
          example: day
      - name: date
        in: query
        description: The date or date range to process. 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
        required: true
        schema:
          type: string
          example: yesterday
      - name: segment
        in: query
        description: 'Custom segment to filter the report. Example: "referrerName==example.com" Supports AND (;) and OR (,) operators.'
        required: false
        schema:
          type: string
      - name: idGoal
        in: query
        description: Goal ID, `ecommerceOrder`, `ecommerceAbandonedCart`, or `false` for all goals.
        required: false
        schema:
          oneOf:
          - type: integer
          - type: string
      - name: columns
        in: query
        description: Optional metric name or list of metric names to return, for example `nb_conversions`, `nb_visits_converted`, `conversion_rate`, `revenue`, or ecommerce-specific metrics such as `items` or `avg_order_revenue`.
        required: false
        schema:
          oneOf:
          - type: string
            default: '[]'
          - type: array
            items:
              type: string
            default: []
      - name: showAllGoalSpecificMetrics
        in: query
        description: Whether to include per-goal metric columns when no specific goal is selected.
        required: false
        schema:
          type: boolean
          default: false
      - name: compare
        in: query
        description: Whether to prepare the table for a comparison report by deferring metric formatting.
        required: false
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: 'Goal metrics with additional columns for all visits, new visits, and returning visits.


            Example responses require Super User access. Use Try it out to see a live response.'
          content:
            text/xml: []
            application/json: []
            application/vnd.ms-excel: []
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/DefaultError'
  /index.php?module=API&method=Goals.getDaysToConversion:
    get:
      tags:
      - Goals
      description: Returns conversions grouped by the number of days between first visit and conversion.
      operationId: Goals.getDaysToConversion
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: Website ID(s) to query. - Single site ID (e.g. 1) - Multiple site IDs (e.g. [1, 4, 5]) - Comma-separated list ("1,4,5") or "all"
        required: true
        schema:
          oneOf:
          - type: integer
            example: 1
          - type: string
            example: '1'
          - type: array
            items:
              type: integer
            example: 1
      - name: period
        in: query
        description: The period to process, processes data for the period containing the specified date.
        required: true
        schema:
          type: string
          enum:
          - day
          - week
          - month
          - year
          - range
          example: day
      - name: date
        in: query
        description: The date or date range to process. 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
        required: true
        schema:
          type: string
          example: yesterday
      - name: segment
        in: query
        description: 'Custom segment to filter the report. Example: "referrerName==example.com" Supports AND (;) and OR (,) operators.'
        required: false
        schema:
          type: string
      - name: idGoal
        in: query
        description: Goal ID, `ecommerceOrder`, `ecommerceAbandonedCart`, or `false` for all goals.
        required: false
        schema:
          oneOf:
          - type: integer
          - type: string
      responses:
        '200':
          description: 'Conversion counts grouped by days until conversion.


            Example responses require Super User access. Use Try it out to see a live response.'
          content:
            text/xml: []
            application/json: []
            application/vnd.ms-excel: []
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/DefaultError'
  /index.php?module=API&method=Goals.getVisitsUntilConversion:
    get:
      tags:
      - Goals
      description: Returns conversions grouped by the visit count before conversion.
      operationId: Goals.getVisitsUntilConversion
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: Website ID(s) to query. - Single site ID (e.g. 1) - Multiple site IDs (e.g. [1, 4, 5]) - Comma-separated list ("1,4,5") or "all"
        required: true
        schema:
          oneOf:
          - type: integer
            example: 1
          - type: string
            example: '1'
          - type: array
            items:
              type: integer
            example: 1
      - name: period
        in: query
        description: The period to process, processes data for the period containing the specified date.
        required: true
        schema:
          type: string
          enum:
          - day
          - week
          - month
          - year
          - range
          example: day
      - name: date
        in: query
        description: The date or date range to process. 'YYYY-MM-DD', magic keywords (today, yesterday, lastWeek, lastMonth, lastYear), or date range (ie, 'YYYY-MM-DD,YYYY-MM-DD', lastX, previousX).
        required: true
        schema:
          type: string
          example: yesterday
      - name: segment
        in: query
        description: 'Custom segment to filter the report. Example: "referrerName==example.com" Supports AND (;) and OR (,) operators.'
        required: false
        schema:
          type: string
      - name: idGoal
        in: query
        description: Goal ID, `ecommerceOrder`, `ecommerceAbandonedCart`, or `false` for all goals.
        required: false
        schema:
          oneOf:
          - type: integer
          - type: string
      responses:
        '200':
          description: 'Conversion counts grouped by visits until conversion.


            Example responses require Super User access. Use Try it out to see a live response.'
          content:
            text/xml: []
            application/json: []
            application/vnd.ms-excel: []
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/ServerError'
        default:
          $ref: '#/components/responses/DefaultError'
components:
  schemas:
    GenericSuccessXml:
      description: Generic Matomo success payload in XML.
      required:
      - success
      properties:
        success:
          properties:
            message:
              type: string
              xml:
                attribute: true
              example: ok
          type: object
          xml:
            name: success
      type: object
      xml:
        name: result
      example:
        success:
          message: ok
      additionalProperties: true
    GenericSuccess:
      description: Generic Matomo success payload.
      required:
      - result
      - message
      properties:
        result:
          type: string
          example: success
        message:
          type: string
          example: ok
        code:
          type: integer
          example: '200'
      type: object
      example:
        result: success
        message: ok
      additionalProperties: true
    ErrorXml:
      description: Generic Matomo error payload in XML.
      properties:
        error:
          properties:
            message:
              type: string
              xml:
                attribute: true
              example: There was an error
          type: object
          xml:
            name: error
      type: object
      xml:
        name: result
    Error:
      description: Generic Matomo error payload.
      required:
      - result
      - message
      properties:
        result:
          type: string
          example: error
        message:
          type: string
          example: There was an error
        code:
          type: integer
      type: object
      additionalProperties: true
  responses:
    NotFound:
      description: Resource not found.
      content:
        text/plain:


# --- truncated at 32 KB (35 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/matomo/refs/heads/main/openapi/matomo-goals-api-openapi.yml