---
title: "Deploy a site"
method: POST
path: "/sites/{id}/deploy"
tags: ["Deployments"]
---

# Deploy a site

`POST /sites/{id}/deploy`

## Request

- Base URL: `https://api.crevio.co/v1`
- URL: `https://api.crevio.co/v1/sites/{id}/deploy`
- Auth: API key in header `Authorization`

Builds and publishes the site's current `main` branch to production. Asynchronous: responds `202` with a `pending` deployment; poll `GET /sites/{id}/deployments` for the outcome (`live` or `failed`).

If a deploy is already in flight, that one is returned instead of starting a second build — still `202`. A build this call started is `pending` with a null `started_at`; one already running is `building`.

## Path parameters

- `id` string, required

## Headers

- `Idempotency-Key` string

## Response `202`

The queued deployment

- Deployment
  - `id` string, required
  - `object` string, required
  - `site` string, required
  - `status` 'pending' | 'building' | 'live' | 'failed' | 'superseded' | 'unpublished', required
  - `commit_sha` string, nullable, required
  - `is_live` boolean, required
  - `url` string, nullable, required
  - `triggered_by` string, nullable, required
  - `error_message` string, nullable, required
  - `db_bookmark` string, nullable, required
  - `current_stage` string, nullable, required
  - `stages` unknown[], required
    - unknown
  - `duration_seconds` number, nullable, required
  - `elapsed_seconds` number, nullable, required
  - `started_at` string, nullable, required
  - `finished_at` string, nullable, required
  - `created_at` string, required

## Other responses

- `401`: Authentication required
- `404`: Resource not found
- `422`: Validation error
- `429`: Rate limit exceeded — 600 requests per minute per credential. Retry after the number of seconds in `Retry-After`.

---

[API](https://skmtc.dev/crevio/apis/crevio-api-v1.md) · [All operations](https://skmtc.dev/crevio/apis/crevio-api-v1/llms.txt) · [OpenAPI document](https://skmtc.dev/crevio/apis/crevio-api-v1/revisions/2219f18ad651?raw)
