Matomo Sites Manager API

The SitesManager API gives you full control on Websites in Matomo (create, update and delete), and many methods to retrieve websites based on various attributes. This API lets you create websites via "addSite", update existing websites via "updateSite" and delete websites via "deleteSite". When creating websites, it can be useful to access internal codes used by Matomo for currencies via "getCurrencyList", or timezones via "getTimezonesList". There are also many ways to request a list of websites: from the website ID via "getSiteFromId" or the site URL via "getSitesIdFromSiteUrl". Often, the most useful technique is to list all websites that are known to a current user, based on the token_auth, via "getSitesWithAdminAccess", "getSitesWithViewAccess" or "getSitesWithAtLeastViewAccess" (which returns both). Some methods will affect all websites globally: "setGlobalExcludedIps" will set the list of IPs to be excluded on all websites, "setGlobalExcludedQueryParameters" will set the list of URL parameters to remove from URLs for all websites. The existing values can be fetched via "getExcludedIpsGlobal" and "getExcludedQueryParametersGlobal". See also the documentation about Managing Websites in Matomo.

Operations 53

GET /index.php?module=API&method=SitesManager.getJavascriptTag #
GET /index.php?module=API&method=SitesManager.getImageTrackingCode #
GET /index.php?module=API&method=SitesManager.getSitesFromGroup #
GET /index.php?module=API&method=SitesManager.getSitesGroups #
GET /index.php?module=API&method=SitesManager.getSiteFromId #
GET /index.php?module=API&method=SitesManager.getSiteUrlsFromId #
GET /index.php?module=API&method=SitesManager.getAllSites #
GET /index.php?module=API&method=SitesManager.getAllSitesId #
GET /index.php?module=API&method=SitesManager.getSitesWithAdminAccess #
GET /index.php?module=API&method=SitesManager.getSitesWithMinimumAccess #
GET /index.php?module=API&method=SitesManager.getSitesWithViewAccess #
GET /index.php?module=API&method=SitesManager.getSitesWithAtLeastViewAccess #
GET /index.php?module=API&method=SitesManager.getSitesIdWithAdminAccess #
GET /index.php?module=API&method=SitesManager.getSitesIdWithViewAccess #
GET /index.php?module=API&method=SitesManager.getSitesIdWithWriteAccess #
GET /index.php?module=API&method=SitesManager.getSitesIdWithAtLeastViewAccess #
GET /index.php?module=API&method=SitesManager.getSitesIdFromSiteUrl #
GET /index.php?module=API&method=SitesManager.addSite #
GET /index.php?module=API&method=SitesManager.getSiteSettings #
GET /index.php?module=API&method=SitesManager.deleteSite #
GET /index.php?module=API&method=SitesManager.addSiteAliasUrls #
GET /index.php?module=API&method=SitesManager.setSiteAliasUrls #
GET /index.php?module=API&method=SitesManager.getIpsForRange #
GET /index.php?module=API&method=SitesManager.setGlobalExcludedIps #
GET /index.php?module=API&method=SitesManager.setGlobalSearchParameters #
GET /index.php?module=API&method=SitesManager.getSearchKeywordParametersGlobal #
GET /index.php?module=API&method=SitesManager.getSearchCategoryParametersGlobal #
GET /index.php?module=API&method=SitesManager.getExcludedQueryParameters #
GET /index.php?module=API&method=SitesManager.getExcludedQueryParametersGlobal #
GET /index.php?module=API&method=SitesManager.getExcludedUserAgentsGlobal #
GET /index.php?module=API&method=SitesManager.setGlobalExcludedUserAgents #
GET /index.php?module=API&method=SitesManager.getExcludedReferrers #
GET /index.php?module=API&method=SitesManager.getExcludedReferrersGlobal #
GET /index.php?module=API&method=SitesManager.setGlobalExcludedReferrers #
GET /index.php?module=API&method=SitesManager.getKeepURLFragmentsGlobal #
GET /index.php?module=API&method=SitesManager.setKeepURLFragmentsGlobal #
GET /index.php?module=API&method=SitesManager.getExcludedIpsGlobal #
GET /index.php?module=API&method=SitesManager.getDefaultCurrency #
GET /index.php?module=API&method=SitesManager.setDefaultCurrency #
GET /index.php?module=API&method=SitesManager.getDefaultTimezone #
GET /index.php?module=API&method=SitesManager.setDefaultTimezone #
GET /index.php?module=API&method=SitesManager.setGlobalQueryParamExclusion #
GET /index.php?module=API&method=SitesManager.getExclusionTypeForQueryParams #
GET /index.php?module=API&method=SitesManager.updateSite #
GET /index.php?module=API&method=SitesManager.getCurrencyList #
GET /index.php?module=API&method=SitesManager.getCurrencySymbols #
GET /index.php?module=API&method=SitesManager.isTimezoneSupportEnabled #
GET /index.php?module=API&method=SitesManager.getTimezonesList #
GET /index.php?module=API&method=SitesManager.getTimezoneName #
GET /index.php?module=API&method=SitesManager.getUniqueSiteTimezones #
GET /index.php?module=API&method=SitesManager.renameGroup #
GET /index.php?module=API&method=SitesManager.getPatternMatchSites #
GET /index.php?module=API&method=SitesManager.getNumWebsitesToDisplayPerPage #

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-sitesmanager-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-sitesmanager-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Matomo Reporting API for plugin Sites Manager API
  version: 1.0.0
  description: 'The SitesManager API gives you full control on Websites in Matomo (create, update and delete), and many methods to retrieve websites based on various attributes.  This API lets you create websites via "addSite", update existing websites via "updateSite" and delete websites via "deleteSite". When creating websites, it can be useful to access internal codes used by Matomo for currencies via "getCurrencyList", or timezones via "getTimezonesList".  There are also many ways to request a list of websites: from the website ID via "getSiteFromId" or the site URL via "getSitesIdFromSiteUrl". Often, the most useful technique is to list all websites that are known to a current user, based on the token_auth, via "getSitesWithAdminAccess", "getSitesWithViewAccess" or "getSitesWithAtLeastViewAccess" (which returns both).  Some methods will affect all websites globally: "setGlobalExcludedIps" will set the list of IPs to be excluded on all websites, "setGlobalExcludedQueryParameters" will set the list of URL parameters to remove from URLs for all websites. The existing values can be fetched via "getExcludedIpsGlobal" and "getExcludedQueryParametersGlobal". See also the documentation about <a href=''https://matomo.org/docs/manage-websites/'' rel=''noreferrer'' target=''_blank''>Managing Websites</a> in Matomo.'
servers:
- url: https://demo-proxy.innocraft.cloud/
  description: Current Matomo instance
security:
- MatomoToken: []
tags:
- name: SitesManager
  description: 'The SitesManager API gives you full control on Websites in Matomo (create, update and delete), and many methods to retrieve websites based on various attributes.  This API lets you create websites via "addSite", update existing websites via "updateSite" and delete websites via "deleteSite". When creating websites, it can be useful to access internal codes used by Matomo for currencies via "getCurrencyList", or timezones via "getTimezonesList".  There are also many ways to request a list of websites: from the website ID via "getSiteFromId" or the site URL via "getSitesIdFromSiteUrl". Often, the most useful technique is to list all websites that are known to a current user, based on the token_auth, via "getSitesWithAdminAccess", "getSitesWithViewAccess" or "getSitesWithAtLeastViewAccess" (which returns both).  Some methods will affect all websites globally: "setGlobalExcludedIps" will set the list of IPs to be excluded on all websites, "setGlobalExcludedQueryParameters" will set the list of URL parameters to remove from URLs for all websites. The existing values can be fetched via "getExcludedIpsGlobal" and "getExcludedQueryParametersGlobal". See also the documentation about <a href=''https://matomo.org/docs/manage-websites/'' rel=''noreferrer'' target=''_blank''>Managing Websites</a> in Matomo.'
paths:
  /index.php?module=API&method=SitesManager.getJavascriptTag:
    get:
      tags:
      - SitesManager
      description: Returns the JavaScript tracking tag for the given website.
      operationId: SitesManager.getJavascriptTag
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: The numeric ID of the website to generate tracking code for.
        required: true
        schema:
          type: integer
          example: 1
      - name: piwikUrl
        in: query
        description: The domain and URL path to the Matomo installation. Defaults to the current Matomo URL.
        required: false
        schema:
          type: string
          default: ''
      - name: mergeSubdomains
        in: query
        description: Whether to track visitors across all subdomains of the site.
        required: false
        schema:
          type: boolean
          default: false
      - name: groupPageTitlesByDomain
        in: query
        description: Whether to prepend the site domain to the page title when tracking.
        required: false
        schema:
          type: boolean
          default: false
      - name: mergeAliasUrls
        in: query
        description: Whether to treat alias URLs as part of the same website for outlink detection.
        required: false
        schema:
          type: boolean
          default: false
      - name: visitorCustomVariables
        in: query
        description: Custom visitor-scope variables as `array(array('name', 'value'), ...)`.
        required: false
        schema:
          type: array
          items:
            type: string
          default: []
      - name: pageCustomVariables
        in: query
        description: Custom page-scope variables as `array(array('name', 'value'), ...)`.
        required: false
        schema:
          type: array
          items:
            type: string
          default: []
      - name: customCampaignNameQueryParam
        in: query
        description: Custom campaign name query parameter name, overriding the default.
        required: false
        schema:
          type: string
          default: ''
      - name: customCampaignKeywordParam
        in: query
        description: Custom campaign keyword query parameter name, overriding the default.
        required: false
        schema:
          type: string
          default: ''
      - name: doNotTrack
        in: query
        description: Whether to respect the browser's Do-Not-Track setting.
        required: false
        schema:
          type: boolean
          default: false
      - name: disableCookies
        in: query
        description: Whether to disable all first-party cookies.
        required: false
        schema:
          type: boolean
          default: false
      - name: trackNoScript
        in: query
        description: Whether to include a `<noscript>` image-based fallback for JavaScript-disabled browsers.
        required: false
        schema:
          type: boolean
          default: false
      - name: crossDomain
        in: query
        description: Whether to enable cross-domain linking.
        required: false
        schema:
          type: boolean
          default: false
      - name: forceMatomoEndpoint
        in: query
        description: Whether the Matomo endpoint should be forced if Matomo was installed prior to 3.7.0.
        required: false
        schema:
          type: boolean
          default: false
      - name: excludedQueryParams
        in: query
        description: Array or comma-separated string of query parameters to exclude from page URLs.
        required: false
        schema:
          oneOf:
          - type: string
            default: ''
          - type: array
            items:
              type: string
      - name: excludedReferrers
        in: query
        description: Array or comma-separated string of referrer hosts/URLs to ignore.
        required: false
        schema:
          oneOf:
          - type: string
            default: ''
          - type: array
            items:
              type: string
      - name: disableCampaignParameters
        in: query
        description: Whether to prevent campaign parameters from being sent to the tracker.
        required: false
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: 'The JavaScript tag ready to be included in HTML pages.


            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=SitesManager.getImageTrackingCode:
    get:
      tags:
      - SitesManager
      description: Returns image link tracking code for a given site with specified options.
      operationId: SitesManager.getImageTrackingCode
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: The ID to generate tracking code for.
        required: true
        schema:
          type: integer
          example: 1
      - name: piwikUrl
        in: query
        description: The domain and URL path to the Matomo installation.
        required: false
        schema:
          type: string
          default: ''
      - name: actionName
        in: query
        description: Action name to include in the image tracking request, or `false` to omit it.
        required: false
        schema:
          type: string
      - name: idGoal
        in: query
        description: Goal ID to trigger a conversion for, or `false` to omit goal tracking.
        required: false
        schema:
          oneOf:
          - type: integer
          - type: string
      - name: revenue
        in: query
        description: Revenue for the goal conversion. Only used when `$idGoal` is supplied.
        required: false
        schema:
          oneOf:
          - type: integer
          - type: number
          - type: string
      - name: forceMatomoEndpoint
        in: query
        description: Whether the Matomo endpoint should be forced if Matomo was installed prior to 3.7.0.
        required: false
        schema:
          type: boolean
          default: false
      responses:
        '200':
          description: 'The HTML-encoded image tracking code.


            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=SitesManager.getSitesFromGroup:
    get:
      tags:
      - SitesManager
      description: Returns all websites belonging to the specified group.
      operationId: SitesManager.getSitesFromGroup
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: group
        in: query
        description: Group name to filter by. An empty string returns websites without a group.
        required: false
        schema:
          type: string
          default: ''
      responses:
        '200':
          description: 'Websites belonging to the group.


            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=SitesManager.getSitesGroups:
    get:
      tags:
      - SitesManager
      description: Returns the list of website groups, including the empty group if no group was specified for some websites.
      operationId: SitesManager.getSitesGroups
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      responses:
        '200':
          description: 'Distinct group names.


            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=SitesManager.getSiteFromId:
    get:
      tags:
      - SitesManager
      description: 'Returns the website information for a single site: name, main_url, timezone, currency, etc.'
      operationId: SitesManager.getSiteFromId
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: The numeric ID of the website.
        required: true
        schema:
          type: integer
          example: 1
      responses:
        '200':
          description: 'Site data array.


            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=SitesManager.getSiteUrlsFromId:
    get:
      tags:
      - SitesManager
      description: Returns the list of all URLs registered for the given website (main_url + alias URLs).
      operationId: SitesManager.getSiteUrlsFromId
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: idSite
        in: query
        description: The numeric ID of the website.
        required: true
        schema:
          type: integer
          example: 1
      responses:
        '200':
          description: 'List of URLs, with the main URL first.


            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=SitesManager.getAllSites:
    get:
      tags:
      - SitesManager
      description: Returns all websites.
      operationId: SitesManager.getAllSites
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      responses:
        '200':
          description: 'The list of websites, indexed by idsite.


            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=SitesManager.getAllSitesId:
    get:
      tags:
      - SitesManager
      description: Returns the list of all the website IDs registered.
      operationId: SitesManager.getAllSitesId
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      responses:
        '200':
          description: 'The list of 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'
  /index.php?module=API&method=SitesManager.getSitesWithAdminAccess:
    get:
      tags:
      - SitesManager
      description: Returns the list of websites with the 'admin' access for the current user.
      operationId: SitesManager.getSitesWithAdminAccess
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: fetchAliasUrls
        in: query
        description: Whether to include alias URLs as an `alias_urls` key in each site entry.
        required: false
        schema:
          type: boolean
          default: false
      - name: pattern
        in: query
        description: Optional name/URL pattern to filter results by.
        required: false
        schema:
          type: string
      - name: limit
        in: query
        description: Maximum number of sites to return, or `false` for no limit.
        required: false
        schema:
          oneOf:
          - type: integer
          - type: string
      - name: sitesToExclude
        in: query
        description: Site IDs to exclude from the result.
        required: false
        schema:
          type: array
          items:
            type: integer
          default: []
      responses:
        '200':
          description: 'Websites the current user has admin access to.


            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=SitesManager.getSitesWithMinimumAccess:
    get:
      tags:
      - SitesManager
      description: Returns the list of websites where the current user has at least the provided access level.
      operationId: SitesManager.getSitesWithMinimumAccess
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: permission
        in: query
        description: One of `'view'`, `'write'` or `'admin'`.
        required: true
        schema:
          type: string
          example: view
      - name: pattern
        in: query
        description: Optional name/URL pattern to filter results by.
        required: false
        schema:
          type: string
      - name: limit
        in: query
        description: Maximum number of sites to return, or `null` for no limit.
        required: false
        schema:
          type: integer
      - name: sitesToExclude
        in: query
        description: Site IDs to exclude from the result.
        required: false
        schema:
          type: array
          items:
            type: integer
          default: []
      - name: siteTypesToExclude
        in: query
        description: Site types (e.g. `'website'`, `'mobileapp'`) to exclude from the result.
        required: false
        schema:
          type: array
          items:
            type: string
          default: []
      responses:
        '200':
          description: 'Websites matching the access level and filters.


            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=SitesManager.getSitesWithViewAccess:
    get:
      tags:
      - SitesManager
      description: Returns the list of websites with the 'view' access for the current user.
      operationId: SitesManager.getSitesWithViewAccess
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      responses:
        '200':
          description: 'Websites the current user has view-only access to.


            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=SitesManager.getSitesWithAtLeastViewAccess:
    get:
      tags:
      - SitesManager
      description: Returns the list of websites with the 'view' or 'admin' access for the current user.
      operationId: SitesManager.getSitesWithAtLeastViewAccess
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: limit
        in: query
        description: Maximum number of sites to return, or `false` for no limit.
        required: false
        schema:
          oneOf:
          - type: integer
          - type: string
      - name: _restrictSitesToLogin
        in: query
        description: 'Implementation detail for scheduled tasks where Superuser access is forced but sites should be restricted to a specific login. See #3017.'
        required: false
        schema:
          type: string
      responses:
        '200':
          description: 'Websites the current user has at least view access to.


            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=SitesManager.getSitesIdWithAdminAccess:
    get:
      tags:
      - SitesManager
      description: Returns the list of website IDs with the 'admin' access for the current user.
      operationId: SitesManager.getSitesIdWithAdminAccess
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      responses:
        '200':
          description: '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'
  /index.php?module=API&method=SitesManager.getSitesIdWithViewAccess:
    get:
      tags:
      - SitesManager
      description: Returns the list of website IDs with the 'view' access for the current user.
      operationId: SitesManager.getSitesIdWithViewAccess
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      responses:
        '200':
          description: 'Website IDs.


            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=SitesManager.getSitesIdWithWriteAccess:
    get:
      tags:
      - SitesManager
      description: Returns the list of website IDs with the 'write' access for the current user.
      operationId: SitesManager.getSitesIdWithWriteAccess
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      responses:
        '200':
          description: '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'
  /index.php?module=API&method=SitesManager.getSitesIdWithAtLeastViewAccess:
    get:
      tags:
      - SitesManager
      description: Returns the list of website IDs with the 'view' or 'admin' access for the current user.
      operationId: SitesManager.getSitesIdWithAtLeastViewAccess
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: _restrictSitesToLogin
        in: query
        description: Implementation detail for scheduled tasks where Superuser access is forced but sites should be restricted to a specific login.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: 'Website IDs.


            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=SitesManager.getSitesIdFromSiteUrl:
    get:
      tags:
      - SitesManager
      description: Returns the list of website IDs associated with a URL.
      operationId: SitesManager.getSitesIdFromSiteUrl
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: url
        in: query
        description: The URL to search for.
        required: true
        schema:
          type: string
          example: https://example.org/pricing
      responses:
        '200':
          description: 'Matching website IDs.


            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=SitesManager.addSite:
    get:
      tags:
      - SitesManager
      description: Add a website.
      operationId: SitesManager.addSite
      parameters:
      - $ref: '#/components/parameters/formatOptional'
      - name: siteName
        in: query
        description: Site name.
        required: true
        schema:
          type: string
          example: Example NZ Site
      - name: urls
        in: query
        description: The URLs array must contain at least one URL called the 'main_url'; if several URLs are provided in the array, they will be recorded as alias URLs for this website. When calling the API via HTTP specify multiple URLs via `&urls[]=http...&urls[]=http...`.
        required: false
        schema:
          oneOf:
          - type: array
            items:
              type: string
          - type: string
      - name: ecommerce
        in: query
        description: Whether Ecommerce Reporting is enabled (1) or disabled (0).
        required: false
        schema:
          oneOf:
          - type: integer
          - type: string
      - name: siteSearch
        in: query
        description: Whether Site Search is enabled (1) or disabled (0).
        required: false
        schema:
          oneOf:
          - type: integer
          - type: string
      - name: searchKeywordParameters
        in: query
        description: Comma-separated list of search keyword parameter names.
        required: false
        schema:
          type: string
      - name: searchCategoryParameters
        in: query
        description: Comma-separated list of search category parameter names.
        required: false
        schema:
          type: string
      - name: excludedIps
        in: query
        description: Comma-separated list of IPs to exclude from reports (allows wildcards).
        required: false
        schema:
          type: string
      - name: excludedQueryParameters
        in: query
        description: Comma-separated list of URL query parameters to strip from tracked URLs.
        required: false
        schema:
          type: string
      - name: timezone
        in: query
        description: Timezone string, e.g. `'Europe/London'`. Defaults to the global default timezone.
        required: false
        schema:
          type: string
      - name: currency
        in: query
        description: Currency code, e.g. `'EUR'`. Defaults to the global default currency.
        required: false
        schema:
          type: string
      - name: group
        in: query
        description: Website group identifier. Requires Superuser access.
        required: false
        schema:
          type: string
      - name: startDate
        in: query
        description: Date at which statistics for this website will start, in `YYYY-MM-DD` format. Defaults to today's date.
        required: false
        schema:
          type: string
      - name: excludedUserAgents
        in: query
        description: Comma-separated list of user agent substrings to exclude.
        required: false
        schema:
          type: string
      - name: keepURLFragments
        in: query
        description: If `1`, URL fragments will be kept when tracking. If `2`, they will be removed. If `0`, the default global behavior will be used.
        required: false
        schema:
          oneOf:
          - type: integer
          - type: string
      - name: type
        in: query
        description: The website type, defaults to `'website'` if not set.
        required: false
        schema:
          type: string
      - name: settingValues
        in: query
        description: Measurable settings keyed by plugin name, each containing an array of `['name' => string, 'value' => mixed]` pairs.
        required: false
        schema:
          type: string
      - name: excludeUnknownUrls
        in: query
        description: Whether to track only URLs matching one of the website's registered URLs.
        required: false
        schema:
          type: string
      - name: excludedReferrers
        in: query
        desc

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