---
name: dropregion-publish
description: Publish an HTML page, interactive lesson, calculator, report or small site to a permanent DropRegion link, or update one already published. Use when the user asks to publish, host, share or put a page online, or to change a page they published on DropRegion.
---

# Publish to DropRegion

DropRegion turns one self-contained HTML file into a live page at `https://dropregion.com/@handle/slug`. This skill says how to do that with DropRegion's tools.

## Before you start

You need one of:
- The DropRegion connector (MCP server `https://dropregion.com/mcp`), signed in by the user. Its tools are `publish_drop`, `preview_drop`, `update_drop`, `unpublish_drop`, `get_drop`, `list_drops` and `get_drop_analytics`.
- Or a DropRegion API key the user gave you (created at https://dropregion.com/settings/keys), used with the REST API below.

If neither is available, tell the user to connect DropRegion (https://dropregion.com/docs/agents) and stop. Never ask them to paste a password, and do not look for another way in.

## Publish a new page

1. Build the page as ONE HTML file with its CSS and JavaScript inline. Keep it under 2 MB.
2. Ask the user who may see it if they have not said: **public** (listed in the gallery), **unlisted** (only people with the link) or **private** (only them and people they invite). If unsure, suggest unlisted.
3. Call `preview_drop` with the page. It stores nothing and does not use a monthly drop. Fix anything it reports.
4. Call `publish_drop` with `html`, a `title`, and the chosen `visibility`.
5. Give the user the `url` from the answer. That link is permanent.

## Update a page the user already published

1. Find it with `list_drops` (or `get_drop` if you have the id).
2. Call `update_drop` with the `id` and the COMPLETE new HTML. It replaces the page, keeps the link, and raises the version number.
3. Do not call `unpublish_drop` unless the user asked to take the page down. It can be undone by calling `update_drop` again, but visitors see nothing in between.

## When something goes wrong

- `api_key_required` or a 401: the user has not signed in. Ask them to connect DropRegion.
- `scope_missing`: the key lacks the needed permission. Tell the user which one (`required_scope`).
- `slug_taken` (409): choose another `slug` or leave it out.
- `drop_quota_reached` (429): the free plan is 20 drops a month. Tell the user when it resets (`resets_at`). Do not try again.
- `site_too_large` (413): shrink the page below 2 MB (compress or remove images).
- Status `rejected` (422): the safety scan blocked the page. Read `reasons`, remove what it names, and try again. Never try to disguise content to get past the scan.

## Without the connector (REST)

```
POST https://dropregion.com/api/publish
x-api-key: drk_live_...
Content-Type: application/json

{ "html": "<html>...</html>", "title": "My page", "visibility": "unlisted" }
```

`PUT https://dropregion.com/api/sites/{id}` with `{ "html": "..." }` updates a page. Full details: https://dropregion.com/llms.txt
