Docs

Look up an invitation by token

POST
/invitations/lookup

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

Authorization

sessionCookie
cookie__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.

Request Body

application/json
  1. body

The redeem token from an invitation link's fragment.

token*string

The plaintext token from the invitation link fragment. It never appears in a URL query. Every unknown or finished token gets the same 404.

Length1 <= length

Response Body

The invitation details for the accept page.

application/json
  1. response

Lean view of a project-member invitation for the accept page: project, role, inviter and expiry.

project_id*project-id
Match^[a-zA-Z0-9_-]+$
project_name*string

The 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*string

When the invitation expires.

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