Docs

Remove an origin pattern

POST
/projects/{project_id}/origins/remove

Removes one origin pattern from the project's origins.

Requests from URLs only that pattern admitted are refused from then on. Live previews and deployment history are untouched. Removing the last pattern leaves an empty list, which admits no origin except a loopback origin. Removing a pattern that is already absent is idempotent and answers 204.

The body's pattern is a pattern addProjectOrigin (POST /projects/{project_id}/origins) stored.

Authorization

headerAuthorizationBearer <token>

Scope: origin.delete

Path Parameters

project_id*string

The project ID: the id that createProject (POST /projects) returns, which zitadel setup also prints as project_id.

Match^[a-zA-Z0-9_-]+$

Request Body

application/json
  1. body
pattern*string

The origin pattern exactly as stored on the project: the string that createProject (POST /projects), getProject (GET /projects/{project_id}) or addProjectOrigin (POST /projects/{project_id}/origins) returns.

Response Body

The pattern was removed.

Example Request
import { configureZitadel, getApi } from "@zitadel/api/config";import { setApiCsrfToken } from "@zitadel/api/runtime/auth";// In the browser, through the SDK proxy: the session cookie authenticates the call.const client = getApi(configureZitadel({ projectId: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" }));// A write the session cookie authenticates carries the session's CSRF token.setApiCsrfToken((await client.getMySessionCsrfToken()).csrf_token);await client.removeProjectOrigin("proj_01KWH1P4MYS7F0N9WD3P2E4YM5", { pattern: "string" });
Example Response
Empty

Was this helpful?