Skip to main content

PATCH /api/users/me

Update the current user’s profile information, including name and preferences. All fields are optional.

Authentication

This endpoint requires a valid JWT token in the Authorization header.
Authorization: Bearer <token>

Request Body

All fields are optional. Only include the fields you want to update.
firstName
string
User’s first name (minimum 2 characters)
lastName
string
User’s last name (minimum 2 characters)
currency
string
Preferred currency code (exactly 3 characters, e.g., ARS, USD, EUR)
fiscalStartDay
number
Day of month when fiscal period starts (1-28). Used for monthly reports and budget calculations.

Response

Returns the updated user object.
id
string
User UUID
email
string
User’s email address
firstName
string
Updated first name
lastName
string
Updated last name
currency
string
Updated preferred currency
fiscalStartDay
number
Updated fiscal start day

Example Requests

cURL
curl -X PATCH http://localhost:3000/api/users/me \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "firstName": "Jane",
    "lastName": "Smith"
  }'
JavaScript
const response = await fetch('http://localhost:3000/api/users/me', {
  method: 'PATCH',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    firstName: 'Jane',
    lastName: 'Smith',
    currency: 'USD',
    fiscalStartDay: 15
  })
});

const updatedUser = await response.json();

Example Response

{
  "id": "user-uuid-123",
  "email": "[email protected]",
  "firstName": "Jane",
  "lastName": "Smith",
  "currency": "USD",
  "fiscalStartDay": 15,
  "timezone": "America/Argentina/Buenos_Aires",
  "language": "es",
  "role": "USER",
  "isActive": true,
  "subscription": "FREE",
  "createdAt": "2024-01-15T10:00:00.000Z",
  "updatedAt": "2024-01-20T16:45:00.000Z"
}

Validation Rules

  • Must be at least 2 characters long
  • Cannot be empty strings
  • Should contain valid characters
  • Must be exactly 3 characters (ISO 4217 format)
  • Examples: ARS, USD, EUR, GBP, JPY
  • The app supports multi-currency transactions
  • Must be an integer between 1 and 28
  • Day 28 is the maximum to ensure validity across all months
  • Used for monthly budget periods and reports

Error Responses

{
  "statusCode": 400,
  "message": [
    "firstName must be longer than or equal to 2 characters",
    "currency must be longer than or equal to 3 characters"
  ],
  "error": "Bad Request"
}
{
  "statusCode": 401,
  "message": "Unauthorized"
}
{
  "statusCode": 404,
  "message": "User not found"
}

Impact of Currency Change

Changing the preferred currency does NOT convert existing account balances or transaction amounts. The currency field is a user preference that affects:
  • Default currency for new accounts
  • Display formatting in reports
  • Currency selection in the UI

Fiscal Start Day Usage

The fiscalStartDay setting affects:
  • Budget Periods: Budgets are calculated from this day of the month
  • Monthly Reports: Financial summaries use this as the period boundary
  • Dashboard: Month-to-date calculations respect this setting
Example: If fiscalStartDay = 15, January’s budget period runs from Jan 15 to Feb 14.

Get Profile

Retrieve current profile information

Register

Create a new user account

Build docs developers (and LLMs) love