---
title: "Publish a static site"
method: POST
path: "/projects/{projectId}/static-files/publish"
tags: ["Projects", "Files"]
---

# Publish a static site

`POST /projects/{projectId}/static-files/publish`

## Request

- Base URL: `https://api.deepnote.com/v2`
- URL: `https://api.deepnote.com/v2/projects/{projectId}/static-files/publish`
- Auth: HTTP bearer

Replaces a bounded set of files beneath _deepnote_static/, optionally prunes stale static files, then enables static sharing and applies an explicit viewer API-access setting. All content is validated before storage changes. A storage failure can leave a partial publish; retry the same file set to converge. Concurrent publishes are unsupported and use last-write-wins behavior. Use the Deepnote CLI for sites above the documented file or byte limits.

## Path parameters

- `projectId` string, uuid, required: Project whose static site will be replaced.

## Request body

- PublishStaticSiteBody
  - `files` StaticSitePublishFile[], required
    - `path` string, required: File path relative to _deepnote_static/.
    - `content` string, required: File content encoded as UTF-8 text or base64.
    - `encoding` 'utf8' | 'base64'
  - `prune` boolean: Remove files beneath _deepnote_static/ that are not included in this publish.
  - `apiAccess` 'enabled' | 'disabled': Explicitly enable or disable viewer API access. Omit to preserve the current setting.

## Response `200`

Static site published

- PublishStaticSiteResponse
  - `projectId` string, uuid, required
  - `url` string, uri, required
  - `uploaded` integer, required
  - `pruned` integer, required
  - `sharingEnabled` true, required
  - `apiAccessEnabled` boolean, required

## Other responses

- `400`: Validation error
- `401`: Unauthorized
- `403`: Insufficient permissions or static sharing is unavailable
- `404`: Project not found
- `409`: Project is suspended, an existing path blocks the requested file tree, or a static directory holds too many entries to prune
- `413`: Static site exceeds the file-count or decoded-size limits
- `429`: Rate limit exceeded
- `500`: Static site publish failed and may be partial

## Changes

- **2026-09-07** `536000f45c0e`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/deepnote/apis/deepnote-public-api/changes/projects/:projectId/static-files/publish/post.md)

---

[API](https://skmtc.dev/deepnote/apis/deepnote-public-api.md) - [All operations](https://skmtc.dev/deepnote/apis/deepnote-public-api/llms.txt) - [OpenAPI document](https://skmtc.dev/deepnote/apis/deepnote-public-api/revisions/b081f9aea3dc?raw)
