# Creating an UbiFunction

You can create and develop UbiFunctions in two ways:

1. **Web UI** — Create and edit functions directly in your Ubidots account.
2. **CLI** — Create, test, and deploy functions locally with full runtime replication. Local development unlocks your preferred IDE and AI-powered tools like Claude Code.

```bash
ubidots functions new --name my-function --runtime python3.11:base
ubidots functions start --methods POST
```

{% hint style="info" %}
See the full [CLI reference for UbiFunctions](/sdks/cli/ubifunctions.md) for local development workflows, including push, pull, and live testing.
{% endhint %}

## Using the Web UI

1. In your Ubidots account, go to **Devices** and select **Functions**.

<figure><img src="/files/VnbeR0dnre19UpltY4mO" alt=""><figcaption></figcaption></figure>

2. Click the `+` icon to create your first UbiFunction.

<figure><img src="/files/4C0bVWJ8tiRrDUzkHF17" alt=""><figcaption></figcaption></figure>

3. Give your function a name.

{% hint style="warning" %}
Your function name becomes part of its URL. If you rename the function later, the URL stays the same.
{% endhint %}

<figure><img src="/files/z28GRISfdoDgGQjx1pNM" alt=""><figcaption></figcaption></figure>

Enter the name in the corresponding field:

<figure><img src="/files/cwYUikWJPJw1jTIUYN3V" alt=""><figcaption></figcaption></figure>

4. Scroll down to the *Runtime* section and select the runtime you need.

<figure><img src="/files/JgewrNTcICvtSM9tS6qT" alt=""><figcaption></figcaption></figure>

5. Scroll down to the *HTTP Method* section and select the HTTP method this function will allow.

<figure><img src="/files/vjhQK2mGwTkdJHPaJYUb" alt=""><figcaption></figcaption></figure>

6. Configure any additional options:

* **Token**: Select a token from your account to use in your function code.
* **Environment variables**: Select one or more variables from your account's [Global Properties](https://help.ubidots.com/en/articles/9265555-ubifunctions-using-global-properties) to use in the function code.
* **Max. execution time**: Set the maximum time your function can take to execute.
* **Time-based trigger**: Create a cron UbiFunction based on a time interval or a crontab expression.
* **Raw function**: Pass HTTP headers and URL paths to the function. Use content types other than `application/json`. Return custom response codes from the function.
* **CORS Policy**: Enable calls to this function from browser URLs other than `parse.ubidots.com`.

<figure><img src="/files/pSttImW4goxlcTxBq6rd" alt=""><figcaption></figcaption></figure>

7. Scroll to the bottom of the page and click *SAVE* to save these settings.

<figure><img src="/files/bhbGIvhiZDxEPGlXNMIg" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/jcUsLGsydoA9IvNavgnd" alt=""><figcaption></figcaption></figure>


---

# 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/ubifunctions/getting-started/creating-an-ubifunction.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.
