Docs

Cancel an invitation

DELETE
/invitations/{invitation_id}

Deletes a pending, expired or rejected invitation, with its metadata. A pending invitation's link can no longer be redeemed. An accepted invitation answers the same opaque 404 as a miss.

Authenticate with a project secret (oauth2) or a console session cookie (sessionCookie). Cancelling needs the same project admin check as createGrant (POST /grants). Cookie requests follow that scheme's CSRF rules.

Authorization

headerAuthorizationBearer <token>

Scope: project.write

Path Parameters

invitation_id*string

The invitation ID (inv_<opaque>): the id that createInvitation (POST /invitations) returns or listInvitations (GET /invitations) lists.

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

Query Parameters

project_id*string

The project ID: the id that createProject (POST /projects) returns. zitadel setup prints it as "Project id" in its summary and as project_id with --json, and writes it to .env.local as ZITADEL_PROJECT_ID.

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

Response Body

The invitation was deleted.

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

Was this helpful?