Publish content
dropthis_publishPublish content (HTML, files, or a URL) to a new permanent public URL and receive a shareable link with a drop ID.
Instructions
Publish content to a NEW permanent public URL and get back its drop_… id. Accepts exactly one content input: content (inline HTML/text), files (in-memory multi-file bundle), file/paths (a local file or directory, stdio/local only), or source_url (a public http(s) URL the server fetches). For a files bundle: a drop holds up to 200 files; each file is content (text you write), source_url (a remote asset dropthis fetches server-side — use this for images/video/pdf/fonts), or content_base64 (small inline bytes only); never base64-inline an image into HTML. Use when the user wants to publish, share, post, put online, make public, or get a shareable link for generated content — a report, dashboard, slide deck, site, or file. Creates a NEW drop every call: do NOT call this to change something you already published — that makes a duplicate. To change an existing drop, use dropthis_update_content (the files at the URL) or dropthis_update_settings (title, visibility, password, expiry, metadata) with the drop_… id from this call's response. If you only kept the URL or slug, call dropthis_resolve to recover the drop_… id instead of publishing again (which would make a duplicate). Two URLs come back: url is the canonical, always-branded human view (the badge is guaranteed, with no client detection); for a single non-HTML file the response also carries raw_url, which serves that file's exact bytes at its natural path — share url with humans, hand raw_url to other agents (raw_url is null for HTML drops, where the page is the artifact, and for collections, whose per-file paths come from dropthis_get_content). Routing: by default the drop lands on the account's default custom domain when one is live (the first live path-mode domain becomes the default automatically), otherwise on the shared dropthis pool — accounts holding only dedicated domains also land on the shared pool. Pass domain (a LIVE custom domain — see dropthis_domains_list) to target a specific domain, plus an optional vanity slug on path-mode domains (1-63 lowercase letters/digits/hyphens; a taken slug is auto-suffixed with a warning). Don't pass domain for quick throwaway shares — default routing already handles those. Oversized png/jpeg/webp images are optimized server-side by default (re-encoded smaller, paths unchanged, every transform disclosed in the response warnings[] as image_optimized/image_optimize_skipped); pass optimize:false for byte-exact storage.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file | No | Local file OR directory path to publish (stdio/local only). A directory is published as a complete multi-file site. | |
| path | No | Filename/path for inline content (default index.html). | |
| slug | No | Vanity slug for the drop's path — valid on path-mode custom domains only: 1-63 lowercase letters/digits/hyphens (no leading/trailing/double hyphen). A taken slug is auto-suffixed with a warning; omit for a random slug. Rejected (422) on the shared pool. | |
| entry | No | Entry file for a multi-file bundle (default index.html). | |
| files | No | A drop holds up to 200 files; each file is `content` (text you write), `source_url` (a remote asset dropthis fetches server-side — use this for images/video/pdf/fonts), or `content_base64` (small inline bytes only); never base64-inline an image into HTML. HTML/CSS/JS reference bundled assets by relative path (e.g. `assets/photo.jpg`). `entry` selects the main file when it is not `index.html`. | |
| paths | No | List of local file/directory paths to publish as one bundle (stdio/local only). | |
| title | No | Drop title. | |
| domain | No | Serve the drop on this custom domain — the hostname of a LIVE domain on this account (see dropthis_domains_list), or pass 'shared' to publish to the shared pool even when the account has a default domain. Path-mode domains serve it at https://{domain}/{slug}/; a dedicated domain serves it at the hostname root and conflicts (409) once occupied. Omit to use the account's default domain, else the shared pool. | |
| content | No | Inline HTML or text to publish. | |
| noindex | No | Prevent search-engine indexing. | |
| metadata | No | Arbitrary JSON key-value metadata. | |
| optimize | No | Server-side image optimization for oversized png/jpeg/webp files, on by default — omit to use the server default (true); every transform is disclosed in the response warnings[] (image_optimized/image_optimize_skipped). Pass false for byte-exact storage. | |
| password | No | Require a password to view the drop. Pro/Business only — on Free/Keep the server returns feature_not_in_plan (403) with an upgrade_url. Remove a password later via dropthis_update_settings with password=null. | |
| workspace | No | Target workspace slug or id (delegated credentials only; omit to publish into the active workspace). Only needed to publish into a workspace that is NOT currently active. | |
| expires_at | No | Auto-delete after this ISO 8601 timestamp, e.g. 2026-12-31T00:00:00Z. | |
| source_url | No | Public http(s) URL to fetch and publish. | |
| visibility | No | public (default) or unlisted. Unlisted is link-only: anyone with the URL can view the drop, but it is excluded from any public listing or discovery. | |
| content_type | No | MIME type for inline content. | |
| idempotency_key | No | Prevent duplicate publishes on retry. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | The drop's permanent drop_… id — persist it for every follow-up tool. | |
| url | No | The canonical, always-branded public URL (share with humans). | |
| next | No | Structured follow-up hints keyed by action. | |
| slug | No | URL slug — a locator, not an id. | |
| title | No | ||
| rawUrl | No | Raw-bytes URL for a single non-HTML file; null for HTML drops and collections. | |
| status | No | ||
| noindex | No | ||
| metadata | No | ||
| revision | No | ||
| expiresAt | No | ||
| sizeBytes | No | Total published bundle size in bytes — check before iterating on a heavy page. | |
| workspace | No | The workspace this drop belongs to {id, slug, name, kind}. | |
| visibility | No | ||
| passwordProtected | No |