Get an invitation
Returns one invitation by ID for the project named by project_id.
The response never includes the redeem token or the create-time link.
Authenticate with a project secret (oauth2) or a console session cookie
(sessionCookie). Reading needs the same project admin check as
createGrant (POST /grants).
AuthorizationBearer <token>Scope: project.write
invitation_id*stringThe invitation ID (inv_<opaque>): the id that createInvitation
(POST /invitations) returns or listInvitations (GET /invitations) lists.
^[a-zA-Z0-9_-]+$project_id*stringThe 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.
^[a-zA-Z0-9_-]+$The invitation.
application/json- response
An invitation that grants a project role (viewer, editor or admin) to
whoever redeems its link.
id*invitation-idThe invitation ID (inv_<opaque>): the id that createInvitation
(POST /invitations) returns or listInvitations (GET /invitations) lists.
^[a-zA-Z0-9_-]+$project_id*project-id^[a-zA-Z0-9_-]+$metadata?|Who the administrator said the link is for. Null after accept; a decline keeps it. Cancel and replace delete the row.
status*InvitationStatusLifecycle status of the invitation. expired is derived on read from
expires_at; accepted and rejected are final. Cancel and replace delete
the row rather than leaving a cancelled status.
"pending""accepted""rejected""expired"created_by?|The user who created the invitation. Null when a project secret created
it (created_by_type is then service).
created_by_type?|What kind of principal created_by names.
created_at*stringWhen the invitation was created.
date-timeexpires_at*stringWhen the invitation expires (72 hours after create).
date-timejourney_id*stringCorrelates this invitation with its replacements. A replacement keeps the
original's journey_id. It is a random correlation id, not a resource id.
1 <= lengthresponded_by?|The user who accepted or declined the link; status says which. Null
while the invitation is pending or expired.
responded_at?|When the invitation was accepted or declined. Null while it is pending or expired.
inviter?|The user who created the invitation, resolved for display: render
display, falling back to identifier, then user_id. Present only
when listInvitations is called with expand=inviter; null when a
project secret created the invitation.
type*"project_member""project_member"project_member*Type-specific input for a project_member invitation.
import { configureZitadel, getApi } from "@zitadel/api/config";// In the browser, through the SDK proxy: the session cookie authenticates the call.const client = getApi(configureZitadel({ projectId: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" }));const invitation = await client.getInvitation( "inv_01JD3B7K2M9P4R6T8V0X2Z4C6E", { project_id: "proj_01KWH1P4MYS7F0N9WD3P2E4YM5" },);{ "id": "string", "project_id": "string", "metadata": { "name": "string" }, "status": "pending", "created_by": "string", "created_by_type": "human", "created_at": "2019-08-24T14:15:22Z", "expires_at": "2019-08-24T14:15:22Z", "journey_id": "string", "responded_by": "string", "responded_at": "2019-08-24T14:15:22Z", "inviter": { "user_id": "string", "identifier": "string", "identifier_property": "string", "display": "string" }, "type": "project_member", "project_member": { "relation": "viewer" }}Was this helpful?