> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.utils.http.DynamicWebhook

- Component: `appmixer.utils.http.DynamicWebhook`
- Kind: Trigger
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.utils.http 1.7.5](https://connectors.appmixer.com/connector/appmixer.utils.http/1.7.5.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.utils.http/1.7.5/component/appmixer.utils.http.DynamicWebhook>

The component subscribes its own webhook URL and then fires any time a request is delivered to that URL.

## Properties

| Field | Type | Description |
| --- | --- | --- |
| Flow Start Request Webhook URL (`onStartRequestUrl`) | text | An endpoint URL that will be called when the flow starts to subscribe a new webhook. |
| Flow Start Request Method (`onStartRequestMethod`) | select | An HTTP method to use when subscribing a webhook. |
| Flow Start Request headers (`onStartRequestHeaders`) | textarea | HTTP headers of the request that will be sent to subscribe the webhook. To pass the webhook URL of this component, use the "Webhook URL" variable from the "General" section of the variables picker. |
| Flow Start Request Body (`onStartRequestBody`) | textarea | A body of the HTTP request that will be sent to subscribe the webhook. To pass the webhook URL of this component, use the "Webhook URL" variable from the "General" section of the variables picker. |
| Flow Stop Request URL (`onStopRequestUrl`) | text | An endpoint URL that will be called when the flow stops to unsubscribe an existing webhook. Use the OpenAPI v3 Runtime expressions to refer to the response body and headers from the Flow Start request. E.g. `http://my.server.com/webhook-unsubscribe/{$response.body#/id}`. See [spec](https://swagger.io/specification/#runtime-expressions) for details. |
| Flow Stop Request Method (`onStopRequestMethod`) | select | An HTTP method to use when unsubscribing a webhook. |
| Flow Stop Request Headers (`onStopRequestHeaders`) | textarea | HTTP headers of the request that will be sent to unsubscribe an existing webhook. Use the OpenAPI v3 Runtime expressions to refer to the response body and headers from the Flow Start request. E.g. `{ "HeaderWebhookId": "{$response.body#/id}" }`. See [spec](https://swagger.io/specification/#runtime-expressions) for details. |
| Flow Stop Request Body (`onStopRequestBody`) | textarea | A body of the HTTP request that will be sent to unsubscribe an existing webhook. Use the OpenAPI v3 Runtime expressions to refer to the response body and headers from the Flow Start request. E.g. `{ "webhookId": "{$response.body#/id}" }`. See [spec](https://swagger.io/specification/#runtime-expressions) for details. |
| Immediate response (`immediateResponse`) | toggle | Set if you want the webhook to send a response immediately instead of using the Response component later down the flow. |

## Output ports

### Port `request`

| Field | Type | Description |
| --- | --- | --- |
| `method` | string | - |
| `data` | object | - |
| `query` | object | - |
| `headers` | object | - |

## Full metadata (component.json)

```json
{
  "name": "appmixer.utils.http.DynamicWebhook",
  "author": "David Durman <david@client.io>",
  "description": "The component subscribes its own webhook URL and then fires any time a request is delivered to that URL.",
  "trigger": true,
  "webhook": true,
  "private": false,
  "inPorts": [],
  "outPorts": [
    {
      "name": "request",
      "options": [
        {
          "label": "method",
          "value": "method",
          "schema": {
            "type": "string",
            "example": "POST"
          }
        },
        {
          "label": "data",
          "value": "data",
          "schema": {
            "type": "object",
            "example": {
              "event": "order.created",
              "orderId": "1001"
            }
          }
        },
        {
          "label": "query",
          "value": "query",
          "schema": {
            "type": "object",
            "example": {
              "source": "shop"
            }
          }
        },
        {
          "label": "headers",
          "value": "headers",
          "schema": {
            "type": "object",
            "example": {
              "content-type": "application/json",
              "user-agent": "curl/8.4.0"
            }
          }
        }
      ]
    }
  ],
  "properties": {
    "schema": {
      "properties": {
        "onStartRequestUrl": {
          "type": "string"
        },
        "onStartRequestMethod": {
          "type": "string"
        },
        "onStartRequestHeaders": {
          "type": "string"
        },
        "onStartRequestBody": {
          "type": "string"
        },
        "onStopRequestUrl": {
          "type": "string"
        },
        "onStopRequestMethod": {
          "type": "string"
        },
        "onStopRequestHeaders": {
          "type": "string"
        },
        "onStopRequestBody": {
          "type": "string"
        },
        "immediateResponse": {
          "type": "boolean",
          "default": true
        }
      }
    },
    "inspector": {
      "inputs": {
        "onStartRequestUrl": {
          "type": "text",
          "label": "Flow Start Request Webhook URL",
          "index": 1,
          "tooltip": "An endpoint URL that will be called when the flow starts to subscribe a new webhook."
        },
        "onStartRequestMethod": {
          "type": "select",
          "label": "Flow Start Request Method",
          "defaultValue": "post",
          "index": 2,
          "options": [
            {
              "content": "POST",
              "value": "post"
            },
            {
              "content": "PUT",
              "value": "put"
            },
            {
              "content": "GET",
              "value": "get"
            },
            {
              "content": "PATCH",
              "value": "patch"
            }
          ],
          "tooltip": "An HTTP method to use when subscribing a webhook."
        },
        "onStartRequestHeaders": {
          "type": "textarea",
          "label": "Flow Start Request headers",
          "index": 3,
          "tooltip": "HTTP headers of the request that will be sent to subscribe the webhook. To pass the webhook URL of this component, use the \"Webhook URL\" variable from the \"General\" section of the variables picker."
        },
        "onStartRequestBody": {
          "type": "textarea",
          "label": "Flow Start Request Body",
          "index": 4,
          "tooltip": "A body of the HTTP request that will be sent to subscribe the webhook. To pass the webhook URL of this component, use the \"Webhook URL\" variable from the \"General\" section of the variables picker."
        },
        "onStopRequestUrl": {
          "type": "text",
          "label": "Flow Stop Request URL",
          "index": 5,
          "tooltip": "An endpoint URL that will be called when the flow stops to unsubscribe an existing webhook. Use the OpenAPI v3 Runtime expressions to refer to the response body and headers from the Flow Start request. E.g. <code>http://my.server.com/webhook-unsubscribe/{$response.body#/id}</code>. See <a target=\"_blank\" href=\"https://swagger.io/specification/#runtime-expressions\">spec</a> for details."
        },
        "onStopRequestMethod": {
          "type": "select",
          "label": "Flow Stop Request Method",
          "defaultValue": "delete",
          "index": 6,
          "options": [
            {
              "content": "DELETE",
              "value": "delete"
            },
            {
              "content": "POST",
              "value": "post"
            },
            {
              "content": "PUT",
              "value": "put"
            },
            {
              "content": "GET",
              "value": "get"
            },
            {
              "content": "PATCH",
              "value": "patch"
            }
          ],
          "tooltip": "An HTTP method to use when unsubscribing a webhook."
        },
        "onStopRequestHeaders": {
          "type": "textarea",
          "label": "Flow Stop Request Headers",
          "index": 7,
          "tooltip": "HTTP headers of the request that will be sent to unsubscribe an existing webhook. Use the OpenAPI v3 Runtime expressions to refer to the response body and headers from the Flow Start request. E.g. <code>{ \"HeaderWebhookId\": \"{$response.body#/id}\" }</code>. See <a target=\"_blank\" href=\"https://swagger.io/specification/#runtime-expressions\">spec</a> for details."
        },
        "onStopRequestBody": {
          "type": "textarea",
          "label": "Flow Stop Request Body",
          "index": 8,
          "tooltip": "A body of the HTTP request that will be sent to unsubscribe an existing webhook. Use the OpenAPI v3 Runtime expressions to refer to the response body and headers from the Flow Start request. E.g. <code>{ \"webhookId\": \"{$response.body#/id}\" }</code>. See <a target=\"_blank\" href=\"https://swagger.io/specification/#runtime-expressions\">spec</a> for details."
        },
        "immediateResponse": {
          "type": "toggle",
          "label": "Immediate response",
          "index": 9,
          "tooltip": "Set if you want the webhook to send a response immediately instead of using the Response component later down the flow."
        }
      }
    }
  },
  "icon": "(data URI omitted)"
}
```
