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

# User Attributes

> [!NOTE]
>
> **Prerequisites** \\
>
> Tracking needs to be enabled during SDK initialization for this feature to work.
> Set `CastledConfigs.enableTracking` to `true` to start tracking.

Castled SDK provides methods that lets you create or update user profiles within your data warehouse.
User profile attributes can be one of the predefined attributes or any custom attribute of your choosing.

Following are the list of predefined user attributes avaliable for use when updating user profiles

1. **First Name**
2. **Last Name**
3. **Email**
4. **Name**
5. **Date of Birth**
6. **Gender**
7. **Phone Number**
8. **City**
9. **Country**

`CastledNotifications.setUserAttributes` method can be used to update user profile attributes.

> Custom attribute values can be of type `number`, `boolean`, `string` or `date`.

```kotlin
CastledUserAttributes userAttributes = new CastledUserAttributes();
// Predefined attributes
userAttributes.setFirstName("John");
userAttributes.setLastName("Doe");
userAttributes. setCity("Sanfrancisco");
userAttributes.setCountry("US");
userAttributes.setEmail("jdoe@email.com");
userAttributes.setDOB("02-01-1995");
userAttributes.setGender("M");
userAttributes.setPhone("+13156227533");
// Custom Attributes
userAttributes.setCustomAttribute("prime_member", true);
userAttributes.setCustomAttribute("occupation", "artist");

CastledNotifications.setUserAttributes(userAttributes)
```

> [!WARNING]
>
> Before updating user attributes make sure to set the user-id using
> `CastledNotifications.setUserId`.


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