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

    Variable DirectThreadScreenConst

    DirectThreadScreen: ScreenDefinition<
        "DirectThread",
        "screen",
        | {
            kind: "thread";
            send_attribution?: | "inbox"
            | "inbox_new_message"
            | "message_button"
            | "direct_thread_creation_omnipicker";
            thread: {
                is_group: boolean;
                muted?: boolean;
                preview: readonly {
                    client_context?: string;
                    item_id: string;
                    item_type: string;
                    media?: | {
                        height: number;
                        media_type: 1;
                        pk: string;
                        url: string;
                        width: number;
                    }
                    | {
                        height: number;
                        media_type: 2;
                        pk: string;
                        url: string;
                        width: number;
                    }
                    | {
                        media_type: 8;
                        pk: string;
                        slides: readonly { media_type: (...)
                        | (...); pk: string; url: string }[];
                    };
                    text?: string;
                    timestamp: string;
                    user_id: string;
                }[];
                thread_id: string;
                thread_title: string;
                thread_v2_id?: string;
                users: readonly {
                    fbid_v2?: string;
                    full_name: string;
                    pk: string;
                    username: string;
                }[];
            };
        }
        | {
            kind: "recipient";
            recipient: string;
            send_attribution?: | "inbox"
            | "inbox_new_message"
            | "message_button"
            | "direct_thread_creation_omnipicker";
        }
        | {
            kind: "created";
            target_user_ids: readonly string[];
            thread_id: string;
            thread_v2_id: string;
        },
        {
            media: readonly (
                | {
                    height: number;
                    media_type: 1;
                    pk: string;
                    url: string;
                    width: number;
                }
                | {
                    height: number;
                    media_type: 2;
                    pk: string;
                    url: string;
                    width: number;
                }
                | {
                    media_type: 8;
                    pk: string;
                    slides: readonly { media_type: 1
                    | 2; pk: string; url: string }[];
                }
            )[];
            messages: readonly {
                client_context?: string;
                item_id: string;
                item_type: string;
                media?: | {
                    height: number;
                    media_type: 1;
                    pk: string;
                    url: string;
                    width: number;
                }
                | {
                    height: number;
                    media_type: 2;
                    pk: string;
                    url: string;
                    width: number;
                }
                | {
                    media_type: 8;
                    pk: string;
                    slides: readonly { media_type: 1
                    | 2; pk: string; url: string }[];
                };
                text?: string;
                timestamp: string;
                user_id: string;
            }[];
            thread: {
                is_group: boolean;
                muted?: boolean;
                thread_id: string;
                thread_title: string;
                thread_v2_id?: string;
            };
            users: readonly {
                fbid_v2?: string;
                full_name: string;
                pk: string;
                username: string;
            }[];
        },
        | {
            has_messages: boolean;
            is_group: false;
            ordinal_reserved?: boolean;
            participants: readonly {
                fbid_v2?: string;
                full_name: string;
                pk: string;
                username: string;
            }[];
            peer_user_fbid?: string;
            peer_user_id?: string;
            send_attribution?: | "inbox"
            | "inbox_new_message"
            | "message_button"
            | "direct_thread_creation_omnipicker";
            thread_id: string;
            thread_title: string;
            thread_v2_id?: string;
        }
        | {
            has_messages: boolean;
            is_group: true;
            lead_user_id?: string;
            ordinal_reserved?: boolean;
            participants: readonly {
                fbid_v2?: string;
                full_name: string;
                pk: string;
                username: string;
            }[];
            send_attribution?: | "inbox"
            | "inbox_new_message"
            | "message_button"
            | "direct_thread_creation_omnipicker";
            thread_id: string;
            thread_title: string;
            thread_v2_id?: string;
        },
        | IgApiError
        | RequestError
        | ParseError
        | TransportError
        | ScreenDataError
        | DirectInboxSeqIdUnknownError
        | DirectThreadNotFoundByParticipantsError,
        | PlainJsonApiHttp
        | MobileSession
        | MobileDevice
        | GraphqlJsonHttp
        | MobileApplication
        | MobileNavigation
        | MobileUserFlows
        | AndroidQuickPromotionStash,
        {
            openCustomizeChat: (
                self: ScreenHandle,
                state:
                    | {
                        has_messages: boolean;
                        is_group: false;
                        ordinal_reserved?: boolean;
                        participants: readonly {
                            fbid_v2?: string;
                            full_name: string;
                            pk: string;
                            username: string;
                        }[];
                        peer_user_fbid?: string;
                        peer_user_id?: string;
                        send_attribution?: | "inbox"
                        | "inbox_new_message"
                        | "message_button"
                        | "direct_thread_creation_omnipicker";
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                    }
                    | {
                        has_messages: boolean;
                        is_group: true;
                        lead_user_id?: string;
                        ordinal_reserved?: boolean;
                        participants: readonly {
                            fbid_v2?: string;
                            full_name: string;
                            pk: string;
                            username: string;
                        }[];
                        send_attribution?: | "inbox"
                        | "inbox_new_message"
                        | "message_button"
                        | "direct_thread_creation_omnipicker";
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                    },
            ) => ScreenEdgeBound<
                ScreenEdgeShape<
                    ScreenDefinition<
                        "DirectCustomizeChat",
                        "screen",
                        { thread_v2_id: string },
                        { thread_v2_id: string },
                        { thread_v2_id: string },
                        never,

                            | PlainJsonApiHttp
                            | GraphqlJsonHttp
                            | MobileApplication
                            | MobileNavigation
                            | MobileProcessBackground,
                        {
                            openThemePicker: (
                                self: ScreenHandle,
                                state: { thread_v2_id: string },
                            ) => ScreenEdgeBound<
                                ScreenEdgeShape<
                                    ScreenDefinition<
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                    >,
                                    [],
                                    "button",
                                    AndroidScreens,
                                >,
                                (...args: []) => Effect<(...), (...), (...)>,
                            >;
                        },
                        Record<never, never>,
                        never,
                        "thread_v2_id",
                    >,
                    [],
                    "button",
                    AndroidScreens,
                >,
                (
                    ...args: [],
                ) => Effect<
                    AssembledHandle<
                        "DirectCustomizeChat",
                        "screen",
                        { thread_v2_id: string },
                        {
                            openThemePicker: (
                                self: ScreenHandle,
                                state: { thread_v2_id: string },
                            ) => ScreenEdgeBound<
                                ScreenEdgeShape<(...), (...), (...), (...)>,
                                (...args: ...) => ...,
                            >;
                        },
                        Record<never, never>,
                        ScreenHandle,
                        "required",
                        true,
                        "thread_v2_id",
                        AndroidScreens,
                    >,
                    ScreenDataError | ScreenEnterConcurrentError | ScreenEdgeInputError,

                        | PlainJsonApiHttp
                        | GraphqlJsonHttp
                        | MobileApplication
                        | MobileNavigation
                        | ScreenStack
                        | MobileProcessBackground
                        | ScreenCatalog,
                >,
            >;
            openThreadDetails: (
                self: ScreenHandle,
                state:
                    | {
                        has_messages: boolean;
                        is_group: false;
                        ordinal_reserved?: boolean;
                        participants: readonly {
                            fbid_v2?: string;
                            full_name: string;
                            pk: string;
                            username: string;
                        }[];
                        peer_user_fbid?: string;
                        peer_user_id?: string;
                        send_attribution?: | "inbox"
                        | "inbox_new_message"
                        | "message_button"
                        | "direct_thread_creation_omnipicker";
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                    }
                    | {
                        has_messages: boolean;
                        is_group: true;
                        lead_user_id?: string;
                        ordinal_reserved?: boolean;
                        participants: readonly {
                            fbid_v2?: string;
                            full_name: string;
                            pk: string;
                            username: string;
                        }[];
                        send_attribution?: | "inbox"
                        | "inbox_new_message"
                        | "message_button"
                        | "direct_thread_creation_omnipicker";
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                    },
            ) => ScreenEdgeBound<
                ScreenEdgeShape<
                    ScreenDefinition<
                        "DirectThreadDetails",
                        "screen",
                        | {
                            is_group: false;
                            peer_user_fbid?: string;
                            peer_user_id?: string;
                            thread_title: string;
                            thread_v2_id: string;
                        }
                        | {
                            is_group: true;
                            lead_user_id?: string;
                            thread_title: string;
                            thread_v2_id: string;
                        },
                        | {
                            is_group: false;
                            peer_user_fbid?: string;
                            peer_user_id?: string;
                            thread_title: string;
                            thread_v2_id: string;
                        }
                        | {
                            is_group: true;
                            lead_user_id?: string;
                            thread_title: string;
                            thread_v2_id: string;
                        },
                        | {
                            is_group: false;
                            peer_user_fbid?: string;
                            peer_user_id?: string;
                            thread_title: string;
                            thread_v2_id: string;
                        }
                        | {
                            is_group: true;
                            lead_user_id?: string;
                            thread_title: string;
                            thread_v2_id: string;
                        },
                        IgApiError
                        | RequestError
                        | ParseError
                        | TransportError,

                            | PlainJsonApiHttp
                            | GraphqlJsonHttp
                            | MobileApplication
                            | MobileNavigation,
                        {
                            openSharedMedia: (
                                self: ScreenHandle,
                                state:
                                    | {
                                        is_group: false;
                                        peer_user_fbid?: (...)
                                        | (...);
                                        peer_user_id?: (...) | (...);
                                        thread_title: string;
                                        thread_v2_id: string;
                                    }
                                    | {
                                        is_group: true;
                                        lead_user_id?: (...)
                                        | (...);
                                        thread_title: string;
                                        thread_v2_id: string;
                                    },
                            ) => ScreenEdgeBound<
                                ScreenEdgeShape<
                                    ScreenDefinition<
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                        (...),
                                    >,
                                    [],
                                    "button",
                                    AndroidScreens,
                                >,
                                (...args: []) => Effect<(...), (...), (...)>,
                            >;
                        },
                        Record<never, never>,
                        never,
                        "thread_v2_id",
                    >,
                    [],
                    "button",
                    AndroidScreens,
                >,
                (
                    ...args: [],
                ) => Effect<
                    AssembledHandle<
                        "DirectThreadDetails",
                        "screen",
                        | {
                            is_group: false;
                            peer_user_fbid?: string;
                            peer_user_id?: string;
                            thread_title: string;
                            thread_v2_id: string;
                        }
                        | {
                            is_group: true;
                            lead_user_id?: string;
                            thread_title: string;
                            thread_v2_id: string;
                        },
                        {
                            openSharedMedia: (
                                self: ScreenHandle,
                                state:
                                    | {
                                        is_group: ...;
                                        peer_user_fbid?: ...;
                                        peer_user_id?: ...;
                                        thread_title: ...;
                                        thread_v2_id: ...;
                                    }
                                    | {
                                        is_group: ...;
                                        lead_user_id?: ...;
                                        thread_title: ...;
                                        thread_v2_id: ...;
                                    },
                            ) => ScreenEdgeBound<
                                ScreenEdgeShape<(...), (...), (...), (...)>,
                                (...args: ...) => ...,
                            >;
                        },
                        Record<never, never>,
                        ScreenHandle,
                        "required",
                        true,
                        "thread_v2_id",
                        AndroidScreens,
                    >,

                        | IgApiError
                        | RequestError
                        | ParseError
                        | TransportError
                        | ScreenDataError
                        | ScreenEnterConcurrentError
                        | ScreenEdgeInputError,
                    | PlainJsonApiHttp
                    | GraphqlJsonHttp
                    | MobileApplication
                    | MobileNavigation
                    | ScreenStack
                    | ScreenCatalog,
                >,
            >;
            sendMessage: (
                self: ScreenHandle,
                state:
                    | {
                        has_messages: boolean;
                        is_group: false;
                        ordinal_reserved?: boolean;
                        participants: readonly {
                            fbid_v2?: string;
                            full_name: string;
                            pk: string;
                            username: string;
                        }[];
                        peer_user_fbid?: string;
                        peer_user_id?: string;
                        send_attribution?: | "inbox"
                        | "inbox_new_message"
                        | "message_button"
                        | "direct_thread_creation_omnipicker";
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                    }
                    | {
                        has_messages: boolean;
                        is_group: true;
                        lead_user_id?: string;
                        ordinal_reserved?: boolean;
                        participants: readonly {
                            fbid_v2?: string;
                            full_name: string;
                            pk: string;
                            username: string;
                        }[];
                        send_attribution?: | "inbox"
                        | "inbox_new_message"
                        | "message_button"
                        | "direct_thread_creation_omnipicker";
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                    },
            ) => (
                ...args: [text: string],
            ) => Effect<
                {
                    action: string;
                    client_context: string;
                    message_metadata: DirectBroadcastResponseMessageMetadata[];
                    payload: DirectBroadcastResponsePayload;
                    status: string;
                    status_code: string;
                } & { raw: ActionRaw },

                    | IgApiError
                    | RequestError
                    | ParseError
                    | TransportError
                    | ScreenEnterConcurrentError,
                | PlainJsonApiHttp
                | Signature
                | MobileSession
                | MobileDevice
                | GraphqlJsonHttp
                | MobileApplication
                | NavigationWire
                | MobileNavigation
                | MobileUserFlows
                | ScreenStack
                | AndroidQuickPromotionStash,
            >;
        },
        {
            media: {
                at: "media";
                by: "media_type";
                key: "pk";
                source: ScreenItemNodes;
                variants: {
                    "1": ScreenItemDefinition<
                        "DirectPhoto",
                        {
                            height: number;
                            media_type: 1;
                            pk: string;
                            url: string;
                            width: number;
                        },
                        {
                            height: number;
                            media_type: 1;
                            pk: string;
                            url: string;
                            width: number;
                        },
                        Record<never, never>,
                        never,
                        never,
                        {},
                        undefined,
                        never,
                    >;
                    "2": ScreenItemDefinition<
                        "DirectVideo",
                        {
                            height: number;
                            media_type: 2;
                            pk: string;
                            url: string;
                            width: number;
                        },
                        {
                            height: number;
                            media_type: 2;
                            pk: string;
                            url: string;
                            width: number;
                        },
                        Record<never, never>,
                        never,
                        never,
                        {},
                        undefined,
                        never,
                    >;
                    "8": ScreenItemDefinition<
                        "DirectCarousel",
                        {
                            media_type: 8;
                            pk: string;
                            slides: readonly { media_type: 1
                            | 2; pk: string; url: string }[];
                        },
                        {
                            media_type: 8;
                            pk: string;
                            slides: readonly { media_type: 1
                            | 2; pk: string; url: string }[];
                        },
                        Record<never, never>,
                        never,
                        never,
                        {},
                        undefined,
                        never,
                    >;
                };
            };
            messages: {
                at: "messages";
                item: ScreenItemDefinition<
                    "DirectThreadMessage",
                    {
                        client_context?: string;
                        item_id: string;
                        item_type: string;
                        media?: | {
                            height: number;
                            media_type: 1;
                            pk: string;
                            url: string;
                            width: number;
                        }
                        | {
                            height: number;
                            media_type: 2;
                            pk: string;
                            url: string;
                            width: number;
                        }
                        | {
                            media_type: 8;
                            pk: string;
                            slides: readonly { media_type: 1
                            | 2; pk: string; url: string }[];
                        };
                        text?: string;
                        timestamp: string;
                        user_id: string;
                    },
                    {
                        client_context?: string;
                        item_id: string;
                        item_type: string;
                        media?: | {
                            height: number;
                            media_type: 1;
                            pk: string;
                            url: string;
                            width: number;
                        }
                        | {
                            height: number;
                            media_type: 2;
                            pk: string;
                            url: string;
                            width: number;
                        }
                        | {
                            media_type: 8;
                            pk: string;
                            slides: readonly { media_type: 1
                            | 2; pk: string; url: string }[];
                        };
                        text?: string;
                        timestamp: string;
                        user_id: string;
                    },
                    DirectThreadMessageState,
                    never,
                    never,
                    {
                        react: (
                            self: ScreenHandle,
                            state: DirectThreadMessageState,
                        ) => (
                            ...args: [reaction: "like"],
                        ) => Effect<
                            {
                                action: string;
                                client_context: string;
                                message_metadata: (...)[];
                                payload: DirectBroadcastResponsePayload;
                                status: string;
                                status_code: string;
                            } & { raw: ActionRaw },

                                | IgApiError
                                | RequestError
                                | ParseError
                                | TransportError
                                | ScreenEnterConcurrentError,
                            | PlainJsonApiHttp
                            | Signature
                            | MobileDevice
                            | NavigationWire
                            | MobileNavigation
                            | MobileUserFlows
                            | ScreenStack,
                        >;
                    },
                    | {
                        has_messages: boolean;
                        is_group: false;
                        ordinal_reserved?: boolean;
                        participants: readonly {
                            fbid_v2?: string;
                            full_name: string;
                            pk: string;
                            username: string;
                        }[];
                        peer_user_fbid?: string;
                        peer_user_id?: string;
                        send_attribution?: | "inbox"
                        | "inbox_new_message"
                        | "message_button"
                        | "direct_thread_creation_omnipicker";
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                    }
                    | {
                        has_messages: boolean;
                        is_group: true;
                        lead_user_id?: string;
                        ordinal_reserved?: boolean;
                        participants: readonly {
                            fbid_v2?: string;
                            full_name: string;
                            pk: string;
                            username: string;
                        }[];
                        send_attribution?: | "inbox"
                        | "inbox_new_message"
                        | "message_button"
                        | "direct_thread_creation_omnipicker";
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                    },
                    never,
                >;
                key: "item_id";
                source: ScreenItemNodes;
            };
            participants: {
                at: "users";
                item: ScreenItemDefinition<
                    "DirectThreadParticipant",
                    { fbid_v2?: string; full_name: string; pk: string; username: string },
                    { fbid_v2?: string; full_name: string; pk: string; username: string },
                    DirectThreadParticipantState,
                    never,
                    never,
                    {
                        openNicknameEditor: (
                            self: ScreenHandle,
                            state: DirectThreadParticipantState,
                        ) => ScreenEdgeBound<
                            ScreenEdgeShape<
                                ScreenDefinition<
                                    "DirectThreadNicknameChange",
                                    "screen",
                                    { thread_v2_id: string; user_id: string },
                                    { thread_v2_id: string; user_id: string },
                                    { thread_v2_id: string; user_id: string },
                                    never,
                                    MobileNavigation,
                                    { changeNickname: (self: ..., state: ...) => ... },
                                    Record<never, never>,
                                    never,
                                    "user_id",
                                >,
                                [],
                                "button",
                                AndroidScreens,
                            >,
                            (
                                ...args: [],
                            ) => Effect<
                                AssembledHandle<
                                    "DirectThreadNicknameChange",
                                    "screen",
                                    { thread_v2_id: ...; user_id: ... },
                                    { changeNickname: ... },
                                    Record<(...), (...)>,
                                    ScreenHandle,
                                    "required",
                                    true,
                                    "user_id",
                                    AndroidScreens,
                                >,
                                ScreenDataError | ScreenEnterConcurrentError | ScreenEdgeInputError,
                                MobileNavigation | ScreenStack | ScreenCatalog,
                            >,
                        >;
                    },
                    | {
                        has_messages: boolean;
                        is_group: false;
                        ordinal_reserved?: boolean;
                        participants: readonly {
                            fbid_v2?: string;
                            full_name: string;
                            pk: string;
                            username: string;
                        }[];
                        peer_user_fbid?: string;
                        peer_user_id?: string;
                        send_attribution?: | "inbox"
                        | "inbox_new_message"
                        | "message_button"
                        | "direct_thread_creation_omnipicker";
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                    }
                    | {
                        has_messages: boolean;
                        is_group: true;
                        lead_user_id?: string;
                        ordinal_reserved?: boolean;
                        participants: readonly {
                            fbid_v2?: string;
                            full_name: string;
                            pk: string;
                            username: string;
                        }[];
                        send_attribution?: | "inbox"
                        | "inbox_new_message"
                        | "message_button"
                        | "direct_thread_creation_omnipicker";
                        thread_id: string;
                        thread_title: string;
                        thread_v2_id?: string;
                    },
                    never,
                >;
                key: "pk";
                source: ScreenItemNodes;
            };
        },
        never,
        never,
    > = ...

    DirectThreadFragment:direct_thread, a conversation.

    Three entries, a sum on the input; all open a conversation that exists:

    • an existing thread, opened from a list row (kind: 'thread'): the inbox's or the "New message" picker's thread row. The enter sends a group's join requests, brings the thread to front, subscribes a one-to-one peer's presence and, when the app does not hold the conversation locally (MobileSessionState.directLoadedThreads), loads it; a stored conversation shows the row.
    • a picked recipient (kind: 'recipient'), from the inbox's "New message" picker: the participant lookup (direct_v2/threads/get_by_participants/) runs while the picker is still in front — the app's order — and the conversation it answers with (thread) is shown from that answer, with no presence subscribed: in 1:1 the answer names a hidden earlier thread with no messages, and the app shows that empty conversation and subscribes nothing (owner decision, 2026-10-24: the picker always opens a thread). An answer without a thread is not a conversation this model can show: the typed DirectThreadNotFoundByParticipantsError, raised before the screen comes to front.
    • a created group (kind: 'created'), from the group picker's createGroup: the input carries the ids the creation answered (thread_id, thread_v2_id) and the picked people in pick order (target_user_ids). The participant lookup that follows the creation is sent by the picker's createGroup while the group picker is still in front, before this entry (the creation, then the lookup 0.15 s later in 451, both on the picker's chain); its answer for a just-created group names no conversation, so nothing is read from it. This entry yields the navigation, sends the Direct thread's quick-promotion batch (QuickPromotionSurfaceQueryV3), then IGDirectGetThreadQuery (min_uq_seq_id the inbox sequence plus one), and shows the thread from that answer. No presence is subscribed.

    Actions take no list element as an argument: a reaction is the message's own react, the nickname editor is the participant's own openNicknameEditor, and each item reads the thread its action sends from this screen's state (its host's state), never from a copy in its entry. The handle's data is under data (thread.data.thread); it declares no main identifier, because the thread's ids live inside the thread member of its data.

    The theme and nickname requests live on their own screens (DirectCustomizeChat / DirectThreadThemePicker, DirectThreadNicknameChange).

    Guide: A conversation