---
title: "Download a site's code project as a zip"
method: GET
path: "/api/pages/{siteId}/export"
tags: ["pages"]
---

# Download a site's code project as a zip

`GET /api/pages/{siteId}/export`

## Request

- Base URL: `https://app.goosybear.ai`
- URL: `https://app.goosybear.ai/api/pages/{siteId}/export`
- Auth: HTTP bearer

Streams the site's code project as the zip it would build from: a site you brought as a finished bundle gives back its newest staged revision (the platform's own `bundle.json` left out and its migration relocation undone, so the zip re-imports as it is); a site built here gives back its current source tree. The bytes are built on the way out and never stored, auth is re-checked on every call, and the zip is deterministic for a given revision. `X-Goosy-Export-Ref` names the revision or source ref the zip is byte-identical to. The site's database, storage, media and data tables are not part of the code project and are not in the zip. Pulling a site's code is recorded on the audit ledger and is not metered.

## Path parameters

- `siteId` string, uuid, required

## Query parameters

- `workspace` string

## Response `200`

The zip. `Content-Disposition: attachment; filename="<site>-<ref>.zip"`, `X-Goosy-Export-Kind` (`managed` or `bundle`) and `X-Goosy-Export-Ref` (the ref the zip is byte-identical to).

## Other responses

- `401`: No bearer credential, or one that did not resolve.
- `403`: Programmatic access is unavailable to this holder, the named workspace is outside the key's scope, or the holder lacks `pages.manage`.
- `404`: The `siteId` is not a site in the resolved workspace, or the site holds nothing to export yet.
- `500`: An unexpected server error occurred while building the zip.

---

[API](https://skmtc.dev/goosybear/apis/goosy-bear-api.md) · [All operations](https://skmtc.dev/goosybear/apis/goosy-bear-api/llms.txt) · [OpenAPI document](https://skmtc.dev/goosybear/apis/goosy-bear-api/revisions/6d82fb124064?raw)
