Skip to main content

Server Callbacks

Callbacks are request/response calls from the client to the server — unlike Server Events, they return a value. RoadPhone registers all of them through the Bridge system:
The Bridge maps callbacks onto the active framework: ESX.TriggerServerCallback, QBCore.Functions.TriggerCallback, lib.callback (Qbox) or an internal net-event protocol (standalone, with a 10s timeout). Because of that, other resources can call these callbacks through their framework’s native callback mechanism as well.Most callbacks return one value; a few return two (e.g. the backup callbacks and roadphone:mechanic:resetPin call cb(success, resultOrError)) — your handler function then receives two arguments.
As with events, identity is server-authoritative: callbacks resolve the caller’s phone number, identifier, job and account sessions from source. Client-supplied account IDs are ignored.

Core Phone

CallbackInputReturnsDescription
roadphone:getItemAmount{ item, metadata } or nilThe primary phone-open callback. Verifies the phone item and returns the full per-phone metadata bundle (number, contacts, messages, notes, settings, PIN, alarms, accounts, photos, SIMs, battery, …) used to hydrate the UI.
roadphone:switchToPhoneByNumberphoneNumber{ metadata } or nilSwitches the active phone item to the one holding that number (used before an incoming call rings). Metadata mode only; phone must belong to the caller.
roadphone:getPhoneNumbernumber (string)Returns (and creates if needed) the active phone’s number.
roadphone:getPhonePin{ pin, pin_needed } or nilReturns the stored PIN state (metadata mode only).
roadphone:server:getContactsarray of contact rowsThe caller’s contacts (max 500).
roadphone:getPicturesarray of photo rows or nilGallery photos of the current phone (metadata or DB).
roadphone:server:getOfflineNotifysarray of notification rowsFetches and deletes queued offline notifications (drain semantics).
roadphone:service:getJobCallMembersnumberarray of { source, name }Online dispatchers registered for a service/emergency number.
roadphone:server:gfutype?presigned-upload object or nilServer-side proxy for fmapi.net presigned upload URLs (API key stays on the server).
roadphone:server:custom:upload:requestfiletype?presigned-upload object or nilSame for a self-hosted upload endpoint (uploader/upload-server.lua template).
roadphone:checkUpdate{ update, version, changelog, newVersion, isBeta }Cached version-check info.
roadphone:weather:getTempweatherTypetemperature string (e.g. "21°C")Authoritative, cached temperature so all clients agree.
roadphone:checkIsBossbooleanWhether the caller is a boss of their job.
roadphone:server:getEmployeessocietyarray of { firstname, lastname, job_grade, phone_number, online }Employees of a job with online status (30s cache).

Radio

CallbackInputReturnsDescription
roadphone:getRadioAmounttrue or nilWhether the player may use the radio app (Config.RadioNeedItem).
roadphone:radio:getSavedChannelsarray of { id, name, frequency, icon_color }Saved radio channels.
roadphone:radio:addChannelchannelDatanew channel idSaves a channel (DB + metadata).
roadphone:radio:updateChannelchannelId, channelDatabooleanUpdates a caller-owned channel.
roadphone:radio:deleteChannelchannelIdbooleanDeletes a caller-owned channel.
roadphone:radio:getRecentChannelsarray of frequenciesRecently used channels (metadata mode).
roadphone:radio:getUsersInChannelfrequencyarray of { id, name, isTalking? }Players in a frequency (pma-voice/mumble/yaca).

Bank & Billing

CallbackInputReturnsDescription
roadphone:getBankData{ balance, iban, transactions, requests, ibanPrefix?, ibanLength? }Aggregated bank snapshot incl. pending payment requests.
roadphone:getBankBalancenumberLegacy: just the bank balance.
roadphone:bank:checkSpam1 (spam) or 0Per-player rate-limit gate (1s).
roadphone:bank:createRequesttargetNumber, amount, reason{ ok } or { ok = false, error }Creates a money request (max 3 pending per pair, 24h expiry).
roadphone:bank:respondRequestrequestId, accept{ ok } or { ok = false, error }Accepts (executes transfer) or declines a request (recipient-only, race-safe).
roadphone:okokBanking:getIbanIBAN stringLegacy: okokBanking IBAN (now part of getBankData).
roadphone:rxBanking:getCreditCardcard number stringLegacy: RX Banking card number.
roadphone:getbillingarray of { id, label, sender, target, amount }The caller’s bills. Registered in one of two variants depending on Config.bcsCompanyManager.
roadphone:getRxBillingarray of invoice objectsNormalized RxBilling invoices.
roadphone:getCodeMBilling2codem unpaid-billing listPassthrough for codem-billing2.

Housing

All delegate to the configured housing-system adapter; write operations enforce ownership in the adapter.
CallbackInputReturnsDescription
roadphone:housing:getProperties{ properties, capabilities }The caller’s properties + capability flags (toggleLock, manageKeys, bills).
roadphone:housing:getKeyspropertyIdarray of { name, identifier }Keyholders of a property.
roadphone:housing:toggleLockpropertyIdadapter resultToggles the lock.
roadphone:housing:giveKeypropertyId, targetSourceadapter resultGrants a key.
roadphone:housing:removeKeypropertyId, targetIdentifieradapter resultRevokes a key.
roadphone:housing:getBillspropertyIdbills arrayOutstanding property bills (capability-gated).
roadphone:housing:payBillpropertyId, billTypeadapter resultPays a property bill.

Valet

CallbackInputReturnsDescription
roadphone:valet:getCarsarray of { plate, vehicle, garage, mods, state, parked }The caller’s owned vehicles with garage state.
roadphone:valet:loadVehicleplatevehicle rows, or false(, reason)Validates + loads an owned vehicle for delivery.
roadphone:valet:checkMoneybooleanCharges the valet fee if affordable and confirms delivery.

Backup

Gated by Config.BackupEnabled. These callbacks return two values: cb(success, resultOrMessage).
CallbackInputReturnsDescription
roadphone:backup:getListarray of { backup_id, backup_name, backup_type, created_at, phone_number }Lists the caller’s backups (single value).
roadphone:backup:createbackupName?success, backupId or errorCreates a manual backup snapshot.
roadphone:backup:restorebackupIdsuccess, messageRestores a backup into phone metadata (client refreshed via roadphone:restoreComplete).
roadphone:backup:deletebackupIdsuccess, messageDeletes a caller-owned backup.

Cloud Account (RoadID)

CallbackInputReturnsDescription
roadphone:account:resumeaccount object or nilResumes the phone’s cloud session (server-authoritative, revalidated against the item).
roadphone:account:checkValidMailmailbooleanWhether an email address is already registered.

Admin

All gated by ACE permission roadphone.phoneadmin.
CallbackInputReturnsDescription
admin:getServerConfigconfig bundle or { noPermission = true }The editable server configuration for the admin panel.
admin:saveConfigLuaconfigData{ success, error? }Persists config.lua changes.
admin:saveConfigJsonconfigData{ success, error? }Persists config.json changes.
admin:saveAddonsaddonsData{ success, error? }Saves addon configs.
admin:saveBackendLocalelocaleData{ success, error? }Saves a backend locale file.
admin:saveFrontendLocalelocaleData{ success, error? }Saves a frontend locale file.

GPS / Games / Jobs / Custom Apps / GIFs

CallbackInputReturnsDescription
roadphone:gps:getWaypointsarray of { id, name, x, y }Saved waypoints (max 50).
roadphone:gps:addWaypointname, x, ynew waypoint or falseAdds a waypoint (50-cap enforced).
roadphone:games:ttt:create{ ok, code, youAre, state }Creates a TicTacToe room (caller = host X).
roadphone:games:ttt:joincode{ ok, code, youAre, state } or { ok = false, error }Joins a room as O.
roadphone:games:ttt:startcode{ ok } or errorHost starts/rematches.
roadphone:games:ttt:movecode, index (1-9){ ok } or errorPlaces a mark (turn/cell validated).
roadphone:games:ttt:leave{ ok }Leaves the current room.
roadphone:jobs:getGigsarray of gig objectsThe open gig board.
roadphone:jobs:postGigdata (title, description, reward, category){ ok, gig } or { ok = false, error }Posts a gig (cooldown + per-player cap; identity server-side).
roadphone:jobs:deleteGiggigId{ ok } or errorDeletes an own gig.
roadphone:customapp:storageGetnamespace, keystored value or nilReads per-phone custom-app storage (writes go via the storageSet/storageDelete events).
roadphone:gifs:trendingpage{ items, hasNext, page }Klipy trending GIFs proxy (notConfigured = true without API key).
roadphone:gifs:searchquery, page{ items, hasNext, page }Klipy GIF search proxy.

Messages & Mail

CallbackInputReturnsDescription
roadphone:messages:getMessagesnumber (ignored)array of message rowsThe caller’s SMS inbox (max 500; own number resolved server-side).
roadphone:mail:fetchmailsarray of mail rowsReceived mail (session mail + identifier, max 200).
roadphone:mail:fetchmails:senderarray of mail rowsSent mail.

FaceTime

CallbackInputReturnsDescription
roadphone:facetime:canSeeDebugbooleanWhether the FaceTime debug overlay is visible.

Service (Dispatch & Business)

The management* callbacks are rate-limited and require management permission (job + grade).
CallbackInputReturnsDescription
getBusinessStatusmap of job → status objectOpen/closed state + employee counts for all businesses.
getAllBusinessNewsarray of news rowsGlobal business-news feed.
getBusinessNewsjobarray of news rowsNews for one business.
getOnlineCoworkersarray of { source, name, grade }Online players sharing the caller’s job.
getActiveDispatchesarray of dispatch rowsOpen dispatches for the caller’s job.
getDispatchHistoryarray of dispatch rowsFinished/declined dispatches.
getDispatchStats{ today, completed, declined }Today’s dispatch counts.
getManagementData{ success, balance, employees }Society balance + full employee roster.
managementDepositamount{ success, newBalance } or errorDeposits into the society account (refund-safe).
managementWithdrawamount{ success, newBalance } or errorWithdraws from the society account (atomic).
managementHiretargetServerId{ success } or errorHires an online player at grade 0.
managementFiretargetIdentifier{ success } or errorFires an employee (online or offline).
managementSetGradetargetIdentifier, newGrade{ success } or errorChanges a grade (cannot exceed own grade).

Taxi / Calendar / Notes / Voice Memos

CallbackInputReturnsDescription
roadphone:taxi:getDriverStatusbooleanWhether the caller may drive a taxi (job/license config).
roadphone:taxi:gethistoryarray of trip rowsPast rides (max 50).
roadphone:taxi:getfavoritesarray of { type, name, coords }Saved favourite destinations.
roadphone:calendar:getEventsarray of event rowsCalendar events (max 300).
roadphone:notes:getNotesarray of note rowsNotes (max 300).
roadphone:voicememos:getarray of memo rowsSaved voice memos.

Music / Crypto / Health / RoadDrop

CallbackInputReturnsDescription
roadphone:music:loadPlaylists{ only, songs }Playlists + their songs.
roadphone:music:getSearchsearcharray of track objectsLibrary search (or external Music API).
roadphone:music:isMusicAdminbooleanMusic-admin status.
roadphone:music:getSubmissionsarray of pending submissionsAdmin-only review queue.
roadphone:music:getLibraryAdminarray of library songsAdmin-only full library.
roadphone:crypto:getCryptomap coinid → amountThe caller’s crypto holdings.
roadphone:crypto:checkSpam1 or 0Anti-spam gate for crypto actions.
roadphone:health:getData{ today, history, current }Today’s totals, 7-day history, live vitals.
roadphone:roaddrop:getAccountInformationplayerIdsarray of { firstname, lastname, profile, playerId }Resolves display names of nearby players.

DarkChat

All rate-limited; every response uses an { ok = bool, error? } envelope (rate_limited, no_phone, not_member, forbidden, …).
CallbackInputReturnsDescription
roadphone:darkchat:fetchRooms{ ok, rooms }The caller’s rooms with last-message previews.
roadphone:darkchat:fetchMessagesroomId, beforeId?, limit?{ ok, messages, hasMore, members }Paginated room messages + member list (clears unread badge).
roadphone:darkchat:joinByCodecode, alias{ ok, room }Joins a room by code.
roadphone:darkchat:createRoomalias, topic, burnSeconds{ ok, room }Creates a room (caller = owner).
roadphone:darkchat:sendMessageroomId, content, type?{ ok, message_id }Sends a message (burn timer, live push, notifications).
roadphone:darkchat:deleteMessageroomId, messageId{ ok }Deletes own message (or any, as owner).
roadphone:darkchat:leaveRoomroomId{ ok }Leaves (ownership transfer / room cleanup).
roadphone:darkchat:rotateCoderoomId{ ok, code }Generates a new join code (owner-only).
roadphone:darkchat:kickMemberroomId, targetMemberId{ ok }Kicks a member (owner-only).
roadphone:darkchat:setBurnAfterroomId, seconds{ ok, burn_after }Sets the burn timer (owner-only, whitelisted values).
roadphone:darkchat:setTopicroomId, topic{ ok, topic }Sets the topic (owner-only).
roadphone:darkchat:setAliasroomId, alias{ ok, alias }Changes the caller’s own alias.

Connect (Instagram)

CallbackInputReturnsDescription
roadphone:instagram:resumeaccount object or falseAuto-login resume via the server session.
roadphone:instagram:getProfileuserid{ posts }A profile’s posts with author fields.
roadphone:instagram:getPostpostid, accountIdpost row or nilSingle post (viewer like-state computed).
roadphone:instagram:getStorysarray of story rowsActive (24h) stories.
roadphone:instagram:getStoryReactionsstoryIdarray of reactionsReactions on a story (max 100).
roadphone:instagram:getcommentspostid, viewerAccountId?array of comment rowsComments incl. replies + like state.
roadphone:instagram:getUsersarray of profile rowsAll accounts (max 500, follower/follows decoded).
roadphone:instagram:getFolloweruseridarray of profile rowsFollowers of an account.
roadphone:instagram:getFollowsuseridarray of profile rowsAccounts a user follows.
roadphone:instagram:getActivityaccountId{ likes, comments, followers }The activity feed (max 50 each).

Connect DMs & Live

CallbackInputReturnsDescription
roadphone:connect:dm:getThreadsarray of thread rowsDM threads with unread counts (session required).
roadphone:connect:dm:getMessagespeerId, beforeId?array of message rowsPaginated DMs (≤50, advances read pointer).
roadphone:connectLiveStart{ title }{ success, streamId, roomName, token, url } or errorStarts a Connect livestream (LiveKit).
roadphone:connectLiveStop{ success } or errorStops the caller’s stream.
roadphone:connectLiveJoin{ streamId }{ success, viewers }Joins as viewer.
roadphone:connectLiveLeave{ streamId }{ success }Leaves as viewer.
roadphone:connectLiveSendMessage{ streamId, message, username }{ success }Stream chat message.
roadphone:connectLiveSendHeart{ streamId }{ success }Heart animation.
roadphone:getConnectLivestreams{ success, livestreams }Active Connect streams with viewer counts.

TweetWave

CallbackInputReturnsDescription
roadphone:twitter:resumeaccount object or falseAuto-login resume via the server session.
roadphone:twitter:getStoredAccountaccount object or nilSession account.
roadphone:twitter:getAccountByCredentialsusername, passwordaccount object or nilLegacy credential login (mints a session).
roadphone:twitter:getTweets{ ok, tweets } or { ok = false, error = 'no_auth' }Home feed (cached, max 130).
roadphone:twitter:getFollowingTweets{ ok, tweets } or no_authFollowing feed.
roadphone:getTwitterUsersarray of tweet rowsThe caller’s own tweets (max 30).
roadphone:getuserveri{ id }array of tweet rowsA specific author’s tweets.
roadphone:twitter:getProfileuserid, currentAccountId?profile row or nilProfile incl. follower counts + follow state.
roadphone:twitter:getFollowerstargetUserId, clientAccountId?array of user rowsFollowers with isFollowing flags.
roadphone:twitter:getFollowingtargetUserId, clientAccountId?array of user rowsFollowed accounts.
roadphone:twitter:getUserByIduserIduser row or nilMinimal user lookup.
roadphone:twitter:getUsersarray of { authorId, author, authorIcon, verify }All accounts (max 500).
roadphone:server:searchUserusernamearray of user rowsExact-match user search.
roadphone:twitter:getBookmarksarray of tweet rowsBookmarked tweets.
roadphone:twitter:getcommentspostidarray of comment rowsComments on a tweet (max 200).

Snapy

All resolve identity via the server session; the NUI-supplied accountId is always overridden.
CallbackInputReturnsDescription
roadphone:snapy:resumeaccount row or falseAuto-login resume.
roadphone:snapy:getFriendsarray of friend rowsAccepted friends.
roadphone:snapy:getPendingRequestsarray of request rowsIncoming pending requests.
roadphone:snapy:getBlockedarray of blocked usersBlocked list.
roadphone:snapy:getSuggestionsarray of suggestions (max 6)Quick-add: friends-of-friends.
roadphone:snapy:getNearbyserverIdsarray of nearby users, or falseNearby Snapy users (distance + privacy verified, rate-limited).
roadphone:snapy:getReceivedSnapsarray of snap rowsUnviewed received snaps.
roadphone:snapy:getSentSnapsfriendIdarray of snap rowsSnaps sent to a friend.
roadphone:snapy:replaySnapsnapIdsnap row or falseOne-time replay (recipient-only, mode = 'replay').
roadphone:snapy:getStoriesarray of story rowsVisible active stories (visibility-filtered).
roadphone:snapy:getStoryViewersstoryIdarray of viewer rowsStory viewers (author-only).
roadphone:snapy:getHighlightsarray of storiesThe caller’s profile highlights.
roadphone:snapy:getChatsarray of chat partnersChat list with streaks, unread counts, friend emoji.
roadphone:snapy:getFriendshipfriendIdfriendship object or falseFriendship details (streak, mutuals, emoji).
roadphone:snapy:getChatMessagesfriendIdarray of messages (≤100)1:1 chat history (marks incoming read).
roadphone:snapy:searchUserssearchTermarray of users (max 20)User search (min 2 chars, rate-limited).
roadphone:snapy:createGroup{ name, members }group object or falseCreates a group (members must be friends, max 32).
roadphone:snapy:getGroupsarray of group rowsThe caller’s groups with unread counts.
roadphone:snapy:getGroupMessagesgroupIdarray of messages (≤100)Group chat history (member-only, advances read pointer).
roadphone:snapy:getMemoriesarray of memory rowsThe memories vault.

Addons

CallbackAddonInputReturnsDescription
roadphone:simcard:getSIMsSIM Card{ sims, activeSim }Installed SIMs + active SIM.
roadphone:simcard:getInventorySIMsSIM Cardarray of SIM itemsSIM cards in the inventory.
roadphone:simcard:insertSIMSIM CardsimSlot, simId{ success, sims, activeSim } or errorInserts a SIM.
roadphone:simcard:ejectSIMSIM CardsimIndex{ success, sims, activeSim } or errorEjects a SIM.
roadphone:simcard:switchSIMSIM CardsimIndex{ success, newNumber, credits } or errorSwitches the active SIM (re-caches numbers).
roadphone:simcard:convertESIMSIM CardsimIndex{ success, sims, activeSim } or errorConverts a SIM to eSIM.
roadphone:simcard:buySIMSIM Card{ success, number } or errorBuys a SIM (charges SimCard.SIMPrice, refund-safe).
roadphone:simcard:topUpSIM CardpackageId{ success, credits } or errorTops up credit (refund-safe).
roadphone:battery:getLevelBatterynumberCurrent battery level.
roadpods:checkItemAmountRoadPodsitem name, true, or nilVerifies RoadPods ownership.
roadphone:mechanic:resetPinMechanicsuccess, amountOrError (two values)Resets the phone PIN at the mechanic NPC (optional payment, refund-safe).