---
title: Delete a notification by id
slug: reference/delete-a-notification-by-id
docTags: 
createdAt: 2024-09-30T17:03:00.667Z
---

{
  "id": "1_I5thasIQQJyo5b-q06i",
  "type": "api-oas-v2",
  "data": {
    "method": "DELETE",
    "url": "https://app.amberflo.io/customer-portal/notification/{notification_id}",
    "servers": [
      {
        "url": "https://app.amberflo.io/customer-portal/notification/{notification_id}"
      }
    ],
    "name": "Delete a notification by id",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "notification_id",
          "type": "string",
          "description": ""
        }
      ],
      "headerParameters": [],
      "queryParameters": [
        {
          "kind": "required",
          "name": "sessionToken",
          "type": "string",
          "description": "<p>A required session token used to authenticate API calls made on behalf of a customer. This token is obtained from the <code>Create a session</code> endpoint and must be included with every request to authorize access.</p>"
        }
      ],
      "bodyDataParameters": [],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "api_key",
          "name": "x-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Successful response",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "",
            "customType": "notification-response",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier of the webhook subscription.",
                "example": ""
              },
              {
                "name": "name",
                "kind": "required",
                "type": "string",
                "description": "Name of the notification. This must be unique.",
                "example": "",
                "default": "Too many api calls"
              },
              {
                "name": "description",
                "kind": "optional",
                "type": "string",
                "description": "Description displayed on the UI.",
                "example": "",
                "default": "Alert on too many api calls"
              },
              {
                "name": "notificationType",
                "kind": "optional",
                "type": "string<usage | invoice | prepaid | product-item-units | product-item-price | undefined-meter | undefined-customer>",
                "example": "",
                "default": "usage"
              },
              {
                "name": "meterId",
                "kind": "optional",
                "type": "string",
                "description": "Id of a meter, as defined in [Meters API](ref:get_meters).\n",
                "example": "",
                "default": "24ad0b40-a217-11eb-b01a-19ff91d9370d"
              },
              {
                "name": "cron",
                "kind": "optional",
                "type": "string",
                "description": "Cron expression for the schedule. For details see [crontab.guru](https://crontab.guru/examples.html).\n\nThis determines when (or how frequently) the conditions for the notification are checked.\n",
                "example": ""
              },
              {
                "name": "frequency",
                "kind": "optional",
                "type": "string",
                "description": "Maximum frequency with which to send the notifications.\n\nPossible values are, i.e. the notification will be sent:\n- `always`: every time the condition is met\n- `once`: at most one time for a given customer;\n- `once-per-billing-period`: at most one *per billing period* of the customer;\n- `every #h`, where `#` is a number: at most every `#` hours.\n\nDefaults to `always` for the `usage` notification type, `every 1h` for all others.\n\nNote that `once-per-billing-period` cannot be used with notification types: `usage`, `undefined-meter` and `undefined-customer`.\n",
                "example": "",
                "default": "every 1h"
              },
              {
                "name": "webhookUrl",
                "kind": "optional",
                "type": "string",
                "description": "Webhook url endpoint. Make a POST HTTP request to this url.",
                "example": "",
                "default": "https://hooks.slack.com/services/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"
              },
              {
                "name": "webhookHeaders",
                "kind": "optional",
                "type": "string",
                "description": "Stringified JSON for headers with keywords. See \"keywords\" in the guide.",
                "example": ""
              },
              {
                "name": "webhookPayload",
                "kind": "optional",
                "type": "string",
                "description": "Stringified JSON with keywords. See \"keywords\" in the guide.",
                "example": ""
              },
              {
                "name": "email",
                "kind": "optional",
                "type": "array",
                "description": "Email addresses to send the notifications to.",
                "example": "",
                "default": [
                  "alert@mycompany.io"
                ],
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "customSubject",
                "kind": "optional",
                "type": "string",
                "description": "Set this if you want to customize the alert email subject. The email subject will then have the following format:\n```\n{customSubject} - {customerName}\n```\n",
                "example": ""
              },
              {
                "name": "thresholdCondition",
                "kind": "optional",
                "type": "string<less-than | greater-than | equals | percent-change | always-true | less-than-percent | greater-than-percent>",
                "example": "",
                "default": "greater-than"
              },
              {
                "name": "thresholdValue",
                "kind": "optional",
                "type": "number",
                "description": "Threshold value for the condition",
                "example": "",
                "default": 1000
              },
              {
                "name": "range",
                "kind": "optional",
                "type": "string<hour | day | week | month>",
                "description": "Aggregation bucket",
                "example": "",
                "default": "day"
              },
              {
                "name": "productPlanId",
                "kind": "optional",
                "type": "string",
                "description": "`productPlanId` as defined in the [Product Plan API](ref:get_payments-pricing-amberflo-account-pricing-product-plans-list).",
                "example": ""
              },
              {
                "name": "enabled",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether the notification is enabled or not.",
                "example": "",
                "default": true
              },
              {
                "name": "createTime",
                "kind": "optional",
                "type": "integer",
                "description": "Creation time in milliseconds since [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time).",
                "example": 0
              },
              {
                "name": "updateTime",
                "kind": "optional",
                "type": "integer",
                "description": "Last update time in milliseconds since [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time).",
                "example": 0
              }
            ],
            "modelRef": "#/components/schemas/notification-response",
            "complexItems": [
              {
                "name": "object",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Unique identifier of the webhook subscription.",
                    "example": ""
                  },
                  {
                    "name": "name",
                    "kind": "required",
                    "type": "string",
                    "description": "Name of the notification. This must be unique.",
                    "example": "",
                    "default": "Too many api calls"
                  },
                  {
                    "name": "description",
                    "kind": "optional",
                    "type": "string",
                    "description": "Description displayed on the UI.",
                    "example": "",
                    "default": "Alert on too many api calls"
                  },
                  {
                    "name": "notificationType",
                    "kind": "optional",
                    "type": "string<usage | invoice | prepaid | product-item-units | product-item-price | undefined-meter | undefined-customer>",
                    "example": "",
                    "default": "usage"
                  },
                  {
                    "name": "meterId",
                    "kind": "optional",
                    "type": "string",
                    "description": "Id of a meter, as defined in [Meters API](ref:get_meters).\n",
                    "example": "",
                    "default": "24ad0b40-a217-11eb-b01a-19ff91d9370d"
                  },
                  {
                    "name": "cron",
                    "kind": "optional",
                    "type": "string",
                    "description": "Cron expression for the schedule. For details see [crontab.guru](https://crontab.guru/examples.html).\n\nThis determines when (or how frequently) the conditions for the notification are checked.\n",
                    "example": ""
                  },
                  {
                    "name": "frequency",
                    "kind": "optional",
                    "type": "string",
                    "description": "Maximum frequency with which to send the notifications.\n\nPossible values are, i.e. the notification will be sent:\n- `always`: every time the condition is met\n- `once`: at most one time for a given customer;\n- `once-per-billing-period`: at most one *per billing period* of the customer;\n- `every #h`, where `#` is a number: at most every `#` hours.\n\nDefaults to `always` for the `usage` notification type, `every 1h` for all others.\n\nNote that `once-per-billing-period` cannot be used with notification types: `usage`, `undefined-meter` and `undefined-customer`.\n",
                    "example": "",
                    "default": "every 1h"
                  },
                  {
                    "name": "webhookUrl",
                    "kind": "optional",
                    "type": "string",
                    "description": "Webhook url endpoint. Make a POST HTTP request to this url.",
                    "example": "",
                    "default": "https://hooks.slack.com/services/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"
                  },
                  {
                    "name": "webhookHeaders",
                    "kind": "optional",
                    "type": "string",
                    "description": "Stringified JSON for headers with keywords. See \"keywords\" in the guide.",
                    "example": ""
                  },
                  {
                    "name": "webhookPayload",
                    "kind": "optional",
                    "type": "string",
                    "description": "Stringified JSON with keywords. See \"keywords\" in the guide.",
                    "example": ""
                  },
                  {
                    "name": "email",
                    "kind": "optional",
                    "type": "array",
                    "description": "Email addresses to send the notifications to.",
                    "example": "",
                    "default": [
                      "alert@mycompany.io"
                    ],
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "customSubject",
                    "kind": "optional",
                    "type": "string",
                    "description": "Set this if you want to customize the alert email subject. The email subject will then have the following format:\n```\n{customSubject} - {customerName}\n```\n",
                    "example": ""
                  },
                  {
                    "name": "thresholdCondition",
                    "kind": "optional",
                    "type": "string<less-than | greater-than | equals | percent-change | always-true | less-than-percent | greater-than-percent>",
                    "example": "",
                    "default": "greater-than"
                  },
                  {
                    "name": "thresholdValue",
                    "kind": "optional",
                    "type": "number",
                    "description": "Threshold value for the condition",
                    "example": "",
                    "default": 1000
                  },
                  {
                    "name": "range",
                    "kind": "optional",
                    "type": "string<hour | day | week | month>",
                    "description": "Aggregation bucket",
                    "example": "",
                    "default": "day"
                  },
                  {
                    "name": "productPlanId",
                    "kind": "optional",
                    "type": "string",
                    "description": "`productPlanId` as defined in the [Product Plan API](ref:get_payments-pricing-amberflo-account-pricing-product-plans-list).",
                    "example": ""
                  },
                  {
                    "name": "enabled",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "Whether the notification is enabled or not.",
                    "example": "",
                    "default": true
                  }
                ],
                "modelRef": "#/components/schemas/notification-put-request",
                "customType": "notification-put-request"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "createTime",
                    "kind": "optional",
                    "type": "integer",
                    "description": "Creation time in milliseconds since [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time).",
                    "example": 0
                  },
                  {
                    "name": "updateTime",
                    "kind": "optional",
                    "type": "integer",
                    "description": "Last update time in milliseconds since [UNIX epoch](https://en.wikipedia.org/wiki/Unix_time).",
                    "example": 0
                  }
                ]
              }
            ],
            "complexType": "allOf",
            "isExpanded": true
          }
        ]
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "-vPh9_I7XU-_BDzaIrdDR",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request DELETE \\\n     --url 'https://app.amberflo.io/customer-portal/notification/{notification_id}?sessionToken=string' \\\n     --header 'accept: application/json'"
        },
        {
          "id": "VPL5sjRq9FNkPGne3mVXm",
          "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://app.amberflo.io/customer-portal/notification/{notification_id}?sessionToken=string\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "lPa_FxM5ARciyfzqiNkjP",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/customer-portal/notification/{notification_id}?sessionToken=string\")\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": "qaqlPIhw7B1L69gTX8GI3",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/customer-portal/notification/{notification_id}?sessionToken=string\"\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": "-vPh9_I7XU-_BDzaIrdDR"
    },
    "results": {
      "languages": [
        {
          "id": "l7gA2iiueOybtk0OODgZp",
          "language": "200",
          "code": "// Successful response\n{\n  \"id\": \"\",\n  \"name\": \"\",\n  \"description\": \"\",\n  \"notificationType\": \"\",\n  \"meterId\": \"\",\n  \"cron\": \"\",\n  \"frequency\": \"\",\n  \"webhookUrl\": \"\",\n  \"webhookHeaders\": \"\",\n  \"webhookPayload\": \"\",\n  \"email\": [\n    \"\"\n  ],\n  \"customSubject\": \"\",\n  \"thresholdCondition\": \"\",\n  \"thresholdValue\": 0,\n  \"range\": \"\",\n  \"productPlanId\": \"\",\n  \"enabled\": false,\n  \"createTime\": 0,\n  \"updateTime\": 0\n}"
        }
      ],
      "selectedLanguageId": "l7gA2iiueOybtk0OODgZp"
    }
  },
  "children": [
    {
      "text": "",
      "id": "eqysdOtHX_gZ0mcCHqKlJ"
    }
  ]
}