> For the complete documentation index, see [llms.txt](https://dev.ubidots.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dev.ubidots.com/apps/pages/api/publish.md).

# Publish

Publish your code as a ZIP file

## Upload code

The last step, after [developing](/apps/pages/development.md) the page code and [creating](/apps/pages/api/page-creation.md) the entity in Ubidots, is to upload the code to the Page as a ZIP file. This makes it publicly available so Ubidots can serve it.

Follow these steps:

1. Compress the files from the [Development section](/apps/pages/development.md) into a ZIP file from the root of the file structure, not the parent folder.
2. Make the following HTTP request. Replace `<page_id>`, `<YOUR_TOKEN>`, and `<path_to_zip>` as needed.

```bash
curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/pages/<page_id>/code' \
-H 'X-Auth-Token: <YOUR_TOKEN>' \
-F "zipFile=@<path_to_zip>.zip;type=application/zip"
```

You should receive this response:

```json
{
  "message": "File successfully uploaded."
}
```

{% hint style="warning" %}
The ZIP file size is limited to 5 MB.
{% endhint %}

## Load code

Once the page is created and the code is uploaded, you can serve the Page from a Ubidots Dashboard. To do so:

1. Create a dashboard with its type set to Custom.<br>

   <figure><img src="https://884329393-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MhzNRg0B4ECiNXc093G%2Fuploads%2Fa8whxrKvZihwIDcsmIT1%2FDashboard%20type%20custom.png?alt=media&amp;token=6e2dde45-3175-4e48-80a8-3e75c6ab9524" alt="" width="563"><figcaption></figcaption></figure>
2. In the "Custom page URL" field, enter the following URL after replacing `<page_id>` with your Page ID.\
   \
   `https://industrial.ubidots.com/app/pages/public/<page_id>`\
   \
   This URL is the Ubidots format used to expose your custom code through a URL that can be loaded from a Dashboard.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://dev.ubidots.com/apps/pages/api/publish.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
