Preview an invite
Identity module
POST/invites/previewinvites.preview
Shows the organization, role and expiry an invite offers, only to the confirmed sign-in it was sent to, through `app.preview_invite`. An invalid, expired, locked or mismatched token returns a 422 `REFUSE` with its reason; repeated failures rate-limit the caller. Requires `Idempotency-Key`; a replay returns the original response. A rule that refuses the request returns 422 with `refusal` and `reason`.
- Requires the capability me.account.write.
- OAuth scopes: me.
- Send an Idempotency-Key header. A replay with the same key returns the original response.
- Error statuses: 400, 401, 409, 422, 429. Errors are RFC 9457 problem details.
Request body: InviteTokenRequest
| Field | Type | Required | Description |
|---|---|---|---|
| token | string | Yes | Invite token from the invitation email. Sent in the body, never in a URL.Constraints: length 1 to any |
{
"token": "xinv_3f9a1c0d7e2b4a6f8c1d0e9b7a5c3f1e"
}Response 200: InvitePreview
| Field | Type | Required | Description |
|---|---|---|---|
| org_name | string | Yes | Organization the invite joins.Constraints: length 1 to 300 |
| role_code | string | Yes | Offered role code.Constraints: pattern ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$ |
| role_name | string | Yes | Offered role name.Constraints: length 1 to 300 |
| expires_at | string (date-time) | Yes | When the invite expires. |
{
"org_name": "Northwind Live",
"role_code": "member",
"role_name": "Member",
"expires_at": "2026-10-08T14:30:00Z"
}Code samples
curl -X POST "$XOS_BASE_URL/invites/preview" \
-H "Authorization: Bearer $XOS_API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{"token":"xinv_3f9a1c0d7e2b4a6f8c1d0e9b7a5c3f1e"}'const { data } = await xos.invites.preview({
"token": "xinv_3f9a1c0d7e2b4a6f8c1d0e9b7a5c3f1e"
});response = xos.invites.preview({"token": "xinv_3f9a1c0d7e2b4a6f8c1d0e9b7a5c3f1e"})xos invites preview --data '{"token":"xinv_3f9a1c0d7e2b4a6f8c1d0e9b7a5c3f1e"}'