# Manage sites

Open sites published by agents, roll back to an earlier version, make a site public or private, and update sites through the API.

Manage the static websites agents publish from their environments. Viewing and opening sites requires Viewer or Sites Viewer; renaming, deleting and rolling back private sites requires Editor or Sites Admin; making a site public or changing the live version of a public site requires Owner or Sites Admin.

## Open a site and inspect versions [#open-a-site-and-inspect-versions]

1. In your project, click **Agents**, then **Sites**.
2. Click a site to open its page.
3. Click its URL to open the live site in a new tab, or browse numbered publishes under **Versions**.

## Roll back or publish a version live [#roll-back-or-publish-a-version-live]

Each site keeps its newest 20 versions plus the live version. On a public site, new versions an agent publishes wait until someone makes them live.

1. Open the site under **Agents** › **Sites**.
2. On the version's row, click **Make live**.
3. Click **Make live** in the confirmation dialog.

The site's URL immediately serves the selected version.

## Make a site public or private [#make-a-site-public-or-private]

Sites are private by default: visitors sign in to kosem and need access to the site (or to its private agent).

1. Open the site under **Agents** › **Sites**.
2. To open it to anyone with the link, click **Make public**, review what it exposes, and click **Make public**.
3. To require kosem sign-in again, click **Make private**.

:::warning
Anyone with a public site's link can view it without signing in. If the site was published by a private agent, check its contents before making it public.
:::

## Rename or delete a site [#rename-or-delete-a-site]

- Click **Rename** to change the display name without changing the site's URL.
- Click **Delete**, then **Delete site** to remove the site, its URL and every version permanently.

## Use the API [#use-the-api]

Set your API key ([Call the API](/get-started/call-the-api)), your project's ID and the site's ID:

```sh
export KOSEM_API_KEY='kosem_sk_…'
export KOSEM_PROJECT='prj_01m5r9dh9mf0ps98ktkap3562c'
export KOSEM_SITE='sit_01m5rh1mq2e9vbt6g0d4x7qz1t'
```

Make version 2 live (include `etag` from `GET /v1/projects/$KOSEM_PROJECT/sites/$KOSEM_SITE` to prevent overwriting a newer publish):

```sh
curl -s -X PATCH "https://api.kosem.ai/v1/projects/$KOSEM_PROJECT/sites/$KOSEM_SITE" \
  -H "Authorization: Bearer $KOSEM_API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"liveVersion\": \"projects/$KOSEM_PROJECT/sites/$KOSEM_SITE/versions/2\"}"
```

## Related [#related]

- [Sites](/concepts/sites)
- [Roles](/reference/roles#sites)
- [Limits and quotas](/reference/limits#agents-and-sites)
