Remove a preview
POST
Ends a preview before it expires: the URL stops being served at once. The deployments to it stay in the history.
Idempotent: a URL with no live preview, including one that has already
expired or was removed before, answers 204 too, so a cleanup that
races the expiry still succeeds.
The URL travels in the body rather than the path because an origin
contains /.
oauth2 deployment.writeheader
AuthorizationBearer <token>Scope: deployment.write
project_id*stringThe unique identifier of the project.
Match
^[a-zA-Z0-9_-]+$application/json- body
The preview to remove.
origin*OriginThe preview URL, exactly as GET /projects/{project_id}/previews lists it.
Match
^https?://(\[[0-9a-f:.]+\]|[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*)(:(6553[0-5]|655[0-2][0-9]|65[0-4][0-9]{2}|6[0-4][0-9]{3}|[1-5][0-9]{4}|[1-9][0-9]{0,3}))?$Length
length <= 2048The URL has no live preview.
Example Request
import { createZitadelClient } from "@zitadel/api/client";const client = createZitadelClient({ baseUrl: process.env.ZITADEL_URL ?? "http://localhost:8080", token: process.env.ZITADEL_PROJECT_SECRET!, // server-side only});await client.removePreview("proj_01KWH1P4MYS7F0N9WD3P2E4YM5", { origin: "https://acme-git-sso-acmeinc.vercel.app" });Example Response
Empty
Was this helpful?