Indexhog - Search indexing and monitoring

User API

Account settings and email identity

1 min read

Manage the authenticated user's account settings. Retrieve email-only identity, schedule deletion, export data, and manage marketing email preferences.

Available Endpoints

MethodEndpointDescription
GET/api/user/meGet current user account
DELETE/api/user/meSchedule account deletion
GET/api/user/me/exportExport user data
GET/api/user/me/login-historyGet login history

Endpoints

GET/api/user/me

Get current user account

Retrieve the authenticated user's account information. Product identity is email-only.

Bearer Token•Scopes: user:read

Request

curl -X GET "https://api.indexhog.com/api/user/me" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"

Response 200

User account retrieved successfully

{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
  "id": "507f1f77bcf86cd799439011",
  "createdAt": "2024-01-01T00:00:00.000Z",
  "updatedAt": "2024-01-15T10:30:00.000Z",
  "email": "[email protected]",
  "isVerified": true,
  "verifiedAt": "2024-01-01T00:05:00.000Z",
  "isActive": true,
  "lastLoginAt": "2024-01-15T09:00:00.000Z",
  "emailPreferences": {
    "marketingOptOut": false
  },
  "twoFactorEnabled": true,
  "organizationCount": 1,
  "role": "user"
}
}

Error Responses

401— Unauthorized - Invalid or missing authentication

{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}

403— Forbidden - Insufficient permissions

{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}
DELETE/api/user/me

Schedule account deletion

Soft-deletes the authenticated user's account with a 30-day grace period, then returns when it is scheduled for permanent deletion. Recoverable within the window. No request body — the client-side type-to-confirm gate is the confirmation, so this works for password and SSO/passwordless accounts alike.

Bearer Token•Scopes: user:write

Request

curl -X DELETE "https://api.indexhog.com/api/user/me" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"

Response 200

Account scheduled for deletion

{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {
  "deletionScheduledFor": "2024-02-15T00:00:00.000Z",
  "message": "string"
}
}

Error Responses

401— Unauthorized - Invalid or missing authentication

{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}

403— Forbidden - Insufficient permissions

{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}
GET/api/user/me/export

Export user data

Export all user data for GDPR compliance. Returns a JSON file with all user data.

Bearer Token•Scopes: user:read

Request

curl -X GET "https://api.indexhog.com/api/user/me/export" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"

Response 200

User data exported successfully

{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": {}
}

Error Responses

401— Unauthorized - Invalid or missing authentication

{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}

403— Forbidden - Insufficient permissions

{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}
GET/api/user/me/login-history

Get login history

Get the authenticated user's login history.

Bearer Token•Scopes: user:read

Request

curl -X GET "https://api.indexhog.com/api/user/me/login-history" -H "Authorization: Bearer YOUR_ACCESS_TOKEN" -H "Content-Type: application/json"

Response 200

Login history retrieved successfully

{
"success": true,
"status": 200,
"code": "OK",
"message": "Operation completed successfully",
"data": [
  {
    "id": "507f1f77bcf86cd799439011",
    "timestamp": "2024-01-15T10:30:00.000Z",
    "action": "auth.login",
    "ipAddress": "192.168.1.1",
    "userAgent": "Mozilla/5.0...",
    "success": true,
    "metadata": {}
  }
]
}

Error Responses

401— Unauthorized - Invalid or missing authentication

{
"success": false,
"status": 401,
"code": "UNAUTHORIZED",
"message": "Authentication required"
}

403— Forbidden - Insufficient permissions

{
"success": false,
"status": 403,
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action"
}