Update User Profile
curl --request PUT \
  --url https://api.tensorone.ai/v2/accounts/profile \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "<string>",
  "email": "jsmith@example.com"
}'
{
  "id": "<string>",
  "email": "jsmith@example.com",
  "name": "<string>",
  "role": "basic",
  "tpoBalance": 123,
  "createdAt": "2023-11-07T05:31:56Z"
}
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.
curl -X GET "https://api.tensorone.ai/v2/accounts/profile" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response

{
    "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.
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

{
    "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.
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

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

Update Preferences

Update user preferences and account settings.
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

{
    "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

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

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

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

413 Payload Too Large

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

415 Unsupported Media Type

{
    "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

# 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

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

Team Integration

# 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
)

Authorizations

Authorization
string
header
required

API key authentication. Use 'Bearer YOUR_API_KEY' format.

Body

application/json

Response

200 - application/json

Profile updated successfully

The response is of type object.