Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.readingsteps.uk/llms.txt

Use this file to discover all available pages before exploring further.

Users API

The Users API allows you to manage user accounts, profiles, and preferences.

Base URL

https://api.readingsteps.uk/v1/users

Get Current User

Retrieve the authenticated user’s profile information.
GET /users/me
Authorization: Bearer YOUR_ACCESS_TOKEN

Response

{
  "id": "usr_abc123",
  "email": "user@example.com",
  "name": "John Doe",
  "avatar": "https://cdn.readingsteps.uk/avatars/usr_abc123.jpg",
  "reading_level": "intermediate",
  "created_at": "2024-01-15T10:30:00Z",
  "preferences": {
    "font_size": 16,
    "theme": "light",
    "notifications": true
  }
}

Get User by ID

Retrieve a specific user’s public profile.
GET /users/{user_id}
Authorization: Bearer YOUR_ACCESS_TOKEN

Parameters

ParameterTypeRequiredDescription
user_idstringYesThe user’s unique identifier

Response

{
  "id": "usr_abc123",
  "name": "John Doe",
  "avatar": "https://cdn.readingsteps.uk/avatars/usr_abc123.jpg",
  "reading_level": "intermediate",
  "books_read": 42,
  "member_since": "2024-01-15"
}

Update User Profile

Update the authenticated user’s profile information.
PATCH /users/me
Authorization: Bearer YOUR_ACCESS_TOKEN
Content-Type: application/json

{
  "name": "Jane Doe",
  "avatar": "https://example.com/avatar.jpg",
  "preferences": {
    "font_size": 18,
    "theme": "dark"
  }
}

Request Body

FieldTypeRequiredDescription
namestringNoUser’s display name
avatarstringNoURL to user’s avatar image
preferencesobjectNoUser preferences object

Response

{
  "id": "usr_abc123",
  "email": "user@example.com",
  "name": "Jane Doe",
  "avatar": "https://example.com/avatar.jpg",
  "preferences": {
    "font_size": 18,
    "theme": "dark",
    "notifications": true
  }
}

Delete User Account

Permanently delete the authenticated user’s account.
DELETE /users/me
Authorization: Bearer YOUR_ACCESS_TOKEN

Response

{
  "success": true,
  "message": "Account deleted successfully"
}

Get User Reading Stats

Retrieve detailed reading statistics for a user.
GET /users/{user_id}/stats
Authorization: Bearer YOUR_ACCESS_TOKEN

Response

{
  "user_id": "usr_abc123",
  "total_reading_time": 125000,
  "books_completed": 42,
  "pages_read": 12500,
  "average_reading_speed": 250,
  "vocabulary_size": 3500,
  "current_streak": 15,
  "longest_streak": 30
}

Error Responses

All endpoints may return the following errors:
Status CodeErrorDescription
401UnauthorizedInvalid or expired access token
403ForbiddenInsufficient permissions
404Not FoundUser does not exist
422Unprocessable EntityInvalid request data
429Too Many RequestsRate limit exceeded

Example Error Response

{
  "error": {
    "code": "user_not_found",
    "message": "The requested user could not be found",
    "details": {}
  }
}