# Drafts and publishing

> Saving keeps work as a draft; marking it ready and pressing Publish puts it live in the Delivery API as a numbered version. Unpublish and delete too.

Everything you edit in Spatibase is a draft. Nothing reaches your website, app or map until someone presses **Publish**, and each publish is saved as a numbered [version](https://spatibase.com/docs/publish/versions/) you can go back to. This page explains the steps from draft to live, how to take entries offline, and what the Content Delivery API receives.

## What does publishing mean?

Publishing copies the drafts that are **ready** to the live version that the Content Delivery API serves, and ships everything else that was waiting (entries leaving the API, group changes) in the same step. Saving a draft never changes what your website, app or map shows: visitors keep seeing the last published content until you publish again.

Publishing happens for the whole project at once. There is no publish button for a single entry: you mark entries **Ready to publish**, and **Publish** ships all of them together. That way a half-finished change cannot go live by accident.

Every entry has one of three statuses. The **Status** filter above the **Entries** list offers them, plus two more for entries that wait for the next publish.

| Status | What it means |
|---|---|
| **Draft** | The entry has never been published. The API does not show it. |
| **Published** | The entry is live and has no edits since it was published. |
| **Unpublished changes** | The entry is live, but you have edited it since. The API still shows the older published version. |
| **Ready to publish** | You marked the draft as approved. It goes live with the next **Publish**. |
| **Will be unpublished** / **Will be removed** | The entry is live now and comes off the API at the next **Publish** ([take an entry offline](https://spatibase.com/docs/publish/draft-and-published/#how-do-i-take-an-entry-offline)). |

In the list, **Draft** and **Unpublished changes** are marked, and so are **Ready to publish** and the removal labels. A published entry carries no mark. The entries table has a **Status** column.

Owners and editors can mark entries ready, publish and go back to earlier versions. Developers can read content but not change or publish it. An AI assistant needs the **Publish** power for this; see [What assistants can do](https://spatibase.com/docs/ai/what-assistants-can-do/).

## How do I get an entry live?

1. Open the entry in **Entries**.
2. Make your changes. They save as a draft by themselves.
3. Select **Ready to publish**. It saves any waiting edits first. If the entry breaks a rule, such as an empty required element (field) or a missing location on a type that requires one, Spatibase does not mark it and shows what to fix.
4. Select **Publish** in the side panel (under the project name; a small database icon when the panel is narrow). The number beside it counts what would go live.

Once an entry is ready, the editor shows **Ready to publish** with a **Back to draft** button, in case you want to keep working on it. A live entry with no edits shows neither button.

**Ready means this exact content.** If you change a ready entry, even by a letter, its ready mark goes away and you mark it again, so what someone reviewed is what ships. Saving without a real change keeps the mark. A new entry and every edit of a published entry start out not ready, and a draft that is not ready is left out of every publish. The live copy of an entry you are still editing stays as it was.

In the entries table, the **Status** cell of a row opens a small menu with **Ready to publish**, **Back to draft** and **Unpublish**. To do the same for several entries, tick the **Select entries** checkbox above the list, tick the entries and use the buttons in the bar at the bottom: **Ready to publish**, **Back to draft**, **Unpublish** and **Keep**. In Collect you can mark entries **Ready to publish** too, but publishing itself is for the office; see [Collect](https://spatibase.com/docs/content/collect/).

## What happens when I select Publish?

**Publish** opens a dialog that lists exactly what is about to go live: new entries, changed entries, entries that will be removed and group changes. It also says how many drafts are not ready and will stay out ("12 drafts aren't ready and will stay out"), and how many of them an AI assistant changed.

1. Check the list.
2. Select **Publish** (it shows the number of changes). The dialog closes with a message such as "Published as version 7".
3. If an entry on the list breaks a rule, the dialog lists it with the problem. That entry is left out and keeps its ready mark, and everything else goes live. Open it, fix it and publish again.

If nothing is ready yet but there are drafts, the main button reads **Mark all ready and publish**. It marks every draft that passes the checks as ready and publishes them in one go, which saves clicks when you work alone. Entries that fail the checks are listed and stay drafts.

If somebody marks something ready while the dialog is open, Spatibase reloads the list and tells you, so you never publish something you did not see.

A publish with nothing to ship does nothing and creates no version.

## How do I take an entry offline?

**Unpublish** takes a live entry out of the API but keeps its draft, so you can publish it again later. **Delete** takes it out and then moves it to the trash. Neither happens at once: both wait for the next **Publish**.

1. Open the entry.
2. Select **Unpublish** (or **Delete**) and confirm.

The entry stays live until the next publish and shows **Will be unpublished** or **Will be removed** with a **Keep** button. Select **Keep** to change your mind. Editing an entry does not cancel its pending removal.

An entry that was never published has nothing to take offline, so deleting it moves it to the trash at once, with an **Undo** in the message that appears. Items in the trash wait there for 30 days (see [Activity and trash](https://spatibase.com/docs/team/activity-and-trash/)). Marking an entry **Ready to publish** cancels a pending removal, and a pending removal cancels a ready mark.

## What reaches the API, and what does not?

Only published content reaches the Content Delivery API. Drafts never do.

| Reaches the API | Never reaches the API |
|---|---|
| Published entries of enabled types | Drafts, ready drafts and unpublished changes |
| Groups, with their published entries in your order | Entries of types with **Show in Entries and the API** switched off |
| Your types and elements (the content model) | The trash |
| Map feature types | Your Activity history and your versions |
| Images and files | Members and API keys |
| The project's name and description | |

Groups are part of the publish. Creating, renaming or deleting a group, and adding, removing or reordering its entries, shows in the API only at the next **Publish**. A group with changes waiting shows **Unpublished changes** in the list, and a group that is deleted but still live shows **Will be removed**; use **Keep** to cancel. A group only ever lists published entries.

A few changes go live at once, without **Publish**, because they are not entries:

- Changes to the **content model** (types, elements, map feature types).
- The project's **name, description and languages**, and the switch between public and private.
- Changes to **images and files**: deleting a file, and its alt text or file name. Entries that use a file stay drafts until you publish.

In a project with [languages](https://spatibase.com/docs/content/translations/), every language goes live with the same **Publish**: translations are part of the draft, a translation edit makes a published entry show **Unpublished changes**, and **Unpublish** takes all languages away.

Importing entries creates drafts. The import's publish option marks the imported entries ready and publishes the project, which also ships anything others had marked ready; see [Import data](https://spatibase.com/docs/content/import/).

## How quickly do changes appear?

A publish takes effect right away, but websites and apps may take a few minutes to show it, because answers are cached: for about a minute in the browser and up to five minutes in the network that delivers the API.

## What is the content version?

The content version is a number for each project that goes up every time something the API shows changes. A publish that ships something, going back to an earlier version, changing the content model, editing or deleting a file and switching the project between public and private all increase it. Saving a draft, marking an entry ready and editing a group do not.

It is not the same as the version numbers on the [Versions](https://spatibase.com/docs/publish/versions/) page: those count publishes, and the content version also counts the changes that go live without a publish.

Developers use the content version to check cheaply whether anything changed: the project endpoint of the Content Delivery API returns it as `contentVersion`, and every [webhook](https://spatibase.com/docs/publish/webhooks/) message carries it. You do not need to do anything with it in the web app.

## Related

- [Versions and going back](https://spatibase.com/docs/publish/versions/)
- [Access and API keys](https://spatibase.com/docs/publish/access-and-keys/)
- [Webhooks](https://spatibase.com/docs/publish/webhooks/)
- [Entries](https://spatibase.com/docs/content/entries/)
- [Content Delivery API reference](https://spatibase.com/docs/reference/delivery-api/)
