Skip to main content
GET
/
users
Get User
curl --request GET \
  --url https://api.example.com/users
{
  "id": "<string>",
  "email": "<string>",
  "notification_preference": "<string>",
  "created_at": "<string>",
  "updated_at": "<string>"
}

Overview

Retrieve the currently authenticated user’s profile, including their email and notification preferences.

Authentication

This endpoint requires:
  • Valid session cookie
  • CSRF token (not required for GET requests)
The user ID is automatically extracted from the session.

Request

curl -X GET http://localhost:8080/users \
  -H "Cookie: session=<session_cookie>"

Response

id
string
required
Unique identifier for the user
email
string
required
User’s email address
notification_preference
string
required
User’s notification preference settingOptions:
  • ALL - Receive all notifications
  • FAILURES_ONLY - Only receive failure notifications
  • NONE - No notifications
created_at
string
required
Timestamp when the user account was created (RFC3339 format)
updated_at
string
required
Timestamp when the user account was last updated (RFC3339 format)

Example Response

{
  "id": "01JGXYZ1234567890ABCDEF",
  "email": "user@example.com",
  "notification_preference": "FAILURES_ONLY",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-03-01T14:22:00Z"
}

Error Responses

Status CodeDescription
400User ID not found in session
401Invalid or expired session
404User not found
500Internal server error

Build docs developers (and LLMs) love