Preview an invite
Módulo Identity
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`.
- Requiere la capacidad me.account.write.
- Alcances de OAuth: me.
- Envía el encabezado Idempotency-Key. Una repetición con la misma clave devuelve la respuesta original.
- Estados de error: 400, 401, 409, 422, 429. Los errores son detalles de problema RFC 9457.
Cuerpo de la solicitud: InviteTokenRequest
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| token | string | Sí | Invite token from the invitation email. Sent in the body, never in a URL.Restricciones: length 1 to any |
{
"token": "xinv_3f9a1c0d7e2b4a6f8c1d0e9b7a5c3f1e"
}Respuesta 200: InvitePreview
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| org_name | string | Sí | Organization the invite joins.Restricciones: length 1 to 300 |
| role_code | string | Sí | Offered role code.Restricciones: pattern ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$ |
| role_name | string | Sí | Offered role name.Restricciones: length 1 to 300 |
| expires_at | string (date-time) | Sí | When the invite expires. |
{
"org_name": "Northwind Live",
"role_code": "member",
"role_name": "Member",
"expires_at": "2026-10-08T14:30:00Z"
}Ejemplos de código
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"}'