API referenceSections

Make (or update) a preview of a branch now; it is built in the background

Generated from the OpenAPI contract. Sessions send the CSRF header on writes; API keys use a Bearer token. Authentication

POST /api/v1/tenants/{tid}/sites/{id}/previews may answer 202

Make (or update) a preview of a branch now; it is built in the background

Authentication: session cookie __Host-panel_session (contract default; see Authentication).

Parameters

NameInTypeRequiredDescription
tidpathstringrequired
idpathstringrequired
X-CSRF-Tokenheaderstringoptional

Required on unsafe requests authenticated by session cookie; API keys do not use it.

Request body

required

Content type: application/json

object
  • branch string required
Example
{
  "branch": "string"
}

Responses

202 Being built

Content type: application/json

  • id string required
  • site_id string required

    The preview's own site

  • kind string required
    Allowed values: "branch" "pull_request"
  • ref string required
  • number integer required
  • title string required
  • hostname string required
  • url string required
  • commit string required
  • state string required
    Allowed values: "creating" "deploying" "ready" "failed" "deleting"
  • error_code string required
  • database_id string required
  • created_at string (date-time) required
  • updated_at string (date-time) required
  • active_at string (date-time) required
  • deployed_at string (date-time) | null required
  • expires_at string (date-time) required
  • disk_bytes integer (int64) required

    -1 until measured

  • log array<object> required
    • at string (date-time) required
    • step string required
    • state string required
    • detail string optional
Example
{
  "id": "string",
  "site_id": "string",
  "kind": "branch",
  "ref": "string",
  "number": 0,
  "title": "string",
  "hostname": "string",
  "url": "string",
  "commit": "string",
  "state": "creating",
  "error_code": "string",
  "database_id": "string",
  "created_at": "2026-01-01T00:00:00Z",
  "updated_at": "2026-01-01T00:00:00Z",
  "active_at": "2026-01-01T00:00:00Z",
  "deployed_at": "2026-01-01T00:00:00Z",
  "expires_at": "2026-01-01T00:00:00Z",
  "disk_bytes": 0,
  "log": [
    {
      "at": "2026-01-01T00:00:00Z",
      "step": "string",
      "state": "string",
      "detail": "string"
    }
  ]
}

default Error

Content type: application/json

  • code string required
  • message string required
  • details_redacted boolean required
  • correlation_id string required
  • retryable boolean required