# Deploy the site from the request body

`POST /hosting/sites/{id}/deployments` · Rivier · hosting

Deploy the site from the request body: a gzip tar with index.html at its top. ?preview=1 makes a preview at its own address.

- Scope: hosting:write
- Sdk: hosting.deployment.create
- Cli: hosting deployment create
- Events: hosting.deployment.created

## Parameters

- `id` (path, required), string
- `preview` (query), string
- `ref` (query), string

## Request body

`application/octet-stream`

```json
{
  "type": "string",
  "format": "binary"
}
```

## Responses

- `201`: Success
- `400`: The request was malformed
- `401`: No valid credential
- `403`: The credential lacks the scope, origin or address
- `429`: Over the key's rate limit; see Retry-After

## Example

```sh
curl -X POST 'https://api.rivier.ai/hosting/sites/{id}/deployments' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/octet-stream'
```
