Docs

Revoke grant

DELETE
/grants/{id}

Soft-revokes a grant this API manages and emits authz.revoked. Already-revoked, missing, project-secret setup, and owning-team grants return 404. The row is not un-revoked. Expired grants can still be revoked so the unique binding can be reused.

Accepts either a project secret (oauth2) or a user-bound Console session cookie (sessionCookie). Cookie-authenticated requests follow the scheme's CSRF rules (sessionCookie).

Authorization

headerAuthorizationBearer <token>

Scope: project.write

Path Parameters

id*string

Managed assignment id (asgn_<opaque>).

Query Parameters

project_id*string

The unique identifier of the project

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

Response Body

The grant was revoked.

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.deleteGrant("asgn_01KWH9D4R2V7F0N9WD3P2E4YM8", { project_id: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" });
Example Response
Empty

Was this helpful?