Send a verification code
POST /fapi/v1/verifications · called from the environment's sign-in host
Sends a message with a 6-digit code and a verification link to one of the authenticated user's unverified email addresses, and returns the id of the code attempt. The user types the code with Enter a verification code, or opens the link. Both are valid for 10 minutes. A new message replaces the address's open verification: the code and link of an earlier message stop working. No re-authentication is needed, because only the address's mailbox receives the code. Requires the authenticated user's __Host-idp_session cookie; if the cookie is missing, expired, or revoked, returns 401 unauthenticated. A first-party app on another origin can instead send its front API access token (Authorization: DPoP <token> with a DPoP proof; see Front API access token).
Request
Headers:
| Header | Required | Description |
|---|---|---|
Idp-Client |
yes | SDK identifier. |
Origin |
yes | Must be exactly https://<sign-in host>. |
Content-Type |
yes | application/json. |
Body:
| Field | Type | Required | Description |
|---|---|---|---|
email_id |
string (UUID) | yes | The address's id from List email addresses. |
Response
202 Accepted:
| Field | Type | Description |
|---|---|---|
id |
string (UUID) | The code attempt's id, used in the :attempt path. It is not a secret. |
expires_at |
string (RFC 3339) | When the code and link stop working. |
{"id": "0190a5c4-1b2c-7d3e-8f40-5162738400ff", "expires_at": "2026-10-12T10:10:00Z"}
Errors
| Status | Code | When |
|---|---|---|
| 400 | malformed_request |
The body is not valid JSON. |
| 400 | unknown_field |
The body has a field other than email_id. |
| 401 | unauthenticated |
No valid session cookie. |
| 403 | origin_not_allowed |
Origin is missing or wrong. |
| 404 | not_found |
email_id is not one of the user's addresses. |
| 409 | conflict |
The address is already verified. |
| 413 | payload_too_large |
The body is too large. |
| 415 | unsupported_media_type |
Content-Type is not application/json. |
| 422 | validation_failed |
email_id is missing. |
| 429 | verification_rate_limited |
5 verification messages were sent to this address in the last hour, including the one sent when it was added; try again later. |
Example
curl -X POST https://example.keenauth.app/fapi/v1/verifications \
-H "Idp-Client: my-app/1.0.0 (node/22.0.0)" \
-H "Origin: https://example.keenauth.app" \
-H "Content-Type: application/json" \
-b cookies.txt \
-d '{"email_id": "0190a5c4-1b2c-7d3e-8f40-516273849abc"}'
Personal data
This endpoint carries personal data: end-user profile. Personal data in the KeenAuth APIs describes what is stored, how long it is kept and how it is deleted. Do not send special categories of personal data (health, biometric data, religion, political opinions, sexual orientation) in any field.