# Webhook

## Select the running environment

The first step in developing a new webhook plugin is to determine which environment to use:

* Python
* NodeJS

## Create the file structure

Set up a directory structure with the following files:

```
├── src
│   ├── control.py or control.js  
│   ├── function.py or function.js
│   ├── user_code.py or user_code.js
│   ├── view.xml
├── LICENSE
├── README.md
├── manifest.toml 
```

## control, function, and user\_code scripts

Fill these files with the content you need according to the table below, then save them.

<table><thead><tr><th width="127">Script</th><th width="244">Executed</th><th width="379">Purpose</th></tr></thead><tbody><tr><td>control</td><td>Only once when the plugin is created</td><td>Perform one-time setup tasks</td></tr><tr><td>function</td><td>Triggered by a webhook</td><td>Perform any task</td></tr><tr><td>user_code</td><td>Triggered by a webhook if invoked by the function script</td><td>Perform any task</td></tr></tbody></table>

## view\.xml

Populate this file with content based on the form you'd like displayed when creating this plugin.

## LICENSE and README.md

Write the contents of the `README.md` and `LICENSE` files.

## manifest.toml

According to the Webhook section of the Private Plugins page, `manifest.toml` should look like this:

```
manifest_version = 2.0
 
[settings] 
version = "1.0.56" 
runtime = "nodejs:20" | "python:3.11" 
plugin_type = "webhook" 
license_name = "MIT license" 

[settings.webhook]
default_http_method = "POST" | "GET"
allowed_http_methods =  ["POST", "GET"]

[pricing]
price = 0
```

## Compressing the files

Compress the files into a ZIP archive from the root of the file structure, not the parent folder.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dev.ubidots.com/plugins/plugins-development/webhook.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
