# Verify Email div strong πŸ”¨ In Development β€” This section is still being developed and may change. Verify a user's email address for both registration and login flows using a one-time 4-digit code. Successful requests return access and refresh tokens. ## Authentication - `Content-Type: application/json` ## Request body | Field | Type | Required | Description | | --- | --- | --- | --- | | `email_key` | string | **Yes** | Verification key returned by registration or login initiation. | | `verification_code` | integer | **Yes** | 4-digit code sent to the user’s email. | | `is_register` | boolean | **Yes** | `true` for registration verification, `false` for login verification. | | `device_info` | object | No | Additional device metadata for security tracking. | - **`device`** β€” Device name (e.g., `Chrome Browser`) - **`platform`** β€” One of: `web`, `mobile`, `desktop`, `tablet`, `unknown` - **`operating_system`** β€” OS name and version - **`device_id`** β€” Unique identifier for the device - **`location`** β€” Human-readable location - **`latitude`** β€” Latitude coordinate - **`longitude`** β€” Longitude coordinate ## Returns A JSON object containing JWT access/refresh tokens, device info, and user details. Registration Verification ```bash curl -X POST "https://api.freddy.aitronos.com/v1/auth/verify" \ -H "Content-Type: application/json" \ -d '{ "email_key": "uuid-12345678-1234-1234-1234-123456789abc", "verification_code": 1234, "is_register": true, "device_info": { "device": "Chrome Browser", "platform": "web", "operating_system": "macOS 14.1", "device_id": "device-123" } }' ``` Login Verification ```bash curl -X POST "https://api.freddy.aitronos.com/v1/auth/verify" \ -H "Content-Type: application/json" \ -d '{ "email_key": "uuid-12345678-1234-1234-1234-123456789abc", "verification_code": 5678, "is_register": false }' ``` Response ```json { "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "token_type": "bearer", "expires_in": 3600, "device_id": "device-123", "user": { "id": "usr_abc123def456", "email": "user@example.com", "verified": true } } ``` Error Response ```json { "detail": "Invalid verification code" } ``` ## Related resources - [Login](/docs/api-reference/authentication/login/login) - [Refresh token](/docs/api-reference/authentication/login/refresh) - [Logout](/docs/api-reference/authentication/login/logout)