Per-deploy preview URL

POST DELETE /v1/applications/{uuid}/deploys/{deploy_uuid}/preview

Give one specific build its own stable, shareable URL without making it the live version. POST enables the preview, DELETE disables it. The preview serves that exact deploy (its immutable bundle) at <deploy-uuid>.<your-plan-domain> — independent of which deploy is currently activated — so you can share a build for review before promoting it with activate.

Preview URLs are a static / fullstack-frontend feature. The URL serves once the build is ready (preview_url is empty until then) and stays valid until you disable the preview or the deploy's artifacts are pruned by retention. Each enabled preview takes one of the account's preview slots (max_preview_deploys, shared by all its apps; see cap below); turning one off frees it.

Who can open it: the app's preview visibility (private to the account's members by default), and then the protections of the app's primary endpoint: sign-in, IP and geo rules, firewall, rate limits (sharing the primary's counters), WAF, bot and traffic rules, HTTPS enforcement and edge functions. A primary that requires client certificates makes its previews answer 403; a paused or suspended primary refuses them; OAuth sign-in may not work on a preview host. Previews are never served from or stored in the edge cache. An app with no endpoint has no protections to apply. For a managed or function app, the preview reaches the backend that is live now. See Protections on preview URLs.

Response (200 OK)

deploy_uuid string (uuid)
The deploy the preview toggle applied to.
preview_enabled bool
true after POST, false after DELETE.
preview_url string
The public per-deploy URL. Empty once disabled, and until the build is ready.

Errors

403
Your role lacks write permission on endpoints, no active account is selected, or your plan doesn't include application hosting ("Static application hosting is not available on your plan"). Enabling only: the account already has as many live previews as its plan allows (max_preview_deploys; "You've reached your plan's limit of … live previews — turn one off or upgrade your plan") — turn another one off first. Both methods: the account is suspended (code account_suspended).
404
Application or deploy not found, or it belongs to another application / account.
409
Enabling only: the app is paused over a plan limit (code quota_paused), or the deploy is a branch preview that has expired ("This branch preview has expired — push to the branch again for a fresh preview"). Disabling is allowed on a paused app.
500
The preview limit couldn't be checked ("Could not verify your plan's preview limit right now — please retry") or the change couldn't be saved. Safe to retry.
503
Another preview change for the account is in progress, or the app's plan status couldn't be read. Retry in a moment.
Request — enable
curl -X POST \ "https://api.ngris.com/v1/applications/019be838-d261-7d9b-9499-71995a3a91c6/deploys/019bf3d2-0116-7612-9567-75a812bf45fc/preview" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json"
Response — 200 OK
{ "deploy_uuid": "019bf3d2-0116-7612-9567-75a812bf45fc", "preview_enabled": true, "preview_url": "https://019bf3d2-0116-7612-9567-75a812bf45fc.ngris.dev" }
Request — disable
curl -X DELETE \ "https://api.ngris.com/v1/applications/019be838-d261-7d9b-9499-71995a3a91c6/deploys/019bf3d2-0116-7612-9567-75a812bf45fc/preview" \ -H "X-API-KEY: <your_api_key>"

Enable branch auto-previews

PUT /v1/applications/{uuid}/git/auto-preview

Opt a git-connected app into automatic branch previews. With it on, a push to any branch other than the deploy branch builds a preview deploy instead of touching production — the preview never becomes the live version. It's off by default. This applies to static and fullstack-frontend apps (a fullstack preview builds only the static frontend; API paths still hit the app's live backend).

Request body

enabled bool required
true to auto-build a preview on every non-deploy-branch push; false to turn it off.

Response (200 OK)

auto_preview bool
The new setting.

Errors

400
Invalid request body, or a serverless function app (branch previews aren't supported there).
404
Not a git application (auto-previews require a connected repo).
409
The app is paused over a plan limit (quota_paused).
Each branch's newest preview is kept and older ones for that branch are superseded. Live previews are capped per account (max_preview_deploys): a push at the cap turns off the account's oldest previews to make room. Branch previews expire 7 days after their push and are cleaned up automatically. Read the current setting from the webhook info endpoint (auto_preview).
Request
curl -X PUT \ "https://api.ngris.com/v1/applications/019be838-d261-7d9b-9499-71995a3a91c6/git/auto-preview" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json" \ -d '{ "enabled": true }'
Response — 200 OK
{ "auto_preview": true }

List branch previews

GET /v1/applications/{uuid}/previews

List the app's live branch previews (branch previews with the preview on and not pruned), newest first — normally the latest preview per branch. Each entry carries both a stable branch-alias URL (always points at that branch's newest preview) and the immutable per-deploy URL (that exact build), plus branch, status and expiry. Manual per-deploy previews are not listed here; they show as preview_enabled in List Deploys. account_previews and cap let a UI show how many of the plan's live previews the whole account uses.

Response (200 OK)

previews[] array
One object per live preview (see fields below); [] when there are none.
previews[].deploy_uuid string
The preview build.
previews[].branch string
Source branch.
previews[].status string
Build status (ready, building, …).
previews[].git_sha string | null
Commit the preview was built from.
previews[].version int
Deploy version number.
previews[].branch_url string
Stable alias — this branch's latest preview. Empty until the build is ready.
previews[].preview_url string
Immutable URL for this exact build. Empty until the build is ready.
previews[].expires_at datetime | null
When the preview is reaped (null if it doesn't expire).
previews[].created_at datetime
When the preview build was created.
account_previews int
Live previews across all the account's apps, as counted against cap (a branch counts once; manual per-deploy previews count too).
cap int
How many live previews the account's plan allows, across all its apps.
Request
curl "https://api.ngris.com/v1/applications/019be838-d261-7d9b-9499-71995a3a91c6/previews" \ -H "X-API-KEY: <your_api_key>"
Response — 200 OK (abridged)
{ "previews": [ { "deploy_uuid": "019c0a41-5d2e-7b88-8f13-c6e2a4d97b05", "branch": "feature/new-nav", "status": "ready", "git_sha": "9c1a2b3d4e5f60718293a4b5c6d7e8f901234567", "version": 14, "branch_url": "https://feature-new-nav-a1b2c3.ngris.dev", "preview_url": "https://019c0a41-5d2e-7b88-8f13-c6e2a4d97b05.ngris.dev", "expires_at": "2026-08-21T10:00:00Z", "created_at": "2026-08-14T10:00:00Z" } ], "account_previews": 3 }
Was this helpful?