Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 57 additions & 1 deletion docs/authenticate/api/30-profile-api.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,59 @@
# Profile API

TODO.
The Profile API handles individual user data management. It allows users to view their dashboard settings, update their account passwords, or configure security keys.

To tell the server what you want to do, your request body must include a `"kind"` key specifying your exact operation.

### Fetching User Profile Information

Use this endpoint to grab the active user's account details and metadata.

* **Method:** `POST`
* **Endpoint Path:** `/api/profile`
* **Content Type:** `application/json`

#### What to send in the request body:
```json
{
"kind": "fetch_user_info"
}
```

#### What a successful response looks like (200 OK):
```json
{
"status": "success",
"user_info": {
"username": "developer_user",
"email": "user@example.com",
"name": "Alex Smith"
},
"timestamp": "2026-06-28T19:30:00Z"
}
```

---

### Updating a User Password

Use this configuration to securely update an active user account password.

* **Method:** `POST`
* **Endpoint Path:** `/api/profile`

#### What to send in the request body:
```json
{
"kind": "update_user_password",
"current_password": "old_password_123",
"new_password": "secure_new_password_456"
}
```

#### What a successful response looks like (200 OK):
```json
{
"status": "success",
"message": "Password changed successfully."
}
```