igpapi — Instagram private API Simulator for Node.js (API reference) 4.14.0
    Preparing search index...

    Interface MobileSessionState

    interface MobileSessionState {
        appStartPhase?: "cold";
        appStartTimeMs?: number;
        authorization?: string;
        bandwidth?: MobileBandwidthSample;
        challenge?: Record<string, unknown>;
        checkpoint?: Record<string, unknown>;
        clientSessionIdLifetime: number;
        directInboxCache?: {
            threads: readonly {
                is_group: boolean;
                items: readonly {
                    client_context?: string;
                    item_id: string;
                    item_type: string;
                    text?: string;
                    timestamp: string | number;
                    user_id: string;
                }[];
                last_activity_at: string
                | number;
                muted: boolean;
                thread_id: string;
                thread_title: string;
                thread_v2_id: string;
                users: readonly {
                    fbid_v2?: string;
                    full_name: string;
                    pk: string;
                    username: string;
                }[];
            }[];
        };
        directInboxSeqId?: number;
        directLoadedThreads?: readonly string[];
        dsUserId?: string;
        familyDeviceIdBound?: boolean;
        fbidV2?: string;
        igWWWClaim?: string;
        lastCreationMode?: "post"
        | "reel"
        | "story";
        metaAiConsent?: MetaAiConsentState;
        metaSubsEntrypointSessions?: Readonly<
            Record<
                string,
                { expiresAtMs: number; refreshAtMs: number; sessionId: string },
            >,
        >;
        msgrRegion?: string;
        noteCtasFetchedAtMs?: number;
        passwordEncryptionKeyId?: string;
        passwordEncryptionPubKey?: string;
        pigeonSessionIdLifetime: number;
        popularKeywordsRefreshedAtMs?: number;
        profileInfoFetches?: Readonly<
            Record<string, { atMs: number; userFbid?: string; username: string }>,
        >;
        quickPromotionCooldown?: QuickPromotionCooldownRules;
        quickPromotionImpressions?: Record<string, QuickPromotionSlotImpressions>;
        regionHint?: string;
        rmdEvaluationStarted?: boolean;
        rur?: string;
        sessionStartPhase?: "starting";
        shbid?: string;
        shbts?: string;
        thumbnailCacheBustingValue: number;
        xMetaUsdid?: string;
        xMid?: string;
        zeroInterface?: boolean;
        zeroPhase?: MobileZeroPhase;
    }
    Index

    Properties

    appStartPhase?: "cold"

    Set while the app is in its cold-start window; requests created in this window carry the app_start_tag analytics tag.

    appStartTimeMs?: number

    App process start clock in milliseconds, set when the cold-start window opens. Requests that report the app-start clock (x-ig-app-start-time, the 448 feed/reels_tray) read it from here.

    authorization?: string

    Bandwidth estimator state, accumulated from completed transfers. Absent until the first response; rendered through bandwidthHeaders.

    challenge?: Record<string, unknown>

    Response when challenge data was purposefully fetched from the checkpoint URL. Set by challenge.route().

    checkpoint?: Record<string, unknown>

    Response when a request got a checkpoint error (challenge_required). Set automatically by the error router.

    clientSessionIdLifetime: number

    Random lifetime in ms for clientSessionId rotation (20min–24h). Generated once per device.

    directInboxCache?: {
        threads: readonly {
            is_group: boolean;
            items: readonly {
                client_context?: string;
                item_id: string;
                item_type: string;
                text?: string;
                timestamp: string | number;
                user_id: string;
            }[];
            last_activity_at: string
            | number;
            muted: boolean;
            thread_id: string;
            thread_title: string;
            thread_v2_id: string;
            users: readonly {
                fbid_v2?: string;
                full_name: string;
                pk: string;
                username: string;
            }[];
        }[];
    }

    What the app's local Direct inbox store holds that the Direct tab's next requests are built from (see DirectInboxCache). Session-scoped, like the sequence; the one writer is adoptDirectInboxCache.

    directInboxSeqId?: number

    The Direct inbox sequence the server last issued (a Direct answer's seq_id), session-scoped.

    directLoadedThreads?: readonly string[]

    The Direct conversations the app holds in its local store, by long thread id: a conversation it loaded once (the thread's message list query, a participant lookup or the creation query) opens from the store, sending only its presence subscription and, on a group, its join requests (a group opened for the first time loads its conversation; a thread the account loaded in an earlier process loads nothing). Written by the thread screen after a load (adoptDirectLoadedThread, the one writer); a scenario declares the threads it starts from. Absent: nothing stored. Carried by the snapshot.

    dsUserId?: string
    familyDeviceIdBound?: boolean

    Whether the app has bound the device family id to its FX/switcher session. Absent (false) while the switcher still probes with an empty family_device_id (FxIgXavSwitcherBadgingDataQuery); set by BindFamilyDeviceId at the switch point (the first two post-login probes send "", the later ones the device family id).

    fbidV2?: string

    The viewer's own Facebook-side id, named as the login answer names it (logged_in_user.fbid_v2, a number on the wire, kept as its decimal text). The viewer's own profile asks the school-partnership badge with it. Exactly two functions write it, both in this module: adoptLoginAnswer (every login path hands it the answer's logged_in_user; an answer with no id clears the previous account's) and adoptLaunchFbidV2 (the launch's IGSharedAccountsQuery answer, data.me.id, which every Android and iOS launch sends, so a stored session that never saw a login answer learns it at its next launch). Both give the same id (448: login@fresh 018, login-2fa-trusted 022, login-2fa-totp 030; 451: the launch's shared-accounts answer). Absent until one of them writes it; persisted with the session like dsUserId.

    igWWWClaim?: string
    lastCreationMode?: "post" | "reel" | "story"

    The creation mode the account's app was last left in (post, reel or story): the feed's create button opens that mode's screen, and the Reels tab's "+" opens the camera. Absent until a mode was used: the app then opens the post mode. Carried by the snapshot; the only writer is the creation screens' rememberCreationMode, emitted where the app opens or switches to a mode (the Android posting screens).

    metaAiConsent?: MetaAiConsentState

    The Meta AI consent the account's app cached from its last MAIUnifiedUserQuery answer (xfb_gen_ai_unified_nux_consent_status_query, cacheable for the answer's consent_cache_time_s): whether the consent notice is still to be acknowledged, the notice the answer carried, and how long the answer stays cached. The search field writes the acknowledgement (MAIUnifiedUserMutation, entrypoint IG__SEARCH__NULLSTATE) at the first keystroke while the notice is still due. Exactly two functions write it, both in packages/android/src/launch/launch.meta-ai-consent.ts: the query's reader (the post-login burst always; the warm launch when the cache is past its time) and the acknowledgement, which marks the notice acknowledged only on an answer without GraphQL errors. Absent: never fetched. Carried by the snapshot.

    metaSubsEntrypointSessions?: Readonly<
        Record<
            string,
            { expiresAtMs: number; refreshAtMs: number; sessionId: string },
        >,
    >

    The Meta Verified (Meta subscriptions) entry-point experience the app caches per entry point (keyed by the lower-case entry point such as mso_ig_edit_profile): the logging session the experience query served (logging.session_id), which the app echoes in the prefetch of that entry point's tier screen, with the answer's own cache policy as absolute times (it refreshes after refreshAtMs and drops the entry after expiresAtMs). Absent until the experience query's answer sets it; its one writer is adoptMetaSubsEntrypointSessions.

    msgrRegion?: string

    The Direct message region the app learned from an IGRealtimeRegionHintQuery answer (data.xdt_igd_msg_region.region, e.g. FRC). The app persists it per account and reports it as x-msgr-region on its Direct-surface requests, in later processes too (the 451 warm launches carry FRC with no query of their own). Absent until an answer sets it; an empty stored value is a region the answer left empty and renders as the empty header on the Direct GraphQL requests only. See "Direct message region (x-msgr-region)" (packages/core/src/android/spec/direct-message-region-x-msgr-region.md).

    noteCtasFetchedAtMs?: number

    When the Notes call-to-actions (GetNoteCtasRequest) were last fetched from the network: the app's persisted notes_cta_last_fetch_timestamp_ms. The profile fetches again from the device-local midnight that follows the day of this stamp (or, for an account whose MobileConfig says so, once its interval has passed), and writes it after a successful fetch. Absent: never fetched. Carried by the snapshot (profile.note-ctas.ts names the app's guard).

    passwordEncryptionKeyId?: string
    passwordEncryptionPubKey?: string
    pigeonSessionIdLifetime: number

    Random lifetime in ms for pigeonSessionId rotation (20min–24h). Generated once per device.

    popularKeywordsRefreshedAtMs?: number

    When the popular keywords of the search surface were last refreshed from the network: the app's cache time of its popular-keyword repository. The Explore tab refreshes them again once the cache is more than a day old (explore.popular-keywords.ts names the app's guard). Absent: never refreshed. Carried by the snapshot.

    profileInfoFetches?: Readonly<
        Record<string, { atMs: number; userFbid?: string; username: string }>,
    >

    The users whose profile info the app fetched recently, by user id: when the user's info stream last answered and what it named (the username, and the Facebook id the school-partnership badge asks with). The app keeps the answer in its response cache for a short time; a search tap on a user whose info is still cached sends no touch-down prefetch and the profile opens from the cached user (android-451/media-like-repost-comment, repost, reels-comment, direct-thread-theme against media-like, reels-like, direct-new-thread, users-search: the same account, the second visit within eight minutes opens from the cache, the visit fourteen minutes after the last does not). Written by the profile's visit after the info stream answers (profile.info-cache.ts, the one writer), which also drops the entries past the freshness window. Absent: nothing cached. Carried by the snapshot.

    quickPromotionCooldown?: QuickPromotionCooldownRules

    The app's QP cooldown rules (MobileConfig values, not on the wire): present only when learned or declared; without them no slot is in cooldown.

    quickPromotionImpressions?: Record<string, QuickPromotionSlotImpressions>

    The quick-promotion impressions the account's app counted, per QP slot (QuickPromotionSlot name): learned when a promotion is shown and kept per account like the app's <SLOT>_qp_slot_impression_data. With quickPromotionCooldown it decides whether a slot is in its cooldown (mobile.quick-promotion-history.ts).

    regionHint?: string
    rmdEvaluationStarted?: boolean

    Set once the process has started evaluating its routing map (StartRmdEvaluation, at the first routing-map fetch's start); every request reports the map from then on (rmdReportedOf). A process fact, not the map itself: the map is the install's (MobileDeviceState.rmd), and a process that starts with a stored session reports none until its own fetch (BeginStoredProcess clears this).

    rur?: string
    sessionStartPhase?: "starting"

    Set while the app is running the jobs it launches at user-session creation (see RequestScope's session-start). Requests issued in this window omit the x-pigeon-session-id header: the 448 build carries it on the pre-login and late-session families but not on the post-login session-start burst (sequences 23–35), where it reappears from the request after the burst.

    shbid?: string
    shbts?: string
    thumbnailCacheBustingValue: number
    xMetaUsdid?: string

    Pre-computed x-meta-usdid HTTP header value, reused byte-identical on every request until the next USDID re-register. Filled by postUsdidRegistration after a successful mutation, so the registration request itself carries no header on a fresh install (only a value cached from an earlier accepted registration is ever sent). Not persisted across processes by default (the signature embeds a timestamp).

    xMid?: string
    zeroInterface?: boolean

    Set once the app has started its zero-rating campaign evaluation; the zero-http-network-interface header is reported from then on. A separate concept from MobileSessionState.rmdEvaluationStarted: the 448 build carries x-fb-rmd already on the Loom config request but the network interface only from the zero-campaign request that follows it (see StartZeroInterface).

    zeroPhase?: MobileZeroPhase

    Zero-rating phase of the session. Absent (older snapshots) means authenticated when authorization is set and logged-out otherwise; read it through zeroPhaseOf.