---
title: "Upload a .zip or .tar.gz archive to atomically deploy a new static website release"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.hostedez.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Hosted EZ REST API

`POST /v1/sites/{siteId}/deployments`

## Authentication

- `sessionCookie`, apiKey, in cookie

## Path parameters

- `createSiteDeployment.path.siteId` (string, required) — Site slug (sit_...) or UUID.

## Query parameters

- `createSiteDeployment.query.format` (string, optional) — Optional archive format override (zip or tar.gz) for raw binary uploads.
  - one of `"zip"`, `"tar.gz"`
- `createSiteDeployment.query.note` (string, optional) — Optional release note for raw binary uploads (max 500 characters).
  - maxLength 500
- `createSiteDeployment.query.filename` (string, optional) — Optional original archive filename for raw binary uploads.
  - maxLength 255

## Header parameters

- `createSiteDeployment.header.Idempotency-Key` (string, optional) — Optional idempotency key (1 to 255 printable ASCII characters) scoped to caller and route.
  - minLength 1; maxLength 255

## Request body (multipart/form-data)

_Required._

- `createSiteDeployment.file` (string, required) — Static site archive (.zip, .tar.gz, or .tgz, up to 100 MiB). Also accepted under field name 'archive'.
  - format `binary`
- `createSiteDeployment.note` (string, optional) — Optional human-readable release note.
  - maxLength 500

## Example request

```text
{
  "file": "string",
  "note": "string"
}
```

## Request body (application/gzip)

### Example

```text
string
```

## Request body (application/octet-stream)

### Example

```text
string
```

## Request body (application/zip)

### Example

```text
string
```

## Code samples

### cURL

```curl
curl --request POST \
  --url https://api.hostedez.com/v1/sites/string/deployments \
  --header 'Content-Type: multipart/form-data' \
  --header '__Secure-better-auth.session_token: <value>'
```

### TypeScript

```typescript
const url = 'https://api.hostedez.com/v1/sites/string/deployments';
const options = {
  method: 'POST',
  headers: {
    'Content-Type': 'multipart/form-data',
    '__Secure-better-auth.session_token': '<value>'
  }
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.hostedez.com/v1/sites/string/deployments"

headers = {
    "Content-Type": "multipart/form-data",
    "__Secure-better-auth.session_token": "<value>"
}

response = requests.post(url, headers=headers)

print(response.text)
```

## Responses

### 201

Static release deployed and activated

#### Example

```json
{
  "cdnPurged": true,
  "deployment": {
    "activatedAt": "2019-08-24T14:15:22Z",
    "canRollback": true,
    "createdAt": "2019-08-24T14:15:22Z",
    "errorMessage": "string",
    "fileCount": 0,
    "filename": "string",
    "id": "string",
    "isCurrent": true,
    "note": "string",
    "retained": true,
    "rolledBackFromId": "string",
    "rolledBackFromVersion": 0,
    "sha256": "string",
    "sizeBytes": 0,
    "source": "archive",
    "status": "uploading",
    "version": 0
  }
}
```

- `createSiteDeployment.response.201.cdnPurged` (boolean, required)
- `createSiteDeployment.response.201.deployment` (object, required)
  - `createSiteDeployment.response.201.deployment.activatedAt` (string | null, required)
    - format `date-time`
  - `createSiteDeployment.response.201.deployment.canRollback` (boolean, required)
  - `createSiteDeployment.response.201.deployment.createdAt` (string, required)
    - format `date-time`
  - `createSiteDeployment.response.201.deployment.errorMessage` (string | null, required)
  - `createSiteDeployment.response.201.deployment.fileCount` (integer, required)
  - `createSiteDeployment.response.201.deployment.filename` (string | null, required)
  - `createSiteDeployment.response.201.deployment.id` (string, required)
  - `createSiteDeployment.response.201.deployment.isCurrent` (boolean, required)
  - `createSiteDeployment.response.201.deployment.note` (string | null, required)
  - `createSiteDeployment.response.201.deployment.retained` (boolean, required)
  - `createSiteDeployment.response.201.deployment.rolledBackFromId` (string | null, required)
  - `createSiteDeployment.response.201.deployment.rolledBackFromVersion` (integer | null, required)
  - `createSiteDeployment.response.201.deployment.sha256` (string | null, required)
  - `createSiteDeployment.response.201.deployment.sizeBytes` (integer, required)
    - format `int64`
  - `createSiteDeployment.response.201.deployment.source` (string, required)
    - one of `"archive"`, `"rollback"`
  - `createSiteDeployment.response.201.deployment.status` (string, required)
    - one of `"uploading"`, `"active"`, `"superseded"`, `"failed"`
  - `createSiteDeployment.response.201.deployment.version` (integer, required)

### 400

Invalid or corrupt archive payload

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `createSiteDeployment.response.400.error` (object, required)
  - `createSiteDeployment.response.400.error.code` (string, required)
  - `createSiteDeployment.response.400.error.message` (string, required)
  - `createSiteDeployment.response.400.error.issues` (array<object>, optional)
    - `createSiteDeployment.response.400.error.issues.message` (string, required)
    - `createSiteDeployment.response.400.error.issues.path` (string, required)

### 401

Unauthenticated

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `createSiteDeployment.response.401.error` (object, required)
  - `createSiteDeployment.response.401.error.code` (string, required)
  - `createSiteDeployment.response.401.error.message` (string, required)
  - `createSiteDeployment.response.401.error.issues` (array<object>, optional)
    - `createSiteDeployment.response.401.error.issues.message` (string, required)
    - `createSiteDeployment.response.401.error.issues.path` (string, required)

### 403

Forbidden origin

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `createSiteDeployment.response.403.error` (object, required)
  - `createSiteDeployment.response.403.error.code` (string, required)
  - `createSiteDeployment.response.403.error.message` (string, required)
  - `createSiteDeployment.response.403.error.issues` (array<object>, optional)
    - `createSiteDeployment.response.403.error.issues.message` (string, required)
    - `createSiteDeployment.response.403.error.issues.path` (string, required)

### 404

Site not found

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `createSiteDeployment.response.404.error` (object, required)
  - `createSiteDeployment.response.404.error.code` (string, required)
  - `createSiteDeployment.response.404.error.message` (string, required)
  - `createSiteDeployment.response.404.error.issues` (array<object>, optional)
    - `createSiteDeployment.response.404.error.issues.message` (string, required)
    - `createSiteDeployment.response.404.error.issues.path` (string, required)

### 409

Unsupported site runtime, or site is not ready/suspended/deleting

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `createSiteDeployment.response.409.error` (object, required)
  - `createSiteDeployment.response.409.error.code` (string, required)
  - `createSiteDeployment.response.409.error.message` (string, required)
  - `createSiteDeployment.response.409.error.issues` (array<object>, optional)
    - `createSiteDeployment.response.409.error.issues.message` (string, required)
    - `createSiteDeployment.response.409.error.issues.path` (string, required)

### 413

Archive exceeds 100 MiB limit

#### Example

```json
{
  "error": {
    "code": "string",
    "issues": [
      {
        "message": "string",
        "path": "string"
      }
    ],
    "message": "string"
  }
}
```

- `createSiteDeployment.response.413.error` (object, required)
  - `createSiteDeployment.response.413.error.code` (string, required)
  - `createSiteDeployment.response.413.error.message` (string, required)
  - `createSiteDeployment.response.413.error.issues` (array<object>, optional)
    - `createSiteDeployment.response.413.error.issues.message` (string, required)
    - `createSiteDeployment.response.413.error.issues.path` (string, required)


Source: https://docs.hostedez.com/api/createSiteDeployment/index.md
