What it does
Close one of your own drafts of this site without publishing it: the draft named by draft (your default draft without it), or draft_id for another of your drafts that get_site lists with yours true. Nothing changes for visitors. Its versions stay in the version history until they are pruned, so diff_site_versions can still read them. Your next write starts a new draft from the live version. drafts in the response lists the drafts still open.
Plans
Works on every plan: Free, Basic, Pro and Ultra.
Parameters
| Name | Type | About |
|---|---|---|
site_idrequired | string | The id of the site. list_sites gives the ids of your sites. |
draft_id | string | The id of another of your drafts, from get_site drafts. Omit it to discard the draft named by draft. |
draft | string | Optional name of your own draft of this site (lowercase letters, digits and dashes, at most 40), such as "pricing-redesign". Each agent has its own drafts, so other agents' work never mixes into yours; give a name when you might work on this site from more than one chat at once, and use the same name on every read, write and publish of that piece of work. Without it you use your default draft. |
Example
Call discard_draft with these arguments:
{
"site_id": "01a1…",
"draft": "pricing-redesign"
}
Ids like 01a1… stand for your own. list_sites and list_tables give you the real ones.
Related guides
- Drafts, versions and rollbackEvery publish is a version you can go back to.