> For the complete documentation index, see [llms.txt](https://cylexdev.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cylexdev.gitbook.io/docs/cylex-phone/exports-and-events/server-exports/phone-data.md).

# Phone Data

#### getUserData <a href="#user-content-getuserdata" id="user-content-getuserdata"></a>

```lua
-- identifier: string - target identifier
-- return: table | false

-- Returns a table containing:
-- "identifier" (string)
-- "firstname" (string)
-- "lastname" (string)
-- "phoneNumber" (string)
-- "iban" (string)
-- "picture" (string)
-- "lastOnline" (number)
-- "notification_sound" (string)
-- "ringtone_sound" (string)
-- "selectedLockBackground" (string)
-- "selectedHomeBackground" (string)
-- "airplane" (boolean)
-- "silentMode" (boolean) 
-- "faceid" (boolean)
-- "wifi" (boolean)
-- "bluetooth" (boolean)
-- "blacklisted" (boolean)
-- "notification" (boolean)
-- "setup" (boolean)
-- "job" (table)
-- "contacts" (table)
-- "notes" (table)
-- "recentCalls" (table)
-- "mails" (table)
-- "clockData" (table)
-- "blocked_numbers" (table)
-- "darkchat" (table)
-- "selectedAccounts" (table)
-- "pendingNotifications" (table)

local userData = exports['cylex_phone']:getUserData(identifier)
```

#### setUserData <a href="#user-content-setuserdata" id="user-content-setuserdata"></a>

```lua
-- identifier: string - target identifier
-- key: string - data key to update
-- value: any - new value
-- return: boolean

-- Keys you can safely update: 
-- "firstname" (string)
-- "lastname" (string)
-- "phoneNumber" (string) 
-- "iban" (string)
-- "picture" (string)
-- "selectedLockBackground" (string)
-- "selectedHomeBackground" (string)
-- "airplane" (boolean)
-- "silentMode" (boolean)
-- "bluetooth" (boolean)
-- "setup" (boolean)
-- "notification" (boolean)

exports['cylex_phone']:setUserData(identifier, key, value)
```

#### getUserDataList <a href="#user-content-getuserdatalist" id="user-content-getuserdatalist"></a>

```lua
-- return: table - Returns all active/cached users in memory

local allUsers = exports['cylex_phone']:getUserDataList()
```

#### wipeUser <a href="#user-content-wipeuser" id="user-content-wipeuser"></a>

Do not use this command when the server is online!

```lua
-- identifier: string - target identifier
-- src: number - source player id (optional, for admin checks usually)
-- return: boolean, table | string

-- Performs a complete wipe of a character's phone data including:
-- SMS, DarkChat, Company, App Accounts (Twitter, Instagram, Frogly, Swiper, Hacker),
-- Bank, Bills, Gallery, News and App Notifications.
-- Returns true and a stats table (showing deleted rows) if successful.
-- Returns false and an error message string if failed.

local success, result = exports['cylex_phone']:wipeUser(identifier)

if success then
    print("Player data successfully wiped!")
    -- 'result' is a table containing count of deleted rows for each app
else
    print("Wipe failed: ", result)
end

```

#### **getUserDataBySource** <a href="#user-content-getuserdatabysource" id="user-content-getuserdatabysource"></a>

Returns the complete phone `userData` table for a specific online player.

```lua
-- src: number - target player server id (source)
-- return: table | false

-- Retrieves the phone's full user data structure for an online player.
-- This includes phone number, iban, apps, background, settings, and other cached information.
-- Returns false if the player is not found or phone data isn't initialized yet.

local userData = exports['cylex_phone']:getUserDataBySource(source)

if userData then
    print("Player phone number is: " .. userData.phoneNumber)
else
    print("Could not retrieve user data. (Player offline or not initialized)")
end

```
