openapi: 3.2.0 info: title: Matomo Reporting API for plugin Roll Up Reporting API version: 1.0.0 description: Provides API endpoints for managing roll-up websites and their source site assignments. Use these methods to create roll-ups, update their configuration, and list the configured roll-up sites with their assigned source websites. servers: - url: https://demo-proxy.innocraft.cloud/ description: Current Matomo instance security: - MatomoToken: [] tags: - name: RollUpReporting description: Provides API endpoints for managing roll-up websites and their source site assignments. Use these methods to create roll-ups, update their configuration, and list the configured roll-up sites with their assigned source websites. paths: /index.php?module=API&method=RollUpReporting.addRollUp: get: tags: - RollUpReporting description: Creates a new roll-up website. operationId: RollUpReporting.addRollUp parameters: - $ref: '#/components/parameters/formatOptional' - name: name in: query description: The name of the roll-up website. required: true schema: type: string example: Pricing - name: sourceIdSites in: query description: Source website IDs to assign to the roll-up. Accepts numeric site IDs and the special value 'all' to assign all websites. required: true schema: oneOf: - type: integer - type: array items: type: string - name: timezone in: query description: The timezone to apply to the roll-up website. required: true schema: type: string example: Pacific/Auckland - name: currency in: query description: The currency code to apply to the roll-up website. required: true schema: type: string example: NZD responses: '200': description: 'The numeric ID of the created roll-up website. 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=RollUpReporting.updateRollUp: get: tags: - RollUpReporting description: Updates the configuration of an existing roll-up website. operationId: RollUpReporting.updateRollUp parameters: - $ref: '#/components/parameters/formatOptional' - name: idSite in: query description: The numeric ID of the roll-up website to update. required: true schema: type: integer example: 1 - name: name in: query description: The new roll-up website name. Omit to keep the current name. required: false schema: type: string - name: sourceIdSites in: query description: Source website IDs to assign to the roll-up. Accepts numeric site IDs and the special value 'all' to assign all websites. Omit to keep the current source site assignment. required: false schema: oneOf: - type: integer - type: array items: type: string - type: string - name: timezone in: query description: The new timezone for the roll-up website. Omit to keep the current timezone. required: false schema: type: string - name: currency in: query description: The new currency code for the roll-up website. Omit to keep the current currency. required: false schema: type: string 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=RollUpReporting.getRollUps: get: tags: - RollUpReporting description: Lists all configured roll-up websites. operationId: RollUpReporting.getRollUps parameters: - $ref: '#/components/parameters/formatOptional' responses: '200': description: 'Roll-up websites with their site metadata and assigned source website IDs. 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' 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: schema: type: string example: 'Error: The method is not available.' text/html: schema: type: string example: The method is not available. application/json: schema: $ref: '#/components/schemas/Error' application/xml: schema: $ref: '#/components/schemas/ErrorXml' ServerError: description: Unexpected server error. content: text/plain: schema: type: string example: 'Error: There was an error.' text/html: schema: type: string example: There was an error. application/json: schema: $ref: '#/components/schemas/Error' application/xml: schema: $ref: '#/components/schemas/ErrorXml' Unauthorized: description: Authentication failed or missing token. content: text/plain: schema: type: string example: 'Error: You must be logged in to access this functionality.' text/html: schema: type: string example: You must be logged in to access this functionality. application/json: schema: $ref: '#/components/schemas/Error' application/xml: schema: $ref: '#/components/schemas/ErrorXml' Forbidden: description: Authenticated but not allowed to access the resource. content: text/plain: schema: type: string example: 'Error: Not authorised.' text/html: schema: type: string example: Not authorised. application/json: schema: $ref: '#/components/schemas/Error' application/xml: schema: $ref: '#/components/schemas/ErrorXml' DefaultError: description: Default error response (any non-2xx). content: text/plain: schema: type: string example: 'Error: There was an error.' text/html: schema: type: string example: There was an error. application/json: schema: $ref: '#/components/schemas/Error' application/xml: schema: $ref: '#/components/schemas/ErrorXml' GenericSuccess: description: Generic 200 response content: text/plain: schema: type: string example: Success:ok text/html: schema: type: string example: '' application/json: schema: $ref: '#/components/schemas/GenericSuccess' application/xml: schema: $ref: '#/components/schemas/GenericSuccessXml' BadRequest: description: Bad request (validation or missing parameters). content: text/plain: schema: type: string example: 'Error: There was an error.' text/html: schema: type: string example: There was an error. application/json: schema: $ref: '#/components/schemas/Error' application/xml: schema: $ref: '#/components/schemas/ErrorXml' parameters: formatOptional: name: format in: query description: Response format. Defaults to `xml`. Use `original` to get the original PHP data structure. required: false schema: type: string default: xml enum: - xml - json - csv - tsv - html - rss - original securitySchemes: MatomoToken: type: http description: Paste your token generated from Personal > Security. Swagger will send it as a Bearer token. scheme: bearer externalDocs: description: Matomo Reporting API developer page url: https://developer.matomo.org/api-reference/reporting-api/