> 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

## 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="/files/eT2iXY4EghUwCqmOB2d9" 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 dynamically by asking a question.

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

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
