---
title: Create webhook subscription
slug: reference/create-webhook-subscription
docTags: 
createdAt: 2025-08-13T21:16:12.609Z
---

{
  "id": "cBnpBo3HnxAdfIICW_mlU",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "https://app.amberflo.io/webhook",
    "servers": [
      {
        "url": "https://app.amberflo.io/webhook"
      }
    ],
    "name": "Create webhook subscription",
    "description": "<p>Creates a webhook subscription to receive HTTP POST requests when events occur on your Amberflo account.\nUse this endpoint to set up real-time event notifications for billing events, usage updates, and other account activities.</p>\n<p>The webhook payload format is:</p>\n<pre><code class=\"language-json\">{\n  \"topic\": &#x3C;topic name>,\n  \"eventTime\": &#x3C;when the event happened, in milliseconds since UNIX epoch>,\n  \"eventId\": &#x3C;unique-per-topic event id>,\n  \"data\": &#x3C;data pertaining to the specific event>\n}\n</code></pre>\n<p><strong>Key behaviors:</strong></p>\n<ul>\n<li>Only one subscription per topic is allowed</li>\n<li>The system makes a limited number of delivery attempts with exponential backoff</li>\n<li>Your endpoint should be idempotent as it may receive duplicate requests</li>\n<li>All delivery attempts are logged in the <a>Account Event API</a></li>\n</ul>\n<p>To test your webhook setup, see the <a>test endpoint</a>.</p>",
    "contentType": "application/json",
    "request": {
      "pathParameters": [],
      "headerParameters": [],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "optional",
          "name": "body",
          "type": "object",
          "description": "Request body for creating a new webhook endpoint subscription",
          "customType": "webhook-post-request",
          "schema": [
            {
              "name": "enabled",
              "kind": "optional",
              "type": "boolean",
              "description": "Whether the webhook endpoint is active and receives event notifications. You can still retry and test disabled webhooks.",
              "example": "",
              "default": true
            },
            {
              "name": "topic",
              "kind": "required",
              "type": "string<ready-product-invoices | customer-feed | account-pricing-feed | customer-pricing-feed | customer-pricing-plan-feed | webhook-test>",
              "description": "Event type that triggers webhook notifications. Supported events:\n\n- `ready-product-invoices` - Invoice is ready for payment\n- `customer-feed` - Customer is created  \n- `account-pricing-feed` - Account pricing configuration changes (e.g. pricing plans)\n- `customer-pricing-feed` - Customer pricing assignment changes\n- `customer-pricing-plan-feed` - Customer pricing plan modifications or deletions\n- `payment-feed` - Invoice payment succeeds or fails\n- `webhook-test` - Testing webhook functionality\n",
              "example": ""
            },
            {
              "name": "destinationUrl",
              "kind": "required",
              "type": "string",
              "description": "HTTPS URL endpoint where webhook event payloads will be sent via POST request",
              "example": ""
            },
            {
              "name": "transformTemplate",
              "kind": "required",
              "type": "string<default | amberflo-sfdc-app>",
              "description": "Payload transformation template for third-party integrations (e.g. Salesforce via amberflo-sfdc-app)",
              "example": ""
            },
            {
              "name": "authHeader",
              "kind": "required",
              "type": "array",
              "description": "Authentication header key-value pair for webhook requests. Values are encrypted before storage and redacted in API responses.",
              "example": "",
              "itemType": "string",
              "customType": "string[]",
              "itemExample": "",
              "itemDefault": ""
            },
            {
              "name": "extraHeaders",
              "kind": "optional",
              "type": "array",
              "description": "Additional HTTP headers to include with webhook requests (maximum 10 headers)",
              "example": "",
              "itemType": "array",
              "customType": "array[]",
              "itemExample": "",
              "itemDefault": ""
            }
          ],
          "modelRef": "#/components/schemas/webhook-post-request",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [
        {
          "id": "api_key",
          "name": "x-api-key",
          "kind": "optional",
          "type": "apiKey",
          "in": "header"
        }
      ]
    },
    "responses": [
      {
        "statusCode": "200",
        "description": "Webhook subscription successfully created with assigned ID and configuration details",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Complete webhook endpoint configuration including system timestamps",
            "customType": "webhook-response",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier of the webhook endpoint to be updated",
                "example": ""
              },
              {
                "name": "enabled",
                "kind": "optional",
                "type": "boolean",
                "description": "Whether the webhook endpoint is active and receives event notifications. You can still retry and test disabled webhooks.",
                "example": "",
                "default": true
              },
              {
                "name": "topic",
                "kind": "required",
                "type": "string<ready-product-invoices | customer-feed | account-pricing-feed | customer-pricing-feed | customer-pricing-plan-feed | webhook-test>",
                "description": "Event type that triggers webhook notifications. Supported events:\n\n- `ready-product-invoices` - Invoice is ready for payment\n- `customer-feed` - Customer is created  \n- `account-pricing-feed` - Account pricing configuration changes (e.g. pricing plans)\n- `customer-pricing-feed` - Customer pricing assignment changes\n- `customer-pricing-plan-feed` - Customer pricing plan modifications or deletions\n- `payment-feed` - Invoice payment succeeds or fails\n- `webhook-test` - Testing webhook functionality\n",
                "example": ""
              },
              {
                "name": "destinationUrl",
                "kind": "required",
                "type": "string",
                "description": "HTTPS URL endpoint where webhook event payloads will be sent via POST request",
                "example": ""
              },
              {
                "name": "transformTemplate",
                "kind": "required",
                "type": "string<default | amberflo-sfdc-app>",
                "description": "Payload transformation template for third-party integrations (e.g. Salesforce via amberflo-sfdc-app)",
                "example": ""
              },
              {
                "name": "authHeader",
                "kind": "required",
                "type": "array",
                "description": "Authentication header key-value pair for webhook requests. Values are encrypted before storage and redacted in API responses.",
                "example": "",
                "itemType": "string",
                "customType": "string[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "extraHeaders",
                "kind": "optional",
                "type": "array",
                "description": "Additional HTTP headers to include with webhook requests (maximum 10 headers)",
                "example": "",
                "itemType": "array",
                "customType": "array[]",
                "itemExample": "",
                "itemDefault": ""
              },
              {
                "name": "createTime",
                "kind": "optional",
                "type": "integer",
                "description": "Unix timestamp in milliseconds when the webhook endpoint was created",
                "example": 0
              },
              {
                "name": "updateTime",
                "kind": "optional",
                "type": "integer",
                "description": "Unix timestamp in milliseconds when the webhook endpoint was last modified",
                "example": 0
              }
            ],
            "modelRef": "#/components/schemas/webhook-response",
            "complexItems": [
              {
                "name": "object",
                "schema": [
                  {
                    "name": "id",
                    "kind": "required",
                    "type": "string",
                    "description": "Unique identifier of the webhook endpoint to be updated",
                    "example": ""
                  },
                  {
                    "name": "enabled",
                    "kind": "optional",
                    "type": "boolean",
                    "description": "Whether the webhook endpoint is active and receives event notifications. You can still retry and test disabled webhooks.",
                    "example": "",
                    "default": true
                  },
                  {
                    "name": "topic",
                    "kind": "required",
                    "type": "string<ready-product-invoices | customer-feed | account-pricing-feed | customer-pricing-feed | customer-pricing-plan-feed | webhook-test>",
                    "description": "Event type that triggers webhook notifications. Supported events:\n\n- `ready-product-invoices` - Invoice is ready for payment\n- `customer-feed` - Customer is created  \n- `account-pricing-feed` - Account pricing configuration changes (e.g. pricing plans)\n- `customer-pricing-feed` - Customer pricing assignment changes\n- `customer-pricing-plan-feed` - Customer pricing plan modifications or deletions\n- `payment-feed` - Invoice payment succeeds or fails\n- `webhook-test` - Testing webhook functionality\n",
                    "example": ""
                  },
                  {
                    "name": "destinationUrl",
                    "kind": "required",
                    "type": "string",
                    "description": "HTTPS URL endpoint where webhook event payloads will be sent via POST request",
                    "example": ""
                  },
                  {
                    "name": "transformTemplate",
                    "kind": "required",
                    "type": "string<default | amberflo-sfdc-app>",
                    "description": "Payload transformation template for third-party integrations (e.g. Salesforce via amberflo-sfdc-app)",
                    "example": ""
                  },
                  {
                    "name": "authHeader",
                    "kind": "required",
                    "type": "array",
                    "description": "Authentication header key-value pair for webhook requests. Values are encrypted before storage and redacted in API responses.",
                    "example": "",
                    "itemType": "string",
                    "customType": "string[]",
                    "itemExample": "",
                    "itemDefault": ""
                  },
                  {
                    "name": "extraHeaders",
                    "kind": "optional",
                    "type": "array",
                    "description": "Additional HTTP headers to include with webhook requests (maximum 10 headers)",
                    "example": "",
                    "itemType": "array",
                    "customType": "array[]",
                    "itemExample": "",
                    "itemDefault": ""
                  }
                ],
                "modelRef": "#/components/schemas/webhook-put-request",
                "customType": "webhook-put-request"
              },
              {
                "name": "object",
                "schema": [
                  {
                    "name": "createTime",
                    "kind": "optional",
                    "type": "integer",
                    "description": "Unix timestamp in milliseconds when the webhook endpoint was created",
                    "example": 0
                  },
                  {
                    "name": "updateTime",
                    "kind": "optional",
                    "type": "integer",
                    "description": "Unix timestamp in milliseconds when the webhook endpoint was last modified",
                    "example": 0
                  }
                ]
              }
            ],
            "complexType": "allOf",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Invalid request parameters or malformed request body",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "Missing or invalid API key authentication",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "403",
        "description": "Insufficient permissions to access this resource",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "500",
        "description": "Internal server error occurred while processing request",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "J_nFmBiuzu9tZeBfWJyGE",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://app.amberflo.io/webhook \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --data '{\n     \"enabled\": true,\n     \"topic\": \"\",\n     \"destinationUrl\": \"\",\n     \"transformTemplate\": \"\",\n     \"authHeader\": []\n     }'"
        },
        {
          "id": "vfM0vAY5n66ma6e2a2hh3",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"enabled\": true,\n   \"topic\": \"\",\n   \"destinationUrl\": \"\",\n   \"transformTemplate\": \"\",\n   \"authHeader\": []\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"https://app.amberflo.io/webhook\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "5NEpihoN6d75y9RTGsFvl",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://app.amberflo.io/webhook\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"enabled\": true,\n   \"topic\": \"\",\n   \"destinationUrl\": \"\",\n   \"transformTemplate\": \"\",\n   \"authHeader\": []\n})\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "OPH6J_MMCGDkFRDX4QqOf",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://app.amberflo.io/webhook\"\n\npayload = json.dumps({\n   \"enabled\": True,\n   \"topic\": \"\",\n   \"destinationUrl\": \"\",\n   \"transformTemplate\": \"\",\n   \"authHeader\": []\n})\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "J_nFmBiuzu9tZeBfWJyGE"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-200",
          "language": "200",
          "code": "// Webhook subscription successfully created with assigned ID and configuration details\n{\n  \"id\": \"\",\n  \"enabled\": false,\n  \"topic\": \"\",\n  \"destinationUrl\": \"\",\n  \"transformTemplate\": \"\",\n  \"authHeader\": [\n    \"\"\n  ],\n  \"extraHeaders\": [\n    [\n      \"\"\n    ]\n  ],\n  \"createTime\": 0,\n  \"updateTime\": 0\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Invalid request parameters or malformed request body\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Missing or invalid API key authentication\n"
        },
        {
          "id": "response-3-403",
          "language": "403",
          "code": "// Insufficient permissions to access this resource\n"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Internal server error occurred while processing request\n"
        }
      ],
      "selectedLanguageId": "response-0-200"
    }
  },
  "children": [
    {
      "text": "",
      "id": "7KT6lrOwZinnSPUpkQgPX"
    }
  ]
}