User Management
Manage user profiles, passwords, email addresses, and active sessions.
User Profile and Account Management
Manage your user profile information, security settings, and active sessions.
Update User Profile
PUT /api/user/profile
Updates the authenticated user's profile information. Email changes require a separate verification flow (see below).
Request Body
{
"firstName": "Jane",
"lastName": "Smith"
}Parameters
| Field | Type | Required | Description |
|---|---|---|---|
firstName | string | No | User's first name |
lastName | string | No | User's last name |
Example
curl -sS -X PUT \
-H 'X-API-Key: <YOUR_PAT>' \
-H 'Content-Type: application/json' \
-d '{"firstName":"Jane","lastName":"Smith"}' \
'https://api.sieve.godel-labs.ai/api/user/profile'Response (200)
{
"id": "usr_123456",
"email": "jane.smith@example.com",
"firstName": "Jane",
"lastName": "Smith",
"avatarUrl": null,
"role": "user",
"createdAt": "2026-01-10 08:00:00"
}Email Change
Email changes are a two-step process: request a code to the new address, then verify it.
Request Email Change
POST /api/user/email-change/request
Sends a 6-digit OTP to the new email address.
Request Body
{
"newEmail": "newemail@example.com"
}Example
curl -sS -X POST \
-H 'X-API-Key: <YOUR_PAT>' \
-H 'Content-Type: application/json' \
-d '{"newEmail":"newemail@example.com"}' \
'https://api.sieve.godel-labs.ai/api/user/email-change/request'Response (200)
{
"success": true,
"message": "A verification code has been sent to your new email address."
}Verify Email Change
POST /api/user/email-change/verify
Confirms the OTP and updates the user's email address.
Request Body
{
"newEmail": "newemail@example.com",
"code": "482913"
}| Field | Type | Required | Description |
|---|---|---|---|
newEmail | string | Yes | The new email address |
code | string | Yes | 6-digit OTP sent to newEmail |
Example
curl -sS -X POST \
-H 'X-API-Key: <YOUR_PAT>' \
-H 'Content-Type: application/json' \
-d '{"newEmail":"newemail@example.com","code":"482913"}' \
'https://api.sieve.godel-labs.ai/api/user/email-change/verify'Response (200)
{
"success": true,
"message": "Email address updated successfully.",
"user": {
"id": "usr_123456",
"email": "newemail@example.com",
"firstName": "Jane",
"lastName": "Smith",
"avatarUrl": null,
"role": "user",
"createdAt": "2026-01-10 08:00:00"
}
}Change Password
PUT /api/user/password
Changes the authenticated user's password. All active sessions are revoked on success.
Request Body
{
"currentPassword": "OldPassword123!",
"newPassword": "NewSecurePassword456!"
}| Field | Type | Required | Description |
|---|---|---|---|
currentPassword | string | Conditional | Required if the account already has a password set. OAuth-only users may omit this when setting a password for the first time. |
newPassword | string | Yes | New password (minimum 8 characters) |
Example
curl -sS -X PUT \
-H 'X-API-Key: <YOUR_PAT>' \
-H 'Content-Type: application/json' \
-d '{"currentPassword":"old","newPassword":"newsecure123"}' \
'https://api.sieve.godel-labs.ai/api/user/password'Response (200)
{
"success": true,
"message": "Password updated successfully. Please login again with your new password."
}Changing your password revokes all active sessions. You will need to re-authenticate.
List Active Sessions
GET /api/user/sessions
Retrieves all active sessions for the authenticated user.
Example
curl -sS \
-H 'X-API-Key: <YOUR_PAT>' \
'https://api.sieve.godel-labs.ai/api/user/sessions'Response (200)
{
"sessions": [
{
"id": "sess_abc123",
"ipAddress": "192.168.1.100",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)...",
"createdAt": "2026-02-14 08:00:00",
"expiresAt": "2026-02-21 08:00:00"
}
]
}Revoke Session
DELETE /api/user/sessions/:id
Revokes a specific active session. Useful for signing out from a remote device.
Example
curl -sS -X DELETE \
-H 'X-API-Key: <YOUR_PAT>' \
'https://api.sieve.godel-labs.ai/api/user/sessions/sess_abc123'Response (200)
{
"success": true,
"message": "Session revoked successfully"
}