User Profile

Retrieve and update the authenticated user's profile, including personal details and subscription information.

Get User Profile

Retrieve the complete profile of the currently authenticated user, including account details, personal information, and active subscription status.

GET/api/v1/users/me

Get the authenticated user's full profile

Authentication:Bearer Token

Response Fields

The response contains three main sections:

SectionDescription
userCore account information including ID, role, and status
profilePersonal details such as name, phone, and address
subscriptionActive subscription plan, expiry, and device limits
curl -X GET https://api.orbai.world/api/v1/users/me \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
200User profile retrieved successfully
{
  "success": true,
  "data": {
    "user": {
      "id": 12345,
      "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "username": "johndoe",
      "email": "john@example.com",
      "role": "user",
      "active": true,
      "enabled": true,
      "auto_renew": true,
      "country": "US",
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2026-02-01T14:22:00Z"
    },
    "profile": {
      "first_name": "John",
      "last_name": "Doe",
      "phone": "+1-555-0100",
      "address": "123 Main Street",
      "city": "San Francisco",
      "state": "CA",
      "country": "US",
      "postal_code": "94102",
      "locale": "en-US",
      "language": "en",
      "birth_date": "1990-05-15",
      "telegram_chat_id": "987654321",
      "telegram_username": "johndoe_tg"
    },
    "subscription": {
      "plan_name": "Premium",
      "status": "active",
      "expires_at": "2026-06-15T00:00:00Z",
      "max_devices": 10,
      "days_remaining": 127
    }
  }
}
401Authentication required or token expired
{
  "success": false,
  "error": {
    "code": "UNAUTHORIZED",
    "message": "Invalid or expired access token"
  }
}

Update User Profile

Update the authenticated user's profile information. All fields are optional; only the fields you include in the request body will be updated.

PUT/api/v1/users/me

Update the authenticated user's profile

Authentication:Bearer Token
ParameterTypeRequiredDescription
countrystringOptionalTwo-letter ISO country code (e.g., US, DE, JP)
fcm_tokenstringOptionalFirebase Cloud Messaging token for push notifications
auto_renewbooleanOptionalEnable or disable automatic subscription renewal
wallet_addressstringOptionalBlockchain wallet address for token rewards
first_namestringOptionalUser's first name
last_namestringOptionalUser's last name
display_namestringOptionalPublic display name shown in the app
phonestringOptionalPhone number in international format
addressstringOptionalStreet address
citystringOptionalCity name
statestringOptionalState or province
postal_codestringOptionalZIP or postal code
localestringOptionalLocale code for regional formatting (e.g., en-US, de-DE)
telegram_usernamestringOptionalTelegram username for notifications integration
birth_datestringOptionalDate of birth in YYYY-MM-DD format
curl -X PUT https://api.orbai.world/api/v1/users/me \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "first_name": "John",
    "last_name": "Doe",
    "city": "San Francisco",
    "state": "CA",
    "country": "US",
    "auto_renew": true,
    "telegram_username": "johndoe_tg"
  }'
200Profile updated successfully
{
  "success": true,
  "data": {
    "user": {
      "id": 12345,
      "uuid": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "username": "johndoe",
      "email": "john@example.com",
      "role": "user",
      "active": true,
      "enabled": true,
      "auto_renew": true,
      "country": "US",
      "created_at": "2025-01-15T10:30:00Z",
      "updated_at": "2026-02-08T09:15:00Z"
    },
    "profile": {
      "first_name": "John",
      "last_name": "Doe",
      "phone": "+1-555-0100",
      "address": "123 Main Street",
      "city": "San Francisco",
      "state": "CA",
      "country": "US",
      "postal_code": "94102",
      "locale": "en-US",
      "language": "en",
      "birth_date": "1990-05-15",
      "telegram_chat_id": "987654321",
      "telegram_username": "johndoe_tg"
    }
  }
}
400Invalid request parameters
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Invalid country code. Must be a valid ISO 3166-1 alpha-2 code."
  }
}

Partial Updates

You do not need to send all fields when updating your profile. Only include the fields you want to change. Omitted fields will retain their current values.