# Build a static site from an allow-listed repository

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

Build a static site from an allow-listed repository. The build runs in a sandbox with no network and no secrets; the result is a preview to promote.

- Scope: hosting:write
- Mcp: rivier_hosting_build_start
- Graphql: Mutation.hostingBuildStart
- Sdk: hosting.build.start
- Cli: hosting build start
- Events: hosting.build.started

## Parameters

- `id` (path, required), string

## Request body

`application/json`

```json
{
  "type": "object",
  "properties": {
    "repo": {
      "type": "object",
      "properties": {
        "url": {
          "type": "string",
          "minLength": 10,
          "maxLength": 300
        },
        "ref": {
          "type": "string",
          "maxLength": 100
        }
      },
      "required": [
        "url"
      ],
      "additionalProperties": false
    },
    "outDir": {
      "type": "string",
      "maxLength": 130
    },
    "install": {
      "type": "boolean"
    },
    "build": {
      "type": "boolean"
    },
    "preview": {
      "type": "boolean"
    }
  },
  "required": [
    "repo"
  ],
  "additionalProperties": false
}
```

## 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}/builds' \
  -H 'Authorization: Bearer $KEY' \
  -H 'Content-Type: application/json' \
  -d '{
  "repo": {
    "url": "string"
  }
}'
```
