SuperAI Flow Platform

Sections

Theme switcher

Update current user profile

Update the currently authenticated user's profile information.

Allows users to modify their personal information including first and last name. Only the fields provided in the request body will be updated. Omitted fields remain unchanged. The user is automatically identified from their authentication credentials.

Context: - Only first_name and last_name can be updated via this endpoint - Password field in request body is reserved for future use (not implemented) - Email, role, status, and organization cannot be changed by users - Updates are immediate and reflected in database upon success - Full user profile returned in response with updated values

Behavior: 1. Extracts user_id from authenticated user context 2. Validates request body fields (min/max length constraints) 3. Queries database to verify user exists 4. Updates only first_name and last_name if provided 5. Persists changes to database with updated_at timestamp 6. Returns complete updated user profile

Use Cases: - User wants to correct misspelled name - User prefers different name display (nickname vs full name) - User changes last name after marriage or legal name change - Profile updates during onboarding or account setup - Internationalization of name display

Field Update Rules: - first_name: 1-100 characters if provided, unchanged if null - last_name: 1-100 characters if provided, unchanged if null - password: Not currently implemented, reserved for future use - All other fields (email, role, status): Use admin endpoints to modify

Related Endpoints: - GET /profile/me - Retrieve current user profile - PUT /admin/users/{user_id} - Admin endpoint to update any user - POST /auth/change-password - Change password (separate auth flow)

Header Parameters

Authorizationstring

Body Parameters

first_namenull
Min length
1
Max length
100
last_namenull
Min length
1
Max length
100
passwordnull
Min length
8
Max length
128

Response

200
Object
User profile updated successfully with new values

Response Attributes

created_atstring
emailstring Required
first_namestring Required
idstring
last_namestring Required
modified_bystring
organization_idstring Required
rolestring
Default value
app_user
Enum values:
org_adminbackofficeapp_userintegration
statusstring
Default value
pending
Enum values:
pendingactiveinactive
updated_atstring
user_auth_idnull
401
Object
Unauthorized - Missing or invalid authentication credentials

Response Attributes

errorobject Required

Standard error detail structure.

This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.

Show child attributes

request_idnull
404
Object
User account not found in database despite valid authentication token

Response Attributes

errorobject Required

Standard error detail structure.

This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.

Show child attributes

request_idnull
422
Object
Unprocessable Entity - Request validation failed

Response Attributes

errorobject Required

Standard error detail structure.

This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.

Show child attributes

request_idnull
500
Object
Internal Server Error - An unexpected error occurred

Response Attributes

errorobject Required

Standard error detail structure.

This model matches the error format returned by the centralized exception handlers in app/api/errors/handlers.py.

Show child attributes

request_idnull
Was this section helpful?

What made this section unhelpful for you?

PUT

/

Select
1

Response

Was this section helpful?

What made this section unhelpful for you?

View as Markdown

Ask an AI

Open in ChatGPTOpen in ClaudeOpen in Perplexity

Code with AI

Open in Copilot