Docs

Get an invitation

GET
/invitations/{invitation_id}

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).

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.

application/json
  1. response

An invitation that grants a project role (viewer, editor or admin) to whoever redeems its link.

id*invitation-id

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

Match^[a-zA-Z0-9_-]+$
project_id*project-id
Match^[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*InvitationStatus

Lifecycle 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.

Value in"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*string

When the invitation was created.

Formatdate-time
expires_at*string

When the invitation expires (72 hours after create).

Formatdate-time
journey_id*string

Correlates this invitation with its replacements. A replacement keeps the original's journey_id. It is a random correlation id, not a resource id.

Length1 <= length
responded_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"
Value in"project_member"
project_member*

Type-specific input for a project_member invitation.

Example Request
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" },);
Example Response
{  "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?