Skip to content

Commit 92d588f

Browse files
committed
docs: clarify verify endpoint payloads
1 parent be317c1 commit 92d588f

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

README.md

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,17 +1106,32 @@ Returns:
11061106

11071107
### **POST /verify**
11081108

1109-
Verify a registration or a password recovery. Type can be `signup`, `recovery`, `invite`, `magiclink`, `email_change`, `sms`, or `phone_change`
1110-
and the `token` is a token returned from either `/signup` or `/recover`.
1109+
Verify a registration, password recovery, magic link, email change, or phone
1110+
OTP. Type can be `signup`, `recovery`, `invite`, `magiclink`, `email`,
1111+
`email_change`, `sms`, or `phone_change`.
1112+
1113+
For a raw OTP code, send `token` with exactly one of `email` or `phone`.
1114+
Email-based verification types require `email`; phone-based verification types
1115+
(`sms` and `phone_change`) require `phone`.
11111116

11121117
```json
11131118
{
11141119
"type": "signup",
1115-
"token": "confirmation-code-delivered-in-email"
1120+
"token": "confirmation-code-delivered-in-email",
1121+
"email": "email@example.com"
11161122
}
11171123
```
11181124

1119-
`password` is required for signup verification if no existing password exists.
1125+
For email links that provide a token hash, send `token_hash` instead of
1126+
`token`. Do not include `email`, `phone`, or `redirect_to` when using
1127+
`token_hash`.
1128+
1129+
```json
1130+
{
1131+
"type": "signup",
1132+
"token_hash": "confirmation-token-hash-delivered-in-email-link"
1133+
}
1134+
```
11201135

11211136
Returns:
11221137

0 commit comments

Comments
 (0)