Previews

Create or update the preview of a Git branch (Git-backed or managed projects); redeploys it if it already exists

post/projects/{projectId}/previews

Request

  • Base URL: https://hostingsurge.com/api/v1
  • URL: https://hostingsurge.com/api/v1/projects/{projectId}/previews
  • Auth: one of:
    • HTTP bearer
    • API key in cookie __Host-hs_session

Path parameters

projectIdstring uuid required

Request body

branchstring required

Git branch to track (Git-backed projects) or a free-form label (upload/CLI previews)

refstring

Commit SHA to deploy; default = the branch head (Git-backed projects only)

Response

Created or updated

idstring uuid required
projectIdstring uuid required
branchstring required

Git branch tracked, or the free-form label of an upload preview

hostnamestring required
urlstring nullable required
status'provisioning' | 'ready' | 'error' | 'deleting' required
statusDetailstring nullable required
lastDeployedAtstring nullable required

ISO-8601 timestamp

lastActivityAtstring required

Bumped on every deploy/redeploy; drives idle expiry

expiresAtstring nullable required

Estimate at the platform's current idle-preview setting; redeploying resets it

createdAtstring required

ISO-8601 timestamp

updatedAtstring required

ISO-8601 timestamp

Changes

No recorded changes to this operation across all 1 revision of this API.