1. Reference
CallerAPI Documentation
  • Quickstart
  • Use cases
    • For carriers (MNOs/MVNOs)
    • CPaaS platforms
    • Cloud communications providers
    • SIP trunking providers
    • PBX/Cloud PBX
    • UCaaS vendors
  • Account
    • Balance and email
      GET
  • Spam protection
    • Daily spam reports
      • Webhook
        • Subscribe to daily reports
        • Unsubscribe from daily reports
        • List webhook subscriptions
        • Manual dispatch of reports
        • Test webhook
      • REST
        • Fetch daily spam reports
    • Spam score + HLR
      GET
    • 15 days spam CSV snapshot
      GET
  • Mobile SDK
    • Get started
    • Quickstart
      • What you get
      • Get your keys
      • Android
      • iOS
      • Flutter
      • React Native
      • Check it works
    • Call screening
      • What each platform can do
      • Android call screening
      • iOS prerequisites
      • iOS add the extension
      • iOS test on device
    • Reference
      • Methods
      • Errors
      • Limits and billing
      • Troubleshooting
  • Data partners
    • Partner tems & docs
    • Upload spam reports
      POST
    • Upload contacts
      POST
  • Fraud prevention
    • Ported date
      GET
    • Porting history
      GET
    • Online presence
      GET
    • KYC user identity
      POST
  • Schemas
    • Spam protection
      • Spam score request
      • Business info
      • Carrier info
      • Complaint (without number)
      • Daily spam reports request
      • Complaint (with phone)
  1. Reference

Methods

All methods#

Every public function, per platform. Version 1.4.0.

The two you need#

Everything else is optional. These two are the product.
PlatformGet a nameCheck for spam
AndroidCallerAPI.lookupLabel(phone)CallerAPI.isSpam(phone)
iOStry await CallerAPI.lookupLabel(phone)try await CallerAPI.isSpam(phone)
Flutterawait CallerAPI.lookupLabel(phone)await CallerAPI.isSpam(phone)
React Nativeawait CallerAPI.lookupLabel(phone)await CallerAPI.isSpam(phone)
Send every phone number in E.164 format, for example +18883578668.

Android#

Import com.callerapi.sdk.CallerAPI.

Starting up#

MethodReturnsNotes
register(context, featureEnabled = true, config = CallerAPIConfig())UnitCall once in Application.onCreate. Safe to call twice.
cleanup()UnitShuts the native core down. Rarely needed.
register resolves each credential in this order: the value in config, then the manifest meta-data entry, then any value compiled into the native library.

Looking up#

MethodReturnsBlocking?
suspend lookupLabel(phone)String?No, runs on the IO dispatcher
suspend lookupLabelOrNull(phone)String?No. Same as lookupLabel
suspend lookupLabelCode(phone)IntNo. 0 means success
isSpam(phone)BooleanYes. Never call on the main thread
spamCheckCode(phone)IntYes. 1 spam, 0 clean, negative is an error
cachedSpamVerdict(phone)SpamVerdictNo. Reads the cache only, never the network
prewarmAsync(phone)UnitNo. Returns at once, fetches in the background
lookupLabel returns null both for "not a business" and for a failed lookup. Use lookupLabelCode when you need to tell those apart.
SpamVerdict is SPAM, CLEAN, or UNKNOWN. UNKNOWN means the cache has no answer, so treat the call as clean.
Use cachedSpamVerdict and prewarmAsync on the call path. They are the only two that never block.

Permissions and settings#

MethodReturnsNotes
canShowIncomingCallerIdOverlay(context)BooleanWhether the user granted the overlay permission
setIncomingCallerIdOverlayEnabled(enabled)UnitTurns the name card off. Default is on
setFeatureEnabled(enabled)UnitReported for billing. Only enabled devices are billable
setAnalyticsConsent(consented)UnitBlocked call counts are reported only after this
suspend checkIn()BooleanReports usage now, instead of waiting for the schedule
Requesting the call screening role is your job. See Android call screening.

Types#

CallerAPIVersion.VALUE holds the SDK version as a string.

Manifest keys#

KeyRequired for
com.callerapi.sdk.SDK_KEYLookups
com.callerapi.sdk.SDK_SECRETLookups
com.callerapi.sdk.CLIENT_KEYDevice counting and billing
com.callerapi.sdk.API_BASENothing. Only to point at another endpoint

iOS: CallerAPI#

Needs iOS 13.0 or later. import CallerAPI.
MethodReturnsNotes
configure(_ config: CallerAPIConfig, featureEnabled: Bool = true)VoidSupplies credentials. Call once at launch
configure(featureEnabled: Bool = true)VoidOnly for a build with credentials compiled in
isSpam(_ phone: String) async throwsBool
lookupLabel(_ phone: String) async throwsString?nil means not a business
checkIn() asyncBoolReports usage now
If you never call configure, the SDK reads CallerAPISDKKey and CallerAPISDKSecret from your Info.plist on the first lookup. That is how the Flutter and React Native bridges get their credentials.
A thrown error is a CallerAPIError with an Int32 code. See Errors.

Call Directory, for iOS 13 to 17#

CallerAPI.CallDirectory, for blocking from a list downloaded in advance.
MethodReturnsCalled from
configure(_ config: Config)VoidYour app and the extension
sync() async throwsVoidYour app. Downloads the list
scheduleDeferredSync(after: TimeInterval)VoidYour app. Avoids syncing on a cold launch
hasBlocklistBlob() throwsBoolThe extension, before load
load(into: CXCallDirectoryExtensionContext) throwsVoidThe extension
Always check hasBlocklistBlob before load. Until your app has synced once there is no list, and reporting that as an error makes iOS stop asking your extension.

Background refresh#

CallerAPI.BackgroundSync.register() registers the background task. Its identifier is CallerAPI.BackgroundSync.taskIdentifier, which is com.callerapi.checkin. Add that string to BGTaskSchedulerPermittedIdentifiers in your Info.plist.

iOS: CallerAPILiveCallerID#

Needs iOS 18.0 or later. import CallerAPILiveCallerID.

In your app#

MethodReturnsNotes
bootstrap(_ options: BootstrapOptions)VoidCall once at launch. Does everything below
isDisabled(forExtensionWithIdentifier:)BoolWhether the user switched your extension off
openSettings() async throwsVoidOpens the Settings screen with the toggle
prewarmIfEnabled(extensionIdentifier:reason:) asyncBoolRefreshes keys before a call arrives
refreshPIRParameters(forExtensionWithIdentifier:) async throwsVoidLower level than prewarmIfEnabled
configureMetering(clientKey:extensionIdentifier:endpoint:)VoidIncluded in bootstrap
sendHeartbeat() async throwsHeartbeatResultIncluded in bootstrap
sdkVersionString
Prefer bootstrap. It reports usage, registers the background refresh, and refreshes the extension at launch and on every return to the foreground.

In your extension#

makeExtensionContext() returns the object iOS asks for. It is the only call your extension needs.

Advanced#

MethodUse when
appGroupIdentifierYou give different users different data tiers
setUserTierToken(_ token: Data)Same. Needs an App Group on both targets
setEndpoints(serviceURL:tokenIssuerURL:)You point at staging, or at hosts reserved for you
effectiveConfigurationYou want to read back what the SDK will use
resetSharedOverrides()You undo the two setters above
managerYou need Apple's LiveCallerIDLookupManager directly

Flutter#

import 'package:callerapi/callerapi.dart'; then call statics on CallerAPI.
MethodReturnsPlatform
lookupLabel(String phone)Future<String?>Both
isSpam(String phone)Future<bool>Both
checkIn()Future<bool>Both
setFeatureEnabled(bool enabled)Future<void>Both
setAnalyticsConsent(bool consented)Future<void>Android. Does nothing on iOS
requestCallScreeningRole()Future<bool>Android
isCallScreeningRoleGranted()Future<bool>Android
requestOverlayPermission()Future<bool>Android
isOverlayPermissionGranted()Future<bool>Android
bootstrapFromInfoPlist()Future<bool>iOS
bootstrap(CallerAPIBootstrapOptions options)Future<bool>iOS
getLiveLookupStatus()Future<LiveLookupStatus>iOS
openLiveLookupSettings()Future<bool>iOS
prewarmLiveLookup()Future<bool>iOS
syncCallDirectory()Future<bool>iOS
A method for the other platform returns false, so you do not need a platform check.
There is no initialize. The plugin starts the SDK and reads your credentials from the Android manifest and the iOS Info.plist.

React Native#

import CallerAPI from '@callerapi/react-native';. A default import, not a named one.
The method names match Flutter exactly. Two differences:
MethodFlutterReact Native
setFeatureEnabledFuture<void>void. Do not await it
setAnalyticsConsentFuture<void>void. Do not await it
export type LiveLookupStatus = {
  enabled: boolean;
  extensionId?: string;
  serviceURL?: string;
  tokenIssuerURL?: string;
  error?: string;
};

export type CallerAPIBootstrapOptions = {
  liveLookupExtensionId: string;
  lcidClientKey: string;
  lcidHeartbeatTaskId?: string;
  appGroup?: string;
  callDirectoryExtensionId?: string;
  keychainAccessGroup?: string;
  deferCallDirectorySyncSeconds?: number;
};
Importing the package throws at once if the native module is not linked. Run pod install and rebuild.

What the wrappers do not expose#

Flutter and React Native cover lookups, permissions, and iOS extension housekeeping. These native functions have no wrapper method. Write a platform channel or a native module if you need one.
Native functionPlatform
cachedSpamVerdict, prewarmAsyncAndroid
spamCheckCode, lookupLabelCodeAndroid
setIncomingCallerIdOverlayEnabledAndroid
CallerAPIConfig timeoutsAndroid and iOS
setUserTierToken, setEndpointsiOS
Typed CallerAPIError codesiOS
Modified at 2026-07-29 23:17:55
Previous
iOS test on device
Next
Errors
Built with