Class FingerprintServerApiClient

Implements

  • FingerprintApi

Constructors

Properties

apiKey: string
region: Region

Methods

  • Delete data by visitor ID Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. All delete requests are queued: Recent data (10 days or newer) belonging to the specified visitor will be deleted within 24 hours. * Data from older (11 days or more) identification events will be deleted after 90 days. If you are interested in using this API, please contact our support team to activate it for you. Otherwise, you will receive a 403.

    Parameters

    • visitorId: string

      The visitor ID you want to delete.*

    Returns Promise<void>

    Promise that resolves when the deletion request is successfully queued

    client
    .deleteVisitorData('<visitorId>')
    .then(() => {
    // Data deletion request was successfully queued
    })
    .catch((error) => {
    if (error instanceof RequestError) {
    console.log(error.statusCode, error.message)
    // Access raw response in error
    console.log(error.response)
    }
    })
  • Retrieves a specific identification event with the information from each activated product — Identification and all active Smart signals.

    Parameters

    • eventId: string

      identifier of the event

    • Optionaloptions: { ruleset_id?: string }

      Optional getEvent operation options

      • Optionalruleset_id?: string

        The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the rule_action attribute of the response.

    Returns Promise<
        {
            bot?: "bad"
            | "good"
            | "not_detected";
            bot_info?: {
                category: string;
                confidence: "high" | "low" | "medium";
                identity: "unknown" | "verified" | "signed" | "spoofed";
                name: string;
                provider: string;
                provider_url?: string;
            };
            bot_type?: string;
            browser_details?: {
                browser_full_version: string;
                browser_major_version: string;
                browser_name: string;
                device: string;
                os: string;
                os_version: string;
            };
            bundle_id?: string;
            client_referrer?: string;
            cloned_app?: boolean;
            developer_tools?: boolean;
            emulator?: boolean;
            environment_id?: string;
            event_id: string;
            factory_reset_timestamp?: number;
            frida?: boolean;
            high_activity_device?: boolean;
            identification?: {
                confidence?: { comment?: string; score: number; version?: string };
                first_seen_at?: number;
                last_seen_at?: number;
                visitor_found: boolean;
                visitor_id: string;
            };
            incognito?: boolean;
            ip_address?: string;
            ip_blocklist?: {
                attack_source?: boolean;
                email_spam?: boolean;
                tor_node?: boolean;
            };
            ip_info?: {
                v4?: {
                    address: string;
                    asn?: string;
                    asn_name?: string;
                    asn_network?: string;
                    asn_type?: string;
                    datacenter_name?: string;
                    datacenter_result?: boolean;
                    geolocation?: {
                        accuracy_radius?: number;
                        city_name?: string;
                        continent_code?: string;
                        continent_name?: string;
                        country_code?: string;
                        country_name?: string;
                        latitude?: number;
                        longitude?: number;
                        postal_code?: string;
                        subdivisions?: { iso_code: ...; name: ... }[];
                        timezone?: string;
                    };
                };
                v6?: {
                    address: string;
                    asn?: string;
                    asn_name?: string;
                    asn_network?: string;
                    asn_type?: string;
                    datacenter_name?: string;
                    datacenter_result?: boolean;
                    geolocation?: {
                        accuracy_radius?: number;
                        city_name?: string;
                        continent_code?: string;
                        continent_name?: string;
                        country_code?: string;
                        country_name?: string;
                        latitude?: number;
                        longitude?: number;
                        postal_code?: string;
                        subdivisions?: { iso_code: ...; name: ... }[];
                        timezone?: string;
                    };
                };
            };
            jailbroken?: boolean;
            linked_id?: string;
            location_spoofing?: boolean;
            mitm_attack?: boolean;
            package_name?: string;
            privacy_settings?: boolean;
            proximity?: {
                confidence: number;
                id: string;
                precision_radius: 10
                | 25
                | 65
                | 175
                | 450
                | 1200
                | 3300
                | 8500
                | 22500;
            };
            proxy?: boolean;
            proxy_confidence?: "high"
            | "low"
            | "medium";
            proxy_details?: {
                last_seen_at?: number;
                provider?: string;
                proxy_type: "residential" | "data_center";
            };
            raw_device_attributes?: {
                architecture?: number;
                audio?: number;
                canvas?: { geometry?: string; text?: string; winding?: boolean };
                color_depth?: number;
                cookies_enabled?: boolean;
                date_time_locale?: string;
                device_memory?: number;
                emoji?: {
                    bottom?: number;
                    font?: string;
                    height?: number;
                    left?: number;
                    right?: number;
                    top?: number;
                    width?: number;
                    x?: number;
                    y?: number;
                };
                font_preferences?: {
                    apple?: number;
                    default?: number;
                    min?: number;
                    mono?: number;
                    sans?: number;
                    serif?: number;
                    system?: number;
                };
                fonts?: string[];
                hardware_concurrency?: number;
                indexed_db?: boolean;
                languages?: string[][];
                local_storage?: boolean;
                math?: string;
                oscpu?: string;
                platform?: string;
                plugins?: {
                    description?: string;
                    mimeTypes?: {
                        description?: (...)
                        | (...);
                        suffixes?: (...) | (...);
                        type?: (...) | (...);
                    }[];
                    name: string;
                }[];
                screen_resolution?: number[];
                session_storage?: boolean;
                timezone?: string;
                touch_support?: {
                    max_touch_points?: number;
                    touch_event?: boolean;
                    touch_start?: boolean;
                };
                vendor?: string;
                webgl_basics?: {
                    renderer?: string;
                    renderer_unmasked?: string;
                    shading_language_version?: string;
                    vendor?: string;
                    vendor_unmasked?: string;
                    version?: string;
                };
                webgl_extensions?: {
                    context_attributes?: string;
                    extension_parameters?: string;
                    extensions?: string;
                    parameters?: string;
                    shader_precisions?: string;
                    unsupported_extensions?: string[];
                };
            };
            replayed?: boolean;
            root_apps?: boolean;
            rule_action?: | {
                request_header_modifications?: {
                    append?: { name: string; value: string }[];
                    remove?: string[];
                    set?: { name: string; value: string }[];
                };
                rule_expression?: string;
                rule_id?: string;
                ruleset_id: string;
                type: "allow";
            }
            | {
                body?: string;
                headers?: { name: string; value: string }[];
                rule_expression?: string;
                rule_id?: string;
                ruleset_id: string;
                status_code?: number;
                type: "block";
            };
            sdk?: {
                integrations?: {
                    name?: string;
                    subintegration?: { name?: string; version?: string };
                    version?: string;
                }[];
                platform: "unknown"
                | "js"
                | "android"
                | "ios";
                version: string;
            };
            supplementary_id_high_recall?: {
                confidence?: { comment?: string; score: number; version?: string };
                first_seen_at?: number;
                last_seen_at?: number;
                visitor_found: boolean;
                visitor_id: string;
            };
            suspect?: boolean;
            suspect_score?: number;
            tags?: { [key: string]: unknown };
            tampering?: boolean;
            tampering_details?: {
                anomaly_score?: number;
                anti_detect_browser?: boolean;
            };
            timestamp: number;
            url?: string;
            user_agent?: string;
            velocity?: {
                distinct_country?: {
                    "1_hour": number;
                    "24_hours"?: number;
                    "5_minutes": number;
                };
                distinct_ip?: {
                    "1_hour": number;
                    "24_hours"?: number;
                    "5_minutes": number;
                };
                distinct_ip_by_linked_id?: {
                    "1_hour": number;
                    "24_hours"?: number;
                    "5_minutes": number;
                };
                distinct_linked_id?: {
                    "1_hour": number;
                    "24_hours"?: number;
                    "5_minutes": number;
                };
                distinct_visitor_id_by_linked_id?: {
                    "1_hour": number;
                    "24_hours"?: number;
                    "5_minutes": number;
                };
                events?: { "1_hour": number; "24_hours"?: number; "5_minutes": number };
                ip_events?: {
                    "1_hour": number;
                    "24_hours"?: number;
                    "5_minutes": number;
                };
            };
            virtual_machine?: boolean;
            vpn?: boolean;
            vpn_confidence?: "high"
            | "low"
            | "medium";
            vpn_methods?: {
                auxiliary_mobile?: boolean;
                os_mismatch?: boolean;
                public_vpn?: boolean;
                relay?: boolean;
                timezone_mismatch?: boolean;
            };
            vpn_origin_country?: string;
            vpn_origin_timezone?: string;
        },
    >

    client
    .getEvent('<eventId>')
    .then((event) => console.log(event))
    .catch((error) => {
    if (error instanceof RequestError) {
    console.log(error.statusCode, error.message)
    // Access raw response in error
    console.log(error.response)
    }
    })
    client
    .getEvent('<eventId>', { ruleset_id: '<rulesetId>' })
    .then((event) => {
    const ruleAction = event.rule_action
    if (ruleAction?.type === 'block') {
    console.log('Blocked by rule:', ruleAction.rule_id, ruleAction.status_code)
    }
    })
    .catch((error) => {
    if (error instanceof RequestError) {
    console.log(error.statusCode, error.message)
    }
    })
  • Search for identification events, including Smart Signals, using multiple filtering criteria. If you don't provide start or end parameters, the default search range is the last 7 days.

    Please note that events include mobile signals (e.g. rootApps) even if the request originated from a non-mobile platform. We recommend you ignore mobile signals for such requests.

    Parameters

    • filter:
          | undefined
          | {
              anti_detect_browser?: boolean;
              asn?: string;
              bot?: "all"
              | "none"
              | "bad"
              | "good";
              bundle_id?: string;
              cloned_app?: boolean;
              developer_tools?: boolean;
              emulator?: boolean;
              end?: number;
              environment?: string[];
              factory_reset?: boolean;
              frida?: boolean;
              incognito?: boolean;
              ip_address?: string;
              jailbroken?: boolean;
              limit?: number;
              linked_id?: string;
              location_spoofing?: boolean;
              min_suspect_score?: number;
              mitm_attack?: boolean;
              origin?: string;
              package_name?: string;
              pagination_key?: string;
              privacy_settings?: boolean;
              proximity_id?: string;
              proxy?: boolean;
              reverse?: boolean;
              root_apps?: boolean;
              sdk_platform?: "js" | "android" | "ios";
              sdk_version?: string;
              start?: number;
              suspect?: boolean;
              tampering?: boolean;
              tor_node?: boolean;
              total_hits?: number;
              url?: string;
              virtual_machine?: boolean;
              visitor_id?: string;
              vpn?: boolean;
              vpn_confidence?: "high" | "low" | "medium";
          }

      Events filter

      • undefined
      • {
            anti_detect_browser?: boolean;
            asn?: string;
            bot?: "all" | "none" | "bad" | "good";
            bundle_id?: string;
            cloned_app?: boolean;
            developer_tools?: boolean;
            emulator?: boolean;
            end?: number;
            environment?: string[];
            factory_reset?: boolean;
            frida?: boolean;
            incognito?: boolean;
            ip_address?: string;
            jailbroken?: boolean;
            limit?: number;
            linked_id?: string;
            location_spoofing?: boolean;
            min_suspect_score?: number;
            mitm_attack?: boolean;
            origin?: string;
            package_name?: string;
            pagination_key?: string;
            privacy_settings?: boolean;
            proximity_id?: string;
            proxy?: boolean;
            reverse?: boolean;
            root_apps?: boolean;
            sdk_platform?: "js" | "android" | "ios";
            sdk_version?: string;
            start?: number;
            suspect?: boolean;
            tampering?: boolean;
            tor_node?: boolean;
            total_hits?: number;
            url?: string;
            virtual_machine?: boolean;
            visitor_id?: string;
            vpn?: boolean;
            vpn_confidence?: "high" | "low" | "medium";
        }
        • Optionalanti_detect_browser?: boolean

          Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the tampering.anti_detect_browser property set to true or false are returned. Events without a tampering Smart Signal result are left out of the response.

        • Optionalasn?: string

          Filter events by the ASN associated with the event's IP address. This corresponds to the ip_info.(v4|v6).asn property in the response.

        • Optionalbot?: "all" | "none" | "bad" | "good"

          Filter events by the Bot Detection result, specifically: all - events where any kind of bot was detected. good - events where a good bot was detected. bad - events where a bad bot was detected. none - events where no bot was detected. > Note: When using this parameter, only events with the bot property set to a valid value are returned. Events without a bot Smart Signal result are left out of the response.

        • Optionalbundle_id?: string

          Filter events by the Bundle ID (iOS) associated with the event.

        • Optionalcloned_app?: boolean

          Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the cloned_app property set to true or false are returned. Events without a cloned_app Smart Signal result are left out of the response.

        • Optionaldeveloper_tools?: boolean

          Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the developer_tools property set to true or false are returned. Events without a developer_tools Smart Signal result are left out of the response.

        • Optionalemulator?: boolean

          Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the emulator property set to true or false are returned. Events without an emulator Smart Signal result are left out of the response.

        • Optionalend?: number

          Filter events with a timestamp smaller than the end time, in Unix time (milliseconds).

        • Optionalenvironment?: string[]

          Filter for events by providing one or more environment IDs (environment_id property).

        • Optionalfactory_reset?: boolean

          Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a factory_reset time. Events without a factory_reset Smart Signal result are left out of the response.

        • Optionalfrida?: boolean

          Filter events by Frida Detection result. > Note: When using this parameter, only events with the frida property set to true or false are returned. Events without a frida Smart Signal result are left out of the response.

        • Optionalincognito?: boolean

          Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the incognito property set to true or false are returned. Events without an incognito Smart Signal result are left out of the response.

        • Optionalip_address?: string

          Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32

        • Optionaljailbroken?: boolean

          Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the jailbroken property set to true or false are returned. Events without a jailbroken Smart Signal result are left out of the response.

        • Optionallimit?: number

          Limit the number of events returned.

        • Optionallinked_id?: string

          Filter events by your custom identifier.

          You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-get-function#linkedid) to associate identification requests with your own identifier, for example, session Id, purchase Id, or transaction Id. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier.
          
        • Optionallocation_spoofing?: boolean

          Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the location_spoofing property set to true or false are returned. Events without a location_spoofing Smart Signal result are left out of the response.

        • Optionalmin_suspect_score?: number

          Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the suspect_score property set to a value exceeding your threshold are returned. Events without a suspect_score Smart Signal result are left out of the response.

        • Optionalmitm_attack?: boolean

          Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the mitm_attack property set to true or false are returned. Events without a mitm_attack Smart Signal result are left out of the response.

        • Optionalorigin?: string

          Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com)

        • Optionalpackage_name?: string

          Filter events by the Package Name (Android) associated with the event.

        • Optionalpagination_key?: string

          Use pagination_key to get the next page of results.

          When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. In the following request, use that value in the `pagination_key` parameter to get the next page of results:
          
          1. First request, returning most recent 200 events: `GET api-base-url/events?limit=100`
          2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085`
          
        • Optionalprivacy_settings?: boolean

          Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the privacy_settings property set to true or false are returned. Events without a privacy_settings Smart Signal result are left out of the response.

        • Optionalproximity_id?: string

          Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the proximity.id property matching the provided ID are returned. Events without a proximity result are left out of the response.

        • Optionalproxy?: boolean

          Filter events by Proxy detection result. > Note: When using this parameter, only events with the proxy property set to true or false are returned. Events without a proxy Smart Signal result are left out of the response.

        • Optionalreverse?: boolean

          Sort events in reverse timestamp order.

        • Optionalroot_apps?: boolean

          Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the root_apps property set to true or false are returned. Events without a root_apps Smart Signal result are left out of the response.

        • Optionalsdk_platform?: "js" | "android" | "ios"

          Filter events by the SDK Platform associated with the identification event (sdk.platform property) . js - Javascript agent (Web). ios - Apple iOS based devices. android - Android based devices.

        • Optionalsdk_version?: string

          Filter events by a specific SDK version associated with the identification event (sdk.version property). Example: 3.11.14

        • Optionalstart?: number

          Filter events with a timestamp greater than the start time, in Unix time (milliseconds).

        • Optionalsuspect?: boolean

          Filter events previously tagged as suspicious via the Update API. > Note: When using this parameter, only events with the suspect property explicitly set to true or false are returned. Events with undefined suspect property are left out of the response.

        • Optionaltampering?: boolean

          Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the tampering.result property set to true or false are returned. Events without a tampering Smart Signal result are left out of the response.

        • Optionaltor_node?: boolean

          Filter events by Tor Node detection result. > Note: When using this parameter, only events with the tor_node property set to true or false are returned. Events without a tor_node detection result are left out of the response.

        • Optionaltotal_hits?: number

          When set, the response will include a total_hits property with a count of total query matches across all pages, up to the specified limit.

        • Optionalurl?: string

          Filter events by the URL (url property) associated with the event.

        • Optionalvirtual_machine?: boolean

          Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the virtual_machine property set to true or false are returned. Events without a virtual_machine Smart Signal result are left out of the response.

        • Optionalvisitor_id?: string

          Unique visitor identifier issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this visitor_id.

        • Optionalvpn?: boolean

          Filter events by VPN Detection result. > Note: When using this parameter, only events with the vpn property set to true or false are returned. Events without a vpn Smart Signal result are left out of the response.

        • Optionalvpn_confidence?: "high" | "low" | "medium"

          Filter events by VPN Detection result confidence level. high - events with high VPN Detection confidence. medium - events with medium VPN Detection confidence. low - events with low VPN Detection confidence. > Note: When using this parameter, only events with the vpn.confidence property set to a valid value are returned. Events without a vpn Smart Signal result are left out of the response.

    Returns Promise<
        {
            events: {
                bot?: "bad"
                | "good"
                | "not_detected";
                bot_info?: {
                    category: string;
                    confidence: "high" | "low" | "medium";
                    identity: "unknown" | "verified" | "signed" | "spoofed";
                    name: string;
                    provider: string;
                    provider_url?: string;
                };
                bot_type?: string;
                browser_details?: {
                    browser_full_version: string;
                    browser_major_version: string;
                    browser_name: string;
                    device: string;
                    os: string;
                    os_version: string;
                };
                bundle_id?: string;
                client_referrer?: string;
                cloned_app?: boolean;
                developer_tools?: boolean;
                emulator?: boolean;
                environment_id?: string;
                event_id: string;
                factory_reset_timestamp?: number;
                frida?: boolean;
                high_activity_device?: boolean;
                identification?: {
                    confidence?: { comment?: string; score: number; version?: string };
                    first_seen_at?: number;
                    last_seen_at?: number;
                    visitor_found: boolean;
                    visitor_id: string;
                };
                incognito?: boolean;
                ip_address?: string;
                ip_blocklist?: {
                    attack_source?: boolean;
                    email_spam?: boolean;
                    tor_node?: boolean;
                };
                ip_info?: {
                    v4?: {
                        address: string;
                        asn?: string;
                        asn_name?: string;
                        asn_network?: string;
                        asn_type?: string;
                        datacenter_name?: string;
                        datacenter_result?: boolean;
                        geolocation?: {
                            accuracy_radius?: (...)
                            | (...);
                            city_name?: (...) | (...);
                            continent_code?: (...) | (...);
                            continent_name?: (...) | (...);
                            country_code?: (...) | (...);
                            country_name?: (...) | (...);
                            latitude?: (...) | (...);
                            longitude?: (...) | (...);
                            postal_code?: (...) | (...);
                            subdivisions?: (...) | (...);
                            timezone?: (...) | (...);
                        };
                    };
                    v6?: {
                        address: string;
                        asn?: string;
                        asn_name?: string;
                        asn_network?: string;
                        asn_type?: string;
                        datacenter_name?: string;
                        datacenter_result?: boolean;
                        geolocation?: {
                            accuracy_radius?: (...)
                            | (...);
                            city_name?: (...) | (...);
                            continent_code?: (...) | (...);
                            continent_name?: (...) | (...);
                            country_code?: (...) | (...);
                            country_name?: (...) | (...);
                            latitude?: (...) | (...);
                            longitude?: (...) | (...);
                            postal_code?: (...) | (...);
                            subdivisions?: (...) | (...);
                            timezone?: (...) | (...);
                        };
                    };
                };
                jailbroken?: boolean;
                linked_id?: string;
                location_spoofing?: boolean;
                mitm_attack?: boolean;
                package_name?: string;
                privacy_settings?: boolean;
                proximity?: {
                    confidence: number;
                    id: string;
                    precision_radius: 10
                    | 25
                    | 65
                    | 175
                    | 450
                    | 1200
                    | 3300
                    | 8500
                    | 22500;
                };
                proxy?: boolean;
                proxy_confidence?: "high"
                | "low"
                | "medium";
                proxy_details?: {
                    last_seen_at?: number;
                    provider?: string;
                    proxy_type: "residential" | "data_center";
                };
                raw_device_attributes?: {
                    architecture?: number;
                    audio?: number;
                    canvas?: { geometry?: string; text?: string; winding?: boolean };
                    color_depth?: number;
                    cookies_enabled?: boolean;
                    date_time_locale?: string;
                    device_memory?: number;
                    emoji?: {
                        bottom?: number;
                        font?: string;
                        height?: number;
                        left?: number;
                        right?: number;
                        top?: number;
                        width?: number;
                        x?: number;
                        y?: number;
                    };
                    font_preferences?: {
                        apple?: number;
                        default?: number;
                        min?: number;
                        mono?: number;
                        sans?: number;
                        serif?: number;
                        system?: number;
                    };
                    fonts?: string[];
                    hardware_concurrency?: number;
                    indexed_db?: boolean;
                    languages?: string[][];
                    local_storage?: boolean;
                    math?: string;
                    oscpu?: string;
                    platform?: string;
                    plugins?: { description?: string; mimeTypes?: (...)[]; name: string }[];
                    screen_resolution?: number[];
                    session_storage?: boolean;
                    timezone?: string;
                    touch_support?: {
                        max_touch_points?: number;
                        touch_event?: boolean;
                        touch_start?: boolean;
                    };
                    vendor?: string;
                    webgl_basics?: {
                        renderer?: string;
                        renderer_unmasked?: string;
                        shading_language_version?: string;
                        vendor?: string;
                        vendor_unmasked?: string;
                        version?: string;
                    };
                    webgl_extensions?: {
                        context_attributes?: string;
                        extension_parameters?: string;
                        extensions?: string;
                        parameters?: string;
                        shader_precisions?: string;
                        unsupported_extensions?: string[];
                    };
                };
                replayed?: boolean;
                root_apps?: boolean;
                rule_action?: | {
                    request_header_modifications?: {
                        append?: { name: ...; value: ... }[];
                        remove?: string[];
                        set?: { name: ...; value: ... }[];
                    };
                    rule_expression?: string;
                    rule_id?: string;
                    ruleset_id: string;
                    type: "allow";
                }
                | {
                    body?: string;
                    headers?: { name: string; value: string }[];
                    rule_expression?: string;
                    rule_id?: string;
                    ruleset_id: string;
                    status_code?: number;
                    type: "block";
                };
                sdk?: {
                    integrations?: {
                        name?: string;
                        subintegration?: { name?: ...; version?: ... };
                        version?: string;
                    }[];
                    platform: "unknown"
                    | "js"
                    | "android"
                    | "ios";
                    version: string;
                };
                supplementary_id_high_recall?: {
                    confidence?: { comment?: string; score: number; version?: string };
                    first_seen_at?: number;
                    last_seen_at?: number;
                    visitor_found: boolean;
                    visitor_id: string;
                };
                suspect?: boolean;
                suspect_score?: number;
                tags?: { [key: string]: unknown };
                tampering?: boolean;
                tampering_details?: {
                    anomaly_score?: number;
                    anti_detect_browser?: boolean;
                };
                timestamp: number;
                url?: string;
                user_agent?: string;
                velocity?: {
                    distinct_country?: {
                        "1_hour": number;
                        "24_hours"?: number;
                        "5_minutes": number;
                    };
                    distinct_ip?: {
                        "1_hour": number;
                        "24_hours"?: number;
                        "5_minutes": number;
                    };
                    distinct_ip_by_linked_id?: {
                        "1_hour": number;
                        "24_hours"?: number;
                        "5_minutes": number;
                    };
                    distinct_linked_id?: {
                        "1_hour": number;
                        "24_hours"?: number;
                        "5_minutes": number;
                    };
                    distinct_visitor_id_by_linked_id?: {
                        "1_hour": number;
                        "24_hours"?: number;
                        "5_minutes": number;
                    };
                    events?: { "1_hour": number; "24_hours"?: number; "5_minutes": number };
                    ip_events?: {
                        "1_hour": number;
                        "24_hours"?: number;
                        "5_minutes": number;
                    };
                };
                virtual_machine?: boolean;
                vpn?: boolean;
                vpn_confidence?: "high"
                | "low"
                | "medium";
                vpn_methods?: {
                    auxiliary_mobile?: boolean;
                    os_mismatch?: boolean;
                    public_vpn?: boolean;
                    relay?: boolean;
                    timezone_mismatch?: boolean;
                };
                vpn_origin_country?: string;
                vpn_origin_timezone?: string;
            }[];
            pagination_key?: string;
            total_hits?: number;
        },
    >

  • Update an event with a given event ID

    Parameters

    • eventId: string

      The unique event identifier.

    • body: { linked_id?: string; suspect?: boolean; tags?: { [key: string]: unknown } }

      Data to update the event with.

      • Optionallinked_id?: string

        Linked Id value to assign to the existing event

      • Optionalsuspect?: boolean

        Suspect flag indicating observed suspicious or fraudulent event

      • Optionaltags?: { [key: string]: unknown }

        A customer-provided value or an object that was sent with the identification request or updated later.

    Returns Promise<void>

    Change information in existing events specified by eventId or flag suspicious events.

    When an event is created, it is assigned linkedId and tag submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact.

    Warning It's not possible to update events older than one month.

    const body = {
    linked_id: 'linked_id',
    suspect: false,
    }

    client
    .updateEvent('<eventId>', body)
    .then(() => {
    // Event was successfully updated
    })
    .catch((error) => {
    if (error instanceof RequestError) {
    console.log(error.statusCode, error.message)
    // Access raw response in error
    console.log(error.response)

    if(error.statusCode === 409) {
    // Event is not mutable yet, wait a couple of seconds and retry the update.
    }
    }
    })