Look up an invitation by token
Returns a lean view of the invitation for the signed-in accept page: project, role, inviter and expiry.
Send the plaintext token from the invitation link fragment. Every unknown
or finished token answers the same opaque 404. Authenticate with a
platform-project user session cookie (sessionCookie). Lookup is a read:
same-origin cookie requests need no X-Zitadel-CSRF token (accept and
reject still do).
sessionCookie__Host-zitadel_session<token>The session cookie issued at session creation or superseding handoff exchange.
A browser holds it as __Host-zitadel_session, with Secure. Over plain
http to a loopback host (localhost, 127.0.0.1, ::1) the server sets it
as zitadel_session instead, without Secure or the prefix, so that Safari
keeps it, and accepts that name there too; __Host-zitadel_session takes
precedence. A program sends __Host-zitadel_session over any transport.
A missing or invalid cookie yields 401 with code auth.unauthorized and the message
Missing or invalid session token.
Cross-site request forgery (CSRF) protection: a state-changing request that
this cookie authenticates must come from the same origin. A cross-site
browser request is refused with 403 and code auth.csrf_invalid. Every
such request must also send the session's token from GET /sessions/me/csrf
in the X-Zitadel-CSRF header, or it answers the same 403. The only
exceptions are the POST …/query reads and POST /invitations/lookup,
which need no token. Safe methods (GET) are not checked. A request a
project secret authenticates is not affected.
application/json- body
The redeem token from an invitation link's fragment.
token*stringThe plaintext token from the invitation link fragment. It never appears in
a URL query. Every unknown or finished token gets the same 404.
1 <= lengthThe invitation details for the accept page.
application/json- response
Lean view of a project-member invitation for the accept page: project, role, inviter and expiry.
project_id*project-id^[a-zA-Z0-9_-]+$project_name*stringThe project's display name.
created_by?|The user who created the invitation. Null when a project secret created it.
created_by_type?|What kind of principal created_by names.
inviter?|The user who created the invitation, resolved so the accept page can
name them: render display, falling back to identifier, then
user_id. Null when a project secret created it.
expires_at*stringWhen the invitation expires.
date-timestatus*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"type*"project_member""project_member"project_member*Type-specific input for a project_member invitation.
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);const invitation = await client.lookupInvitation({ token: "string" });{ "project_id": "string", "project_name": "string", "created_by": "string", "created_by_type": "human", "inviter": { "user_id": "string", "identifier": "string", "identifier_property": "string", "display": "string" }, "expires_at": "2019-08-24T14:15:22Z", "status": "pending", "type": "project_member", "project_member": { "relation": "viewer" }}Was this helpful?