> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorone.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# User Profile Management

> Manage user profile information, avatar uploads, and account preferences

Manage your TensorOne account profile including personal information, avatar, and account preferences. These endpoints allow you to retrieve and update profile data programmatically.

## Get User Profile

Retrieve the current user's profile information.

```bash
curl -X GET "https://api.tensorone.ai/v2/accounts/profile" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

### Response

```json
{
    "id": "usr_1234567890abcdef",
    "email": "user@example.com",
    "name": "John Doe",
    "username": "johndoe",
    "avatar": "https://cdn.tensorone.ai/avatars/usr_1234567890abcdef.jpg",
    "bio": "AI Engineer at TechCorp",
    "location": "San Francisco, CA",
    "website": "https://johndoe.dev",
    "twitter": "@johndoe",
    "github": "johndoe",
    "createdAt": "2024-01-15T10:30:00Z",
    "updatedAt": "2024-03-20T14:15:00Z",
    "verified": true,
    "plan": "pro",
    "preferences": {
        "timezone": "America/Los_Angeles",
        "language": "en",
        "theme": "dark",
        "emailNotifications": true,
        "slackNotifications": false
    }
}
```

## Update User Profile

Update profile information for the current user.

```bash
curl -X PUT "https://api.tensorone.ai/v2/accounts/profile" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "John Smith",
    "bio": "Senior AI Engineer",
    "location": "New York, NY",
    "website": "https://johnsmith.dev",
    "twitter": "@johnsmith"
  }'
```

### Request Schema

```json
{
    "name": "string (optional, 1-100 characters)",
    "bio": "string (optional, max 500 characters)",
    "location": "string (optional, max 100 characters)",
    "website": "string (optional, valid URL)",
    "twitter": "string (optional, Twitter handle)",
    "github": "string (optional, GitHub username)"
}
```

### Response

Returns the updated profile object with the same structure as the GET response.

## Upload Avatar

Upload a new profile avatar image.

```bash
curl -X POST "https://api.tensorone.ai/v2/accounts/profile/avatar" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -F "avatar=@/path/to/avatar.jpg"
```

### Requirements

* **File formats**: JPEG, PNG, GIF
* **Max file size**: 5MB
* **Dimensions**: Minimum 100x100px, maximum 2048x2048px
* **Aspect ratio**: Will be cropped to square

### Response

```json
{
    "avatar": "https://cdn.tensorone.ai/avatars/usr_1234567890abcdef.jpg",
    "message": "Avatar updated successfully"
}
```

## Update Preferences

Update user preferences and account settings.

```bash
curl -X PUT "https://api.tensorone.ai/v2/accounts/profile/preferences" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "timezone": "Europe/London",
    "language": "en",
    "theme": "light",
    "emailNotifications": false,
    "slackNotifications": true
  }'
```

### Request Schema

```json
{
    "timezone": "string (optional, valid IANA timezone)",
    "language": "string (optional, supported: en, es, fr, de, ja, zh)",
    "theme": "string (optional, 'light' or 'dark')",
    "emailNotifications": "boolean (optional)",
    "slackNotifications": "boolean (optional)"
}
```

## Code Examples

### Python SDK

```python
from tensorone import TensorOneAPI

client = TensorOneAPI(api_key="your_api_key")

# Get profile
profile = client.accounts.profile.get()
print(f"Welcome {profile.name}!")

# Update profile
updated_profile = client.accounts.profile.update(
    name="John Smith",
    bio="Senior AI Engineer",
    location="New York, NY"
)

# Upload avatar
with open("avatar.jpg", "rb") as f:
    avatar_result = client.accounts.profile.upload_avatar(f)
    print(f"Avatar URL: {avatar_result.avatar}")

# Update preferences
preferences = client.accounts.profile.update_preferences(
    timezone="Europe/London",
    theme="light",
    emailNotifications=False
)
```

### JavaScript SDK

```javascript
import { TensorOneAPI } from "@tensorone/sdk";

const client = new TensorOneAPI("your_api_key");

// Get profile
const profile = await client.accounts.profile.get();
console.log(`Welcome ${profile.name}!`);

// Update profile
const updatedProfile = await client.accounts.profile.update({
    name: "John Smith",
    bio: "Senior AI Engineer",
    location: "New York, NY",
});

// Upload avatar
const fileInput = document.getElementById("avatar-upload");
const avatarResult = await client.accounts.profile.uploadAvatar(fileInput.files[0]);
console.log(`Avatar URL: ${avatarResult.avatar}`);

// Update preferences
const preferences = await client.accounts.profile.updatePreferences({
    timezone: "Europe/London",
    theme: "light",
    emailNotifications: false,
});
```

## Error Responses

### 400 Bad Request

```json
{
    "error": "VALIDATION_ERROR",
    "message": "Invalid profile data",
    "details": {
        "field": "website",
        "reason": "Must be a valid URL"
    }
}
```

### 413 Payload Too Large

```json
{
    "error": "FILE_TOO_LARGE",
    "message": "Avatar file exceeds maximum size limit",
    "details": {
        "maxSize": "5MB",
        "receivedSize": "8.2MB"
    }
}
```

### 415 Unsupported Media Type

```json
{
    "error": "INVALID_FILE_TYPE",
    "message": "Avatar must be JPEG, PNG, or GIF format",
    "details": {
        "allowedTypes": ["image/jpeg", "image/png", "image/gif"],
        "receivedType": "image/webp"
    }
}
```

## Best Practices

### Profile Updates

* Keep profile information current for better collaboration
* Use professional avatar images for business accounts
* Include relevant contact information to help team members connect

### Security Considerations

* Profile information is visible to team members and collaborators
* Avoid including sensitive information in bio or public fields
* Regularly review and update privacy preferences

### Avatar Guidelines

* Use high-quality images for best results
* Square images work best (will be cropped if not square)
* Consider using consistent branding across your organization

## Use Cases

### Personal Branding

```python
# Set up professional profile for new team member
client.accounts.profile.update(
    name="Alice Johnson",
    bio="ML Engineer specializing in computer vision",
    location="Seattle, WA",
    website="https://alice-ml.dev",
    github="alice-johnson"
)
```

### Localization Setup

```python
# Configure preferences for international user
client.accounts.profile.update_preferences(
    timezone="Asia/Tokyo",
    language="ja",
    theme="dark"
)
```

### Team Integration

```python
# Update profile with team collaboration tools
client.accounts.profile.update(
    twitter="@alice_ml",
    github="alice-johnson"
)

# Enable notifications for team coordination
client.accounts.profile.update_preferences(
    emailNotifications=True,
    slackNotifications=True
)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.