openapi: 3.2.0 info: title: Matomo Reporting API for plugin Mobile Messaging API version: 1.0.0 description: The MobileMessaging API lets you manage SMS credentials, phone number verification, and SMS account settings. servers: - url: https://demo-proxy.innocraft.cloud/ description: Current Matomo instance security: - MatomoToken: [] tags: - name: MobileMessaging description: The MobileMessaging API lets you manage SMS credentials, phone number verification, and SMS account settings. paths: /index.php?module=API&method=MobileMessaging.areSMSAPICredentialProvided: get: tags: - MobileMessaging description: Checks whether SMS API credentials are configured for the current user. operationId: MobileMessaging.areSMSAPICredentialProvided parameters: - $ref: '#/components/parameters/formatOptional' responses: '200': description: '`true` if SMS API credentials are available for the current user. 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=MobileMessaging.getSMSProvider: get: tags: - MobileMessaging description: Returns the configured SMS provider for the current user. operationId: MobileMessaging.getSMSProvider parameters: - $ref: '#/components/parameters/formatOptional' responses: '200': description: 'The configured SMS provider identifier, or `null` if none is configured. 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=MobileMessaging.setSMSAPICredential: get: tags: - MobileMessaging description: Stores the SMS API credentials for the selected provider. operationId: MobileMessaging.setSMSAPICredential parameters: - $ref: '#/components/parameters/formatOptional' - name: provider in: query description: SMS provider identifier to configure. required: true schema: type: string example: google - name: credentials in: query description: Provider credentials such as an API key or username. required: false schema: type: array items: [] default: [] 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=MobileMessaging.addPhoneNumber: get: tags: - MobileMessaging description: Adds a phone number for the current user and sends a verification code to it. operationId: MobileMessaging.addPhoneNumber parameters: - $ref: '#/components/parameters/formatOptional' - name: phoneNumber in: query description: Phone number in international format. required: true schema: type: string example: '+64211234567' 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=MobileMessaging.resendVerificationCode: get: tags: - MobileMessaging description: Requests a new verification code for a pending phone number. operationId: MobileMessaging.resendVerificationCode parameters: - $ref: '#/components/parameters/formatOptional' - name: phoneNumber in: query description: Phone number in international format. required: true schema: type: string example: '+64211234567' 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=MobileMessaging.getCreditLeft: get: tags: - MobileMessaging description: Returns the remaining SMS credit for the configured provider account. operationId: MobileMessaging.getCreditLeft parameters: - $ref: '#/components/parameters/formatOptional' responses: '200': description: 'Remaining SMS credit reported by the configured provider. 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=MobileMessaging.getPhoneNumbers: get: tags: - MobileMessaging description: Returns the phone numbers configured for the current user. operationId: MobileMessaging.getPhoneNumbers parameters: - $ref: '#/components/parameters/formatOptional' responses: '200': description: 'Phone numbers keyed by phone number, including verification metadata. 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=MobileMessaging.removePhoneNumber: get: tags: - MobileMessaging description: Removes a phone number from the current user account. operationId: MobileMessaging.removePhoneNumber parameters: - $ref: '#/components/parameters/formatOptional' - name: phoneNumber in: query description: Phone number in international format. required: true schema: type: string example: '+64211234567' 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=MobileMessaging.validatePhoneNumber: get: tags: - MobileMessaging description: Verifies a phone number using the submitted verification code. operationId: MobileMessaging.validatePhoneNumber parameters: - $ref: '#/components/parameters/formatOptional' - name: phoneNumber in: query description: Phone number in international format. required: true schema: type: string example: '+64211234567' - name: verificationCode in: query description: Verification code received by SMS. required: true schema: type: string example: '123456' responses: '200': description: '`true` if the phone number was verified successfully, `false` otherwise. 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=MobileMessaging.deleteSMSAPICredential: get: tags: - MobileMessaging description: Deletes the configured SMS API credentials. operationId: MobileMessaging.deleteSMSAPICredential parameters: - $ref: '#/components/parameters/formatOptional' 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=MobileMessaging.setDelegatedManagement: get: tags: - MobileMessaging description: Configures whether regular users can manage their own SMS API credentials. operationId: MobileMessaging.setDelegatedManagement parameters: - $ref: '#/components/parameters/formatOptional' - name: delegatedManagement in: query description: '`true` to allow regular users to manage their own credentials, `false` to restrict management to super users.' required: true schema: type: boolean example: true 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=MobileMessaging.getDelegatedManagement: get: tags: - MobileMessaging description: Returns whether regular users can manage their own SMS API credentials. operationId: MobileMessaging.getDelegatedManagement parameters: - $ref: '#/components/parameters/formatOptional' responses: '200': description: '`true` if regular users can manage their own credentials, `false` if only super users can. 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: 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/