---
title: Unsubscribe from an Existing Webhook
slug: api/unsubscribe-from-an-existing-webhook
docTags: 
createdAt: 2026-09-20T23:41:11.143Z
---

{
  "id": "StRUhkgbJTJ85aZqB5o-c",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://api.mpay.com.au/subscriptions/v1/delete/{id}",
    "servers": [
      {
        "url": "https://api.mpay.com.au/subscriptions/v1/delete/{id}",
        "description": "Production URL"
      },
      {
        "url": "https://api.m-pay.com.au/subscriptions/v1/delete/{id}",
        "description": "Sandbox URL"
      }
    ],
    "name": "Unsubscribe from an Existing Webhook",
    "description": "Permanently deletes a webhook.",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "example": "10241",
          "description": "<p><strong>Required.</strong> This is the Id of the Subscription you want to delete. Use the <code>id</code> returned by the create or list endpoints. Deletion is permanent and cannot be undone.</p>",
          "default": "10241",
          "pattern": "^[0-9]{1,10}$"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "basicAuth",
          "name": "basicAuth",
          "kind": "optional",
          "type": "http",
          "description": "<p>To authenticate using basic authentication, generate an API key and pass it as the username. No password is required.</p>",
          "scheme": "basic"
        }
      ],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Success. The subscription was deleted and its final details are returned.",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "subscriptionDeleteResponse_V1",
            "schema": [
              {
                "name": "id",
                "kind": "optional",
                "type": "integer",
                "description": "Unique id of the subscription that was deleted.",
                "example": 10241,
                "default": 10241,
                "pattern": "^[0-9]{1,10}$"
              },
              {
                "name": "dateTime",
                "kind": "optional",
                "type": "string",
                "description": "Date time the subscription was last updated.",
                "example": "2026-09-18T16:02:05.000",
                "default": "2026-09-18T16:02:05.000",
                "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?$"
              },
              {
                "name": "eventName",
                "kind": "optional",
                "type": "string",
                "description": "The type of event that was being sent to this URL via callback before the subscription was deleted.",
                "example": "NPPReceivePayment",
                "default": "NPPReceivePayment",
                "pattern": "^(DirectDebitClearance|DirectEntryDishonour|InboundDirectCredit|InboundDirectCreditRejections|InboundDirectDebit|InboundRtgsImtStatus|InternationalNPPReceivePayment|InternationalNppPaymentReturn|InternationalNppPaymentStatus|MTPTransactionNotification|NPPCreditRejections|NPPReceivePayment|NppPaymentStatus|NppReturn|PayToReceivePayment|PendingInboundRtgsImt)$"
              },
              {
                "name": "targetUrl",
                "kind": "optional",
                "type": "string<uri>",
                "description": "The API endpoint that callback notifications were being sent to before the subscription was deleted.",
                "example": "https://api.yourcompany.com/monoova/callbacks",
                "default": "https://api.yourcompany.com/monoova/callbacks",
                "format": "uri",
                "pattern": "^https?://[^\\s]+$"
              },
              {
                "name": "durationMs",
                "kind": "optional",
                "type": "integer",
                "description": "This value represents the total time in milliseconds that the Platform took to process the request.",
                "example": 88,
                "default": 88,
                "pattern": "^[0-9]{1,7}$"
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string",
                "description": "This is the status of the request. A code of 'Ok' indicates no errors.",
                "example": "Ok",
                "default": "Ok",
                "pattern": "^[A-Za-z]{2,30}$"
              },
              {
                "name": "statusDescription",
                "kind": "optional",
                "type": "string",
                "description": "<p>This is a description of the status. If an 'Ok' status is returned, then this will be 'Operation completed successfully'.</p>",
                "example": "Operation completed successfully",
                "default": "Operation completed successfully",
                "pattern": "^.{1,500}$"
              }
            ],
            "modelRef": "#/components/schemas/subscriptionDeleteResponse_V1",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "<p>Bad request. The request could not be processed because one or more fields are missing, malformed, or failed validation. Check the <code>statusDescription</code> for the field at fault, correct it and retry.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"durationMs\":12,\"status\":\"Error\",\"statusDescription\":\"Validation failed: targetUrl is required and must be a valid URL.\"}",
            "description": "<p>Standard error envelope returned for 400, 401 and 500 responses.</p>",
            "customType": "errorResponse",
            "schema": [
              {
                "name": "durationMs",
                "kind": "optional",
                "type": "integer",
                "description": "This value represents the total time in milliseconds that the Platform took to process the request.",
                "example": 12,
                "default": 12,
                "pattern": "^[0-9]{1,7}$"
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string",
                "description": "<p>This is the status of the request. A code of 'Ok' indicates no errors. For an error response this will be a failure code such as 'Error', 'Unauthorized' or 'Exception'.</p>",
                "example": "Error",
                "default": "Error",
                "pattern": "^[A-Za-z]{2,30}$"
              },
              {
                "name": "statusDescription",
                "kind": "optional",
                "type": "string",
                "description": "<p>This is a description of the status. For an error response this explains what failed and, where possible, names the field at fault.</p>",
                "example": "Validation failed: targetUrl is required and must be a valid URL.",
                "default": "Validation failed: targetUrl is required and must be a valid URL.",
                "pattern": "^.{1,500}$"
              }
            ],
            "modelRef": "#/components/schemas/errorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "401",
        "description": "<p>Unauthorized. The request did not include valid basic authentication credentials, or the API key supplied is inactive or not permitted to use this endpoint. Confirm the API key is passed as the basic authentication username and retry.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"durationMs\":4,\"status\":\"Unauthorized\",\"statusDescription\":\"Authentication failed. Check the API key supplied as the username.\"}",
            "description": "<p>Standard error envelope returned for 400, 401 and 500 responses.</p>",
            "customType": "errorResponse",
            "schema": [
              {
                "name": "durationMs",
                "kind": "optional",
                "type": "integer",
                "description": "This value represents the total time in milliseconds that the Platform took to process the request.",
                "example": 12,
                "default": 12,
                "pattern": "^[0-9]{1,7}$"
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string",
                "description": "<p>This is the status of the request. A code of 'Ok' indicates no errors. For an error response this will be a failure code such as 'Error', 'Unauthorized' or 'Exception'.</p>",
                "example": "Error",
                "default": "Error",
                "pattern": "^[A-Za-z]{2,30}$"
              },
              {
                "name": "statusDescription",
                "kind": "optional",
                "type": "string",
                "description": "<p>This is a description of the status. For an error response this explains what failed and, where possible, names the field at fault.</p>",
                "example": "Validation failed: targetUrl is required and must be a valid URL.",
                "default": "Validation failed: targetUrl is required and must be a valid URL.",
                "pattern": "^.{1,500}$"
              }
            ],
            "modelRef": "#/components/schemas/errorResponse",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "500",
        "description": "<p>Internal server error. An unexpected error occurred while processing the request. The request may not have been completed — do not assume the subscription changed. Retry the request and, if the error persists, contact Monoova support quoting the <code>statusDescription</code>.</p>",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "example": "{\"durationMs\":5312,\"status\":\"Exception\",\"statusDescription\":\"An unexpected error occurred while processing the request. Please contact Monoova support.\"}",
            "description": "<p>Standard error envelope returned for 400, 401 and 500 responses.</p>",
            "customType": "errorResponse",
            "schema": [
              {
                "name": "durationMs",
                "kind": "optional",
                "type": "integer",
                "description": "This value represents the total time in milliseconds that the Platform took to process the request.",
                "example": 12,
                "default": 12,
                "pattern": "^[0-9]{1,7}$"
              },
              {
                "name": "status",
                "kind": "optional",
                "type": "string",
                "description": "<p>This is the status of the request. A code of 'Ok' indicates no errors. For an error response this will be a failure code such as 'Error', 'Unauthorized' or 'Exception'.</p>",
                "example": "Error",
                "default": "Error",
                "pattern": "^[A-Za-z]{2,30}$"
              },
              {
                "name": "statusDescription",
                "kind": "optional",
                "type": "string",
                "description": "<p>This is a description of the status. For an error response this explains what failed and, where possible, names the field at fault.</p>",
                "example": "Validation failed: targetUrl is required and must be a valid URL.",
                "default": "Validation failed: targetUrl is required and must be a valid URL.",
                "pattern": "^.{1,500}$"
              }
            ],
            "modelRef": "#/components/schemas/errorResponse",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "GoPob0Cz1uc0rIvBtGJrs",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url https://api.mpay.com.au/subscriptions/v1/delete/{id} \\\n     --header 'accept: application/json'"
        },
        {
          "id": "Cx37G0ItXzxHliKb2wYmu",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar requestOptions = {\n   method: 'DELETE',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.mpay.com.au/subscriptions/v1/delete/{id}\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "fqH5MkDvNVTLC5W-1WEKk",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.mpay.com.au/subscriptions/v1/delete/{id}\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Delete.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "uNRFuec5AwDp0Zd6Sl_Wy",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.mpay.com.au/subscriptions/v1/delete/{id}\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "GoPob0Cz1uc0rIvBtGJrs"
    },
    "results": {
      "languages": [
        {
          "id": "Gb8_CssRN3d7ZJrmpHxhY",
          "language": "200",
          "code": "// Success. The subscription was deleted and its final details are returned.\n{\n  \"id\": 10241,\n  \"dateTime\": \"2026-09-18T16:02:05.000\",\n  \"eventName\": \"NPPReceivePayment\",\n  \"targetUrl\": \"https://api.yourcompany.com/monoova/callbacks\",\n  \"durationMs\": 88,\n  \"status\": \"Ok\",\n  \"statusDescription\": \"Operation completed successfully\"\n}"
        },
        {
          "id": "HomViy0C_4IjYDi4w8rsw",
          "language": "400",
          "code": "// Bad request. The request could not be processed because one or more fields are missing, malformed, or failed validation. Check the statusDescription for the field at fault, correct it and retry.\n{\n  \"durationMs\": 12,\n  \"status\": \"Error\",\n  \"statusDescription\": \"Validation failed: targetUrl is required and must be a valid URL.\"\n}"
        },
        {
          "id": "U0geq2GSJ6LD8gFMjXqOg",
          "language": "401",
          "code": "// Unauthorized. The request did not include valid basic authentication credentials, or the API key supplied is inactive or not permitted to use this endpoint. Confirm the API key is passed as the basic authentication username and retry.\n{\n  \"durationMs\": 12,\n  \"status\": \"Error\",\n  \"statusDescription\": \"Validation failed: targetUrl is required and must be a valid URL.\"\n}"
        },
        {
          "id": "bnjmrUcu2NApJjo3Xks5X",
          "language": "500",
          "code": "// Internal server error. An unexpected error occurred while processing the request. The request may not have been completed — do not assume the subscription changed. Retry the request and, if the error persists, contact Monoova support quoting the statusDescription.\n{\n  \"durationMs\": 12,\n  \"status\": \"Error\",\n  \"statusDescription\": \"Validation failed: targetUrl is required and must be a valid URL.\"\n}"
        }
      ],
      "selectedLanguageId": "Gb8_CssRN3d7ZJrmpHxhY"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}