API ReferenceAuth Flows
Submit Verification
Submit a verification code to confirm an email address or phone number.
Endpoint
POST /v1/flows/verification/{flow_id}:submitBase URL: https://api-id.avnology.net
Authentication: None required (CSRF token in body)
Verification is a two-step process:
- First submission: Send the email address to trigger a verification code delivery
- Second submission: Submit the received code to complete verification
Request
Step 1: Request Verification Code
The response returns an updated flow with a code input field and a message confirming the email was sent.
Step 2: Submit Verification Code
curl -X POST "https://api-id.avnology.net/v1/flows/verification/b2c3d4e5-f6a7-8901-bcde-f12345678901:submit" \
-H "Content-Type: application/json" \
-d '{
"method": "code",
"body": {
"code": "847291",
"csrf_token": "dG9rZW4..."
}
}'Response
Success -- Email Verified
{
"continue_flow": {
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"type": "verification",
"state": "passed_challenge",
"ui": {
"messages": [
{ "id": "1080002", "text": "Your email address has been verified successfully.", "type": "success" }
]
Errors
| Status | Code | Description |
|---|---|---|
| 400 | AVNOLOGY_AUTH_009 | Flow expired |
| 400 | AVNOLOGY_AUTH_007 | Invalid verification code |
| 429 | AVNOLOGY_AUTH_021 | Rate limit exceeded |
Code Examples
JavaScript (fetch)
// Step 1: Request code
async function requestVerificationCode(flowId, email, csrfToken) {
return fetch(`https://api-id.avnology.net/v1/flows/verification/${flowId}:submit`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON
Python (httpx)
import httpx
def request_verification(flow_id: str, email: str, csrf_token: str) -> dict:
return httpx.post(
f"https://api-id.avnology.net/v1/flows/verification/{flow_id}
Go (net/http)
func submitVerification(ctx context.Context, flowID, code, csrfToken string) (*AuthFlowResult, error) {
body
Related
- Create Verification Flow -- initiate verification
- SDK:
client.auth.verifyEmail(code)(TypeScript)