<@U04UQ68083H> is there API on ory kratos to resen...
# ory-copilot
n
@chilly-king-10285 is there API on ory kratos to resend email invitation, in case the invitation was expired?
b
A message from kapa.ai
Based on the knowledge sources, there isn't a specific API endpoint in Ory Kratos dedicated to resending expired email invitations. However, there are related functionalities that can be used to achieve this: For user invitations in Ory, the process involves: 1. Creating a user account 2. Triggering account recovery for that account 3. Sending the recovery link to the user If an invitation (recovery link) expires, you would need to generate a new recovery link using the admin API. According to the documentation on inviting users:
Copy code
curl --request POST -sL \      --header "Authorization: Bearer {ORY_API_KEY}" \      --header "Content-Type: application/json" \      --data '{      "expires_in": "12h",      "identity_id": "$ACCOUNT_ID"      }' https://{project-slug}.<http://projects.oryapis.com/admin/recovery/link|projects.oryapis.com/admin/recovery/link>
This endpoint creates a new recovery link that you can send to the user, effectively "resending" the invitation [Invite users](https://www.ory.sh/docs/kratos/manage-identities/invite-users). For other flows like recovery and verification, Kratos does support resending codes through the
resend
parameter: 1. For login flows, there's a
resend
parameter in the code method:
Copy code
'resend': {'description': 'Resend is set when the user wants to resend the code', 'type': 'string'}
2. For registration flows, there's also a
resend
parameter:
Copy code
'resend': {'description': 'Resend restarts the flow with a new code', 'type': 'string'}
The UI typically shows a "Resend code" button (message ID 1070008) for these flows. If you're specifically dealing with expired invitations in Ory Cloud, there was a reported issue about infinite redirect loops with expired invites, which has been addressed, but the solution was to request a new invite rather than resending the expired one.