Coverage for fingerprint_server_sdk/api/fingerprint_api.py: 84%
283 statements
« prev ^ index » next coverage.py v7.14.3, created at 2026-11-03 19:57 +0000
« prev ^ index » next coverage.py v7.14.3, created at 2026-11-03 19:57 +0000
1"""
2Server API
3Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios.
4Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.
5The API also supports collection of Automation Intelligence for requests to your server in edge, pre-origin, or middleware contexts.
7The version of the OpenAPI document: 4
8Contact: support@fingerprint.com
9Generated by OpenAPI Generator (https://openapi-generator.tech)
11Do not edit the class manually.
12""" # noqa: E501
14from datetime import date, datetime
15from typing import Annotated, Any, Optional, Union # noqa: UP035
17from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr, validate_call
19from fingerprint_server_sdk.api_client import ApiClient, RequestSerialized
20from fingerprint_server_sdk.api_response import ApiResponse
21from fingerprint_server_sdk.configuration import Configuration
22from fingerprint_server_sdk.models.bot_info_category import BotInfoCategory
23from fingerprint_server_sdk.models.bot_info_confidence import BotInfoConfidence
24from fingerprint_server_sdk.models.bot_info_identity import BotInfoIdentity
25from fingerprint_server_sdk.models.event import Event
26from fingerprint_server_sdk.models.event_search import EventSearch
27from fingerprint_server_sdk.models.event_update import EventUpdate
28from fingerprint_server_sdk.models.search_events_bot import SearchEventsBot
29from fingerprint_server_sdk.models.search_events_bot_info import SearchEventsBotInfo
30from fingerprint_server_sdk.models.search_events_end_parameter import SearchEventsEndParameter
31from fingerprint_server_sdk.models.search_events_incremental_identification_status import (
32 SearchEventsIncrementalIdentificationStatus,
33)
34from fingerprint_server_sdk.models.search_events_rare_device_percentile_bucket import (
35 SearchEventsRareDevicePercentileBucket,
36)
37from fingerprint_server_sdk.models.search_events_sdk_platform import SearchEventsSdkPlatform
38from fingerprint_server_sdk.models.search_events_source import SearchEventsSource
39from fingerprint_server_sdk.models.search_events_start_parameter import SearchEventsStartParameter
40from fingerprint_server_sdk.models.search_events_vpn_confidence import SearchEventsVpnConfidence
41from fingerprint_server_sdk.rest import RESTResponseType
43# Type alias for query and form parameter values
44ParamValue = Union[
45 list[BotInfoCategory],
46 list[BotInfoIdentity],
47 list[BotInfoConfidence],
48 list[SearchEventsSource],
49 str,
50 int,
51 float,
52 bool,
53 list[str],
54]
57class FingerprintApi:
58 """Fingerprint Python Server SDK
60 Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. Fingerprint Server API allows you to search, update, and delete identification events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.
62 :param configuration: API client configuration.
63 """
65 def __init__(self, configuration: Configuration) -> None:
66 self.api_client = ApiClient(configuration)
68 @validate_call
69 def delete_visitor_data(
70 self,
71 visitor_id: Annotated[
72 StrictStr,
73 Field(
74 description='The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete.'
75 ),
76 ],
77 _request_timeout: Union[
78 None,
79 Annotated[StrictFloat, Field(gt=0)],
80 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
81 ] = None,
82 _request_auth: Optional[dict[StrictStr, Any]] = None,
83 _content_type: Optional[StrictStr] = None,
84 _headers: Optional[dict[StrictStr, Any]] = None,
85 ) -> None:
86 """Delete a visitor ID
88 Use this API to request the deletion of all data associated with a specific visitor ID. Upon a request to delete data for a visitor ID, - The data collected from the corresponding browser (or device) will be deleted asynchronously, typically within a few minutes. This data will no longer be available to identify this browser (or device). When the same browser (or device) revisits, it will receive a new visitor ID. - The identification events made from this browser (or device) in the past 10 days are typically deleted within 24 hrs. - The identification events made from this browser (or device) outside of the 10 days will be purged as per your [data retention period](https://docs.fingerprint.com/docs/regions#data-retention). The following timeline illustrates which events are deleted and which remain after a DELETE API request: ``` Day 1: First visit from browser A. (Assigned visitor ID: VID1000) Day 2: Browser A revisits. (Assigned the same visitor ID: VID1000) Day 13: Browser A revisits. (Assigned the same visitor ID: VID1000) Day 14: Delete VID1000 Day 15: Browser A re-visits. (Assigned a different visitor ID: VID9999) Day 15: GET /events/day-13 (Returns 404. The event is within the 10 days of deleting VID1000 and will have been deleted) Day 16: GET /events/day-2 (Returns 200. The event is outside of the 10 days of deleting VID1000 and is still available) ``` ### Availability This API is available only for Enterprise plans **upon request**. If you are interested, please [contact our support team](https://fingerprint.com/support/). ### Rate limits and daily quota The rate limits and daily quota for this API **differ** from those for our other API. The maximum number of DELETE requests that can be made in an hour cannot exceed 30 RPH, and the maximum number that can be made in a day cannot exceed 500 RPD. You can request an increase to these limits by contacting [our support team](https://fingerprint.com/support/).
90 :param visitor_id: The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete. (required)
91 :type visitor_id: str
92 :param _request_timeout: timeout setting for this request. If one
93 number provided, it will be total request
94 timeout. It can also be a pair (tuple) of
95 (connection, read) timeouts.
96 :type _request_timeout: int, tuple(int, int), optional
97 :param _request_auth: set to override the auth_settings for an a single
98 request; this effectively ignores the
99 authentication in the spec for a single request.
100 :type _request_auth: dict, optional
101 :param _content_type: force content-type for the request.
102 :type _content_type: str, Optional
103 :param _headers: set to override the headers for a single
104 request; this effectively ignores the headers
105 in the spec for a single request.
106 :type _headers: dict, optional
107 :return: Returns the result object.
108 """ # noqa: E501
110 _param = self._delete_visitor_data_serialize(
111 visitor_id=visitor_id,
112 _request_auth=_request_auth,
113 _content_type=_content_type,
114 _headers=_headers,
115 )
117 _response_types_map: dict[str, Optional[str]] = {
118 '200': None,
119 '400': 'ErrorResponse',
120 '403': 'ErrorResponse',
121 '404': 'ErrorResponse',
122 '429': 'ErrorResponse',
123 }
125 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
126 response_data.read()
127 self.api_client.response_deserialize(
128 response_data=response_data,
129 response_types_map=_response_types_map,
130 )
132 @validate_call
133 def delete_visitor_data_with_http_info(
134 self,
135 visitor_id: Annotated[
136 StrictStr,
137 Field(
138 description='The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete.'
139 ),
140 ],
141 _request_timeout: Union[
142 None,
143 Annotated[StrictFloat, Field(gt=0)],
144 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
145 ] = None,
146 _request_auth: Optional[dict[StrictStr, Any]] = None,
147 _content_type: Optional[StrictStr] = None,
148 _headers: Optional[dict[StrictStr, Any]] = None,
149 ) -> ApiResponse[None]:
150 """Delete a visitor ID
152 Use this API to request the deletion of all data associated with a specific visitor ID. Upon a request to delete data for a visitor ID, - The data collected from the corresponding browser (or device) will be deleted asynchronously, typically within a few minutes. This data will no longer be available to identify this browser (or device). When the same browser (or device) revisits, it will receive a new visitor ID. - The identification events made from this browser (or device) in the past 10 days are typically deleted within 24 hrs. - The identification events made from this browser (or device) outside of the 10 days will be purged as per your [data retention period](https://docs.fingerprint.com/docs/regions#data-retention). The following timeline illustrates which events are deleted and which remain after a DELETE API request: ``` Day 1: First visit from browser A. (Assigned visitor ID: VID1000) Day 2: Browser A revisits. (Assigned the same visitor ID: VID1000) Day 13: Browser A revisits. (Assigned the same visitor ID: VID1000) Day 14: Delete VID1000 Day 15: Browser A re-visits. (Assigned a different visitor ID: VID9999) Day 15: GET /events/day-13 (Returns 404. The event is within the 10 days of deleting VID1000 and will have been deleted) Day 16: GET /events/day-2 (Returns 200. The event is outside of the 10 days of deleting VID1000 and is still available) ``` ### Availability This API is available only for Enterprise plans **upon request**. If you are interested, please [contact our support team](https://fingerprint.com/support/). ### Rate limits and daily quota The rate limits and daily quota for this API **differ** from those for our other API. The maximum number of DELETE requests that can be made in an hour cannot exceed 30 RPH, and the maximum number that can be made in a day cannot exceed 500 RPD. You can request an increase to these limits by contacting [our support team](https://fingerprint.com/support/).
154 :param visitor_id: The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete. (required)
155 :type visitor_id: str
156 :param _request_timeout: timeout setting for this request. If one
157 number provided, it will be total request
158 timeout. It can also be a pair (tuple) of
159 (connection, read) timeouts.
160 :type _request_timeout: int, tuple(int, int), optional
161 :param _request_auth: set to override the auth_settings for an a single
162 request; this effectively ignores the
163 authentication in the spec for a single request.
164 :type _request_auth: dict, optional
165 :param _content_type: force content-type for the request.
166 :type _content_type: str, Optional
167 :param _headers: set to override the headers for a single
168 request; this effectively ignores the headers
169 in the spec for a single request.
170 :type _headers: dict, optional
171 :return: Returns the result object.
172 """ # noqa: E501
174 _param = self._delete_visitor_data_serialize(
175 visitor_id=visitor_id,
176 _request_auth=_request_auth,
177 _content_type=_content_type,
178 _headers=_headers,
179 )
181 _response_types_map: dict[str, Optional[str]] = {
182 '200': None,
183 '400': 'ErrorResponse',
184 '403': 'ErrorResponse',
185 '404': 'ErrorResponse',
186 '429': 'ErrorResponse',
187 }
189 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
190 response_data.read()
191 return self.api_client.response_deserialize(
192 response_data=response_data,
193 response_types_map=_response_types_map,
194 )
196 @validate_call
197 def delete_visitor_data_without_preload_content(
198 self,
199 visitor_id: Annotated[
200 StrictStr,
201 Field(
202 description='The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete.'
203 ),
204 ],
205 _request_timeout: Union[
206 None,
207 Annotated[StrictFloat, Field(gt=0)],
208 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
209 ] = None,
210 _request_auth: Optional[dict[StrictStr, Any]] = None,
211 _content_type: Optional[StrictStr] = None,
212 _headers: Optional[dict[StrictStr, Any]] = None,
213 ) -> RESTResponseType:
214 """Delete a visitor ID
216 Use this API to request the deletion of all data associated with a specific visitor ID. Upon a request to delete data for a visitor ID, - The data collected from the corresponding browser (or device) will be deleted asynchronously, typically within a few minutes. This data will no longer be available to identify this browser (or device). When the same browser (or device) revisits, it will receive a new visitor ID. - The identification events made from this browser (or device) in the past 10 days are typically deleted within 24 hrs. - The identification events made from this browser (or device) outside of the 10 days will be purged as per your [data retention period](https://docs.fingerprint.com/docs/regions#data-retention). The following timeline illustrates which events are deleted and which remain after a DELETE API request: ``` Day 1: First visit from browser A. (Assigned visitor ID: VID1000) Day 2: Browser A revisits. (Assigned the same visitor ID: VID1000) Day 13: Browser A revisits. (Assigned the same visitor ID: VID1000) Day 14: Delete VID1000 Day 15: Browser A re-visits. (Assigned a different visitor ID: VID9999) Day 15: GET /events/day-13 (Returns 404. The event is within the 10 days of deleting VID1000 and will have been deleted) Day 16: GET /events/day-2 (Returns 200. The event is outside of the 10 days of deleting VID1000 and is still available) ``` ### Availability This API is available only for Enterprise plans **upon request**. If you are interested, please [contact our support team](https://fingerprint.com/support/). ### Rate limits and daily quota The rate limits and daily quota for this API **differ** from those for our other API. The maximum number of DELETE requests that can be made in an hour cannot exceed 30 RPH, and the maximum number that can be made in a day cannot exceed 500 RPD. You can request an increase to these limits by contacting [our support team](https://fingerprint.com/support/).
218 :param visitor_id: The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete. (required)
219 :type visitor_id: str
220 :param _request_timeout: timeout setting for this request. If one
221 number provided, it will be total request
222 timeout. It can also be a pair (tuple) of
223 (connection, read) timeouts.
224 :type _request_timeout: int, tuple(int, int), optional
225 :param _request_auth: set to override the auth_settings for an a single
226 request; this effectively ignores the
227 authentication in the spec for a single request.
228 :type _request_auth: dict, optional
229 :param _content_type: force content-type for the request.
230 :type _content_type: str, Optional
231 :param _headers: set to override the headers for a single
232 request; this effectively ignores the headers
233 in the spec for a single request.
234 :type _headers: dict, optional
235 :return: Returns the result object.
236 """ # noqa: E501
238 _param = self._delete_visitor_data_serialize(
239 visitor_id=visitor_id,
240 _request_auth=_request_auth,
241 _content_type=_content_type,
242 _headers=_headers,
243 )
245 _response_types_map: dict[str, Optional[str]] = {
246 '200': None,
247 '400': 'ErrorResponse',
248 '403': 'ErrorResponse',
249 '404': 'ErrorResponse',
250 '429': 'ErrorResponse',
251 }
253 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
254 return response_data.response
256 def _delete_visitor_data_serialize(
257 self,
258 visitor_id: str,
259 _request_auth: Optional[dict[StrictStr, Any]],
260 _content_type: Optional[StrictStr],
261 _headers: Optional[dict[StrictStr, Any]],
262 ) -> RequestSerialized:
264 _collection_formats: dict[str, str] = {}
266 _path_params: dict[str, str] = {}
267 _query_params: list[tuple[str, ParamValue]] = []
268 _header_params: dict[str, Optional[str]] = _headers or {}
269 _form_params: list[tuple[str, ParamValue]] = []
270 _files: dict[
271 str,
272 Union[str, bytes, list[str], list[bytes], tuple[str, bytes], list[tuple[str, bytes]]],
273 ] = {}
274 _body_params: Optional[Any] = None
276 # process the path parameters
277 if visitor_id is not None:
278 _path_params['visitor_id'] = visitor_id
280 # set the HTTP header `Accept`
281 if 'Accept' not in _header_params:
282 _header_params['Accept'] = self.api_client.select_header_accept(['application/json'])
284 # authentication setting
285 _auth_settings: list[str] = ['bearerAuth']
287 return self.api_client.param_serialize(
288 method='DELETE',
289 resource_path='/visitors/{visitor_id}',
290 path_params=_path_params,
291 query_params=_query_params,
292 header_params=_header_params,
293 body=_body_params,
294 post_params=_form_params,
295 files=_files,
296 auth_settings=_auth_settings,
297 collection_formats=_collection_formats,
298 _request_auth=_request_auth,
299 )
301 @validate_call
302 def get_event(
303 self,
304 event_id: Annotated[
305 StrictStr,
306 Field(
307 description='The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place).'
308 ),
309 ],
310 ruleset_id: Annotated[
311 Optional[StrictStr],
312 Field(
313 description='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. '
314 ),
315 ] = None,
316 _request_timeout: Union[
317 None,
318 Annotated[StrictFloat, Field(gt=0)],
319 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
320 ] = None,
321 _request_auth: Optional[dict[StrictStr, Any]] = None,
322 _content_type: Optional[StrictStr] = None,
323 _headers: Optional[dict[StrictStr, Any]] = None,
324 ) -> Event:
325 """Get an event by event ID
327 Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`.
329 :param event_id: The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place). (required)
330 :type event_id: str
331 :param ruleset_id: 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.
332 :type ruleset_id: str
333 :param _request_timeout: timeout setting for this request. If one
334 number provided, it will be total request
335 timeout. It can also be a pair (tuple) of
336 (connection, read) timeouts.
337 :type _request_timeout: int, tuple(int, int), optional
338 :param _request_auth: set to override the auth_settings for an a single
339 request; this effectively ignores the
340 authentication in the spec for a single request.
341 :type _request_auth: dict, optional
342 :param _content_type: force content-type for the request.
343 :type _content_type: str, Optional
344 :param _headers: set to override the headers for a single
345 request; this effectively ignores the headers
346 in the spec for a single request.
347 :type _headers: dict, optional
348 :return: Returns the result object.
349 """ # noqa: E501
351 _param = self._get_event_serialize(
352 event_id=event_id,
353 ruleset_id=ruleset_id,
354 _request_auth=_request_auth,
355 _content_type=_content_type,
356 _headers=_headers,
357 )
359 _response_types_map: dict[str, Optional[str]] = {
360 '200': 'Event',
361 '400': 'ErrorResponse',
362 '403': 'ErrorResponse',
363 '404': 'ErrorResponse',
364 '429': 'ErrorResponse',
365 '500': 'ErrorResponse',
366 '503': 'ErrorResponse',
367 '504': 'ErrorResponse',
368 }
370 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
371 response_data.read()
372 return self.api_client.response_deserialize(
373 response_data=response_data,
374 response_types_map=_response_types_map,
375 ).data
377 @validate_call
378 def get_event_with_http_info(
379 self,
380 event_id: Annotated[
381 StrictStr,
382 Field(
383 description='The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place).'
384 ),
385 ],
386 ruleset_id: Annotated[
387 Optional[StrictStr],
388 Field(
389 description='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. '
390 ),
391 ] = None,
392 _request_timeout: Union[
393 None,
394 Annotated[StrictFloat, Field(gt=0)],
395 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
396 ] = None,
397 _request_auth: Optional[dict[StrictStr, Any]] = None,
398 _content_type: Optional[StrictStr] = None,
399 _headers: Optional[dict[StrictStr, Any]] = None,
400 ) -> ApiResponse[Event]:
401 """Get an event by event ID
403 Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`.
405 :param event_id: The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place). (required)
406 :type event_id: str
407 :param ruleset_id: 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.
408 :type ruleset_id: str
409 :param _request_timeout: timeout setting for this request. If one
410 number provided, it will be total request
411 timeout. It can also be a pair (tuple) of
412 (connection, read) timeouts.
413 :type _request_timeout: int, tuple(int, int), optional
414 :param _request_auth: set to override the auth_settings for an a single
415 request; this effectively ignores the
416 authentication in the spec for a single request.
417 :type _request_auth: dict, optional
418 :param _content_type: force content-type for the request.
419 :type _content_type: str, Optional
420 :param _headers: set to override the headers for a single
421 request; this effectively ignores the headers
422 in the spec for a single request.
423 :type _headers: dict, optional
424 :return: Returns the result object.
425 """ # noqa: E501
427 _param = self._get_event_serialize(
428 event_id=event_id,
429 ruleset_id=ruleset_id,
430 _request_auth=_request_auth,
431 _content_type=_content_type,
432 _headers=_headers,
433 )
435 _response_types_map: dict[str, Optional[str]] = {
436 '200': 'Event',
437 '400': 'ErrorResponse',
438 '403': 'ErrorResponse',
439 '404': 'ErrorResponse',
440 '429': 'ErrorResponse',
441 '500': 'ErrorResponse',
442 '503': 'ErrorResponse',
443 '504': 'ErrorResponse',
444 }
446 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
447 response_data.read()
448 return self.api_client.response_deserialize(
449 response_data=response_data,
450 response_types_map=_response_types_map,
451 )
453 @validate_call
454 def get_event_without_preload_content(
455 self,
456 event_id: Annotated[
457 StrictStr,
458 Field(
459 description='The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place).'
460 ),
461 ],
462 ruleset_id: Annotated[
463 Optional[StrictStr],
464 Field(
465 description='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. '
466 ),
467 ] = None,
468 _request_timeout: Union[
469 None,
470 Annotated[StrictFloat, Field(gt=0)],
471 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
472 ] = None,
473 _request_auth: Optional[dict[StrictStr, Any]] = None,
474 _content_type: Optional[StrictStr] = None,
475 _headers: Optional[dict[StrictStr, Any]] = None,
476 ) -> RESTResponseType:
477 """Get an event by event ID
479 Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`.
481 :param event_id: The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place). (required)
482 :type event_id: str
483 :param ruleset_id: 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.
484 :type ruleset_id: str
485 :param _request_timeout: timeout setting for this request. If one
486 number provided, it will be total request
487 timeout. It can also be a pair (tuple) of
488 (connection, read) timeouts.
489 :type _request_timeout: int, tuple(int, int), optional
490 :param _request_auth: set to override the auth_settings for an a single
491 request; this effectively ignores the
492 authentication in the spec for a single request.
493 :type _request_auth: dict, optional
494 :param _content_type: force content-type for the request.
495 :type _content_type: str, Optional
496 :param _headers: set to override the headers for a single
497 request; this effectively ignores the headers
498 in the spec for a single request.
499 :type _headers: dict, optional
500 :return: Returns the result object.
501 """ # noqa: E501
503 _param = self._get_event_serialize(
504 event_id=event_id,
505 ruleset_id=ruleset_id,
506 _request_auth=_request_auth,
507 _content_type=_content_type,
508 _headers=_headers,
509 )
511 _response_types_map: dict[str, Optional[str]] = {
512 '200': 'Event',
513 '400': 'ErrorResponse',
514 '403': 'ErrorResponse',
515 '404': 'ErrorResponse',
516 '429': 'ErrorResponse',
517 '500': 'ErrorResponse',
518 '503': 'ErrorResponse',
519 '504': 'ErrorResponse',
520 }
522 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
523 return response_data.response
525 def _get_event_serialize(
526 self,
527 event_id: str,
528 ruleset_id: Optional[str],
529 _request_auth: Optional[dict[StrictStr, Any]],
530 _content_type: Optional[StrictStr],
531 _headers: Optional[dict[StrictStr, Any]],
532 ) -> RequestSerialized:
534 _collection_formats: dict[str, str] = {}
536 _path_params: dict[str, str] = {}
537 _query_params: list[tuple[str, ParamValue]] = []
538 _header_params: dict[str, Optional[str]] = _headers or {}
539 _form_params: list[tuple[str, ParamValue]] = []
540 _files: dict[
541 str,
542 Union[str, bytes, list[str], list[bytes], tuple[str, bytes], list[tuple[str, bytes]]],
543 ] = {}
544 _body_params: Optional[Any] = None
546 # process the path parameters
547 if event_id is not None:
548 _path_params['event_id'] = event_id
550 # process the query parameters
551 if ruleset_id is not None:
552 _query_params.append(('ruleset_id', ruleset_id))
554 # set the HTTP header `Accept`
555 if 'Accept' not in _header_params:
556 _header_params['Accept'] = self.api_client.select_header_accept(['application/json'])
558 # authentication setting
559 _auth_settings: list[str] = ['bearerAuth']
561 return self.api_client.param_serialize(
562 method='GET',
563 resource_path='/events/{event_id}',
564 path_params=_path_params,
565 query_params=_query_params,
566 header_params=_header_params,
567 body=_body_params,
568 post_params=_form_params,
569 files=_files,
570 auth_settings=_auth_settings,
571 collection_formats=_collection_formats,
572 _request_auth=_request_auth,
573 )
575 @validate_call
576 def search_events(
577 self,
578 limit: Annotated[
579 Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
580 Field(
581 description='Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events. '
582 ),
583 ] = None,
584 pagination_key: Annotated[
585 Optional[StrictStr],
586 Field(
587 description='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 100 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=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q` '
588 ),
589 ] = None,
590 visitor_id: Annotated[
591 Optional[StrictStr],
592 Field(
593 description='Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). '
594 ),
595 ] = None,
596 high_recall_id: Annotated[
597 Optional[StrictStr],
598 Field(
599 description='The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property). '
600 ),
601 ] = None,
602 bot: Annotated[
603 Optional[SearchEventsBot],
604 Field(
605 description='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. '
606 ),
607 ] = None,
608 bot_info: Annotated[
609 Optional[SearchEventsBotInfo],
610 Field(
611 description='Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present. '
612 ),
613 ] = None,
614 bot_info_category: Annotated[
615 Optional[list[BotInfoCategory]],
616 Field(
617 description='Filter events by their Bot Info Category. Multiple categories can be provided using the repeated keys syntax. For example, `bot_info_category=ai_agent&bot_info_category=ai_assistant`, will match events with a Bot Info Category of `ai_agent` or `ai_assistant`. Other notations like comma-separated or bracket notation are not supported. '
618 ),
619 ] = None,
620 bot_info_identity: Annotated[
621 Optional[list[BotInfoIdentity]],
622 Field(
623 description='Filter events by their Bot Info Identity type. Multiple identity types can be provided using the repeated keys syntax. For example, `bot_info_identity=verified&bot_info_identity=signed`, will match events with a Bot Info Identity of `verified` or `signed`. Other notations like comma-separated or bracket notation are not supported. '
624 ),
625 ] = None,
626 bot_info_confidence: Annotated[
627 Optional[list[BotInfoConfidence]],
628 Field(
629 description='Filter events by their Bot Info Confidence. Multiple confidences can be provided using the repeated keys syntax. For example, `bot_info_confidence=high&bot_info_confidence=medium`, will match events with a Bot Info Confidence of `high` or `medium`. Other notations like comma-separated or bracket notation are not supported. '
630 ),
631 ] = None,
632 bot_info_provider: Annotated[
633 Optional[list[StrictStr]],
634 Field(
635 description='Filter events by their Bot Info Provider. The provider must match exactly, partial or wildcard matching is not supported. Multiple Providers can be provided using the repeated keys syntax. For example, `bot_info_provider=OpenAI&bot_info_provider=AWS`, will match events with a Bot Info Provider of `OpenAI` or `AWS`. Other notations like comma-separated or bracket notation are not supported. '
636 ),
637 ] = None,
638 bot_info_name: Annotated[
639 Optional[list[StrictStr]],
640 Field(
641 description='Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported. '
642 ),
643 ] = None,
644 ip_address: Annotated[
645 Optional[StrictStr],
646 Field(
647 description='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 '
648 ),
649 ] = None,
650 asn: Annotated[
651 Optional[StrictStr],
652 Field(
653 description="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. "
654 ),
655 ] = None,
656 linked_id: Annotated[
657 Optional[StrictStr],
658 Field(
659 description='Filter events by your custom identifier. You can use [linked IDs](https://docs.fingerprint.com/reference/js-agent-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. '
660 ),
661 ] = None,
662 url: Annotated[
663 Optional[StrictStr],
664 Field(
665 description='Filter events by the URL (`url` property) associated with the event. '
666 ),
667 ] = None,
668 bundle_id: Annotated[
669 Optional[StrictStr],
670 Field(description='Filter events by the Bundle ID (iOS) associated with the event. '),
671 ] = None,
672 package_name: Annotated[
673 Optional[StrictStr],
674 Field(
675 description='Filter events by the Package Name (Android) associated with the event. '
676 ),
677 ] = None,
678 origin: Annotated[
679 Optional[StrictStr],
680 Field(
681 description='Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) '
682 ),
683 ] = None,
684 start: Annotated[
685 Optional[SearchEventsStartParameter],
686 Field(
687 description='Include events that happened after the provided `start` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to 7 days ago. Setting `start` does not change the default `end` date of `now` — adjust it separately if needed. ',
688 ),
689 ] = None,
690 end: Annotated[
691 Optional[SearchEventsEndParameter],
692 Field(
693 description='Include events that happened before the provided `end` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to now. Setting `end` does not change the default `start` date of `7 days ago` — adjust it separately if needed. ',
694 ),
695 ] = None,
696 reverse: Annotated[
697 Optional[StrictBool],
698 Field(
699 description='When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order). '
700 ),
701 ] = None,
702 suspect: Annotated[
703 Optional[StrictBool],
704 Field(
705 description='Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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. '
706 ),
707 ] = None,
708 vpn: Annotated[
709 Optional[StrictBool],
710 Field(
711 description='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. '
712 ),
713 ] = None,
714 virtual_machine: Annotated[
715 Optional[StrictBool],
716 Field(
717 description='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. '
718 ),
719 ] = None,
720 tampering: Annotated[
721 Optional[StrictBool],
722 Field(
723 description='Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. '
724 ),
725 ] = None,
726 anti_detect_browser: Annotated[
727 Optional[StrictBool],
728 Field(
729 description='Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering_details.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. '
730 ),
731 ] = None,
732 incognito: Annotated[
733 Optional[StrictBool],
734 Field(
735 description='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. '
736 ),
737 ] = None,
738 privacy_settings: Annotated[
739 Optional[StrictBool],
740 Field(
741 description='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. '
742 ),
743 ] = None,
744 jailbroken: Annotated[
745 Optional[StrictBool],
746 Field(
747 description='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. '
748 ),
749 ] = None,
750 frida: Annotated[
751 Optional[StrictBool],
752 Field(
753 description='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. '
754 ),
755 ] = None,
756 factory_reset: Annotated[
757 Optional[StrictBool],
758 Field(
759 description='Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset_timestamp` property populated are included. Events without a `factory_reset_timestamp` Smart Signal result are left out of the response. '
760 ),
761 ] = None,
762 cloned_app: Annotated[
763 Optional[StrictBool],
764 Field(
765 description='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. '
766 ),
767 ] = None,
768 emulator: Annotated[
769 Optional[StrictBool],
770 Field(
771 description='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. '
772 ),
773 ] = None,
774 root_apps: Annotated[
775 Optional[StrictBool],
776 Field(
777 description='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. '
778 ),
779 ] = None,
780 vpn_confidence: Annotated[
781 Optional[SearchEventsVpnConfidence],
782 Field(
783 description='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. '
784 ),
785 ] = None,
786 min_suspect_score: Annotated[
787 Optional[Union[StrictFloat, StrictInt]],
788 Field(
789 description='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. '
790 ),
791 ] = None,
792 developer_tools: Annotated[
793 Optional[StrictBool],
794 Field(
795 description='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. '
796 ),
797 ] = None,
798 location_spoofing: Annotated[
799 Optional[StrictBool],
800 Field(
801 description='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. '
802 ),
803 ] = None,
804 mitm_attack: Annotated[
805 Optional[StrictBool],
806 Field(
807 description='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. '
808 ),
809 ] = None,
810 rare_device: Annotated[
811 Optional[StrictBool],
812 Field(
813 description='Filter events by Device Rarity detection result. > Note: When using this parameter, only events with the `rare_device` property set to `true` or `false` are returned. Events without a Device Rarity Smart Signal result are left out of the response. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). '
814 ),
815 ] = None,
816 rare_device_percentile_bucket: Annotated[
817 Optional[SearchEventsRareDevicePercentileBucket],
818 Field(
819 description='Filter events by Device Rarity percentile bucket. `<p95` - device configuration is in the bottom 95% (most common). `p95-p99` - device is in the 95th to 99th percentile. `p99-p99.5` - device is in the 99th to 99.5th percentile. `p99.5-p99.9` - device is in the 99.5th to 99.9th percentile. `p99.9+` - device is in the top 0.1% (rarest). `not_seen` - device configuration has never been observed before. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). '
820 ),
821 ] = None,
822 proxy: Annotated[
823 Optional[StrictBool],
824 Field(
825 description='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. '
826 ),
827 ] = None,
828 sdk_version: Annotated[
829 Optional[StrictStr],
830 Field(
831 description='Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` '
832 ),
833 ] = None,
834 sdk_platform: Annotated[
835 Optional[SearchEventsSdkPlatform],
836 Field(
837 description='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. '
838 ),
839 ] = None,
840 environment: Annotated[
841 Optional[list[StrictStr]],
842 Field(
843 description='Filter for events by providing one or more environment IDs (`environment_id` property). ### Array syntax To provide multiple environment IDs, use the repeated keys syntax (`environment=env1&environment=env2`). Other notations like comma-separated (`environment=env1,env2`) or bracket notation (`environment[]=env1&environment[]=env2`) are not supported. '
844 ),
845 ] = None,
846 proximity_id: Annotated[
847 Optional[StrictStr],
848 Field(
849 description='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. '
850 ),
851 ] = None,
852 total_hits: Annotated[
853 Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
854 Field(
855 description='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. '
856 ),
857 ] = None,
858 tor_node: Annotated[
859 Optional[StrictBool],
860 Field(
861 description='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. '
862 ),
863 ] = None,
864 incremental_identification_status: Annotated[
865 Optional[SearchEventsIncrementalIdentificationStatus],
866 Field(
867 description='Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. '
868 ),
869 ] = None,
870 simulator: Annotated[
871 Optional[StrictBool],
872 Field(
873 description='Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response. '
874 ),
875 ] = None,
876 source: Annotated[
877 Optional[Annotated[list[SearchEventsSource], Field(max_length=1)]],
878 Field(
879 description='Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. '
880 ),
881 ] = None,
882 active_call: Annotated[
883 Optional[StrictBool],
884 Field(
885 description='Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response. '
886 ),
887 ] = None,
888 compromised_device_integrity: Annotated[
889 Optional[StrictBool],
890 Field(
891 description='Filter events by Compromised Device Integrity result on Android devices. > Note: When using this parameter, only events with the `compromised_device_integrity` property set to `true` or `false` are returned. Events without a `compromised_device_integrity` Smart Signal result are left out of the response. '
892 ),
893 ] = None,
894 _request_timeout: Union[
895 None,
896 Annotated[StrictFloat, Field(gt=0)],
897 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
898 ] = None,
899 _request_auth: Optional[dict[StrictStr, Any]] = None,
900 _content_type: Optional[StrictStr] = None,
901 _headers: Optional[dict[StrictStr, Any]] = None,
902 ) -> EventSearch:
903 """Search events
905 ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) By default, the API searches events from the last 7 days, sorts them by newest first and returns the last 10 events. - Use `start` and `end` to specify the time range of the search. - Use `reverse=true` to sort the results oldest first. - Use `limit` to specify the number of events to return. - Use `pagination_key` to get the next page of results if there are more than `limit` events. ### Filtering events with the `suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response.
907 :param limit: Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events.
908 :type limit: int
909 :param pagination_key: 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 100 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=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q`
910 :type pagination_key: str
911 :param visitor_id: Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property).
912 :type visitor_id: str
913 :param high_recall_id: The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property).
914 :type high_recall_id: str
915 :param bot: 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.
916 :type bot: SearchEventsBot
917 :param bot_info: Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present.
918 :type bot_info: SearchEventsBotInfo
919 :param bot_info_category: Filter events by their Bot Info Category. Multiple categories can be provided using the repeated keys syntax. For example, `bot_info_category=ai_agent&bot_info_category=ai_assistant`, will match events with a Bot Info Category of `ai_agent` or `ai_assistant`. Other notations like comma-separated or bracket notation are not supported.
920 :type bot_info_category: List[BotInfoCategory]
921 :param bot_info_identity: Filter events by their Bot Info Identity type. Multiple identity types can be provided using the repeated keys syntax. For example, `bot_info_identity=verified&bot_info_identity=signed`, will match events with a Bot Info Identity of `verified` or `signed`. Other notations like comma-separated or bracket notation are not supported.
922 :type bot_info_identity: List[BotInfoIdentity]
923 :param bot_info_confidence: Filter events by their Bot Info Confidence. Multiple confidences can be provided using the repeated keys syntax. For example, `bot_info_confidence=high&bot_info_confidence=medium`, will match events with a Bot Info Confidence of `high` or `medium`. Other notations like comma-separated or bracket notation are not supported.
924 :type bot_info_confidence: List[BotInfoConfidence]
925 :param bot_info_provider: Filter events by their Bot Info Provider. The provider must match exactly, partial or wildcard matching is not supported. Multiple Providers can be provided using the repeated keys syntax. For example, `bot_info_provider=OpenAI&bot_info_provider=AWS`, will match events with a Bot Info Provider of `OpenAI` or `AWS`. Other notations like comma-separated or bracket notation are not supported.
926 :type bot_info_provider: List[str]
927 :param bot_info_name: Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported.
928 :type bot_info_name: List[str]
929 :param ip_address: 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
930 :type ip_address: str
931 :param asn: 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.
932 :type asn: str
933 :param linked_id: Filter events by your custom identifier. You can use [linked IDs](https://docs.fingerprint.com/reference/js-agent-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.
934 :type linked_id: str
935 :param url: Filter events by the URL (`url` property) associated with the event.
936 :type url: str
937 :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event.
938 :type bundle_id: str
939 :param package_name: Filter events by the Package Name (Android) associated with the event.
940 :type package_name: str
941 :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com)
942 :type origin: str
943 :param start: Include events that happened after the provided `start` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to 7 days ago. Setting `start` does not change the default `end` date of `now` — adjust it separately if needed.
944 :type start: SearchEventsStartParameter
945 :param end: Include events that happened before the provided `end` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to now. Setting `end` does not change the default `start` date of `7 days ago` — adjust it separately if needed.
946 :type end: SearchEventsEndParameter
947 :param reverse: When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order).
948 :type reverse: bool
949 :param suspect: Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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.
950 :type suspect: bool
951 :param vpn: 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.
952 :type vpn: bool
953 :param virtual_machine: 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.
954 :type virtual_machine: bool
955 :param tampering: Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response.
956 :type tampering: bool
957 :param anti_detect_browser: Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering_details.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response.
958 :type anti_detect_browser: bool
959 :param incognito: 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.
960 :type incognito: bool
961 :param privacy_settings: 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.
962 :type privacy_settings: bool
963 :param jailbroken: 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.
964 :type jailbroken: bool
965 :param frida: 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.
966 :type frida: bool
967 :param factory_reset: Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset_timestamp` property populated are included. Events without a `factory_reset_timestamp` Smart Signal result are left out of the response.
968 :type factory_reset: bool
969 :param cloned_app: 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.
970 :type cloned_app: bool
971 :param emulator: 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.
972 :type emulator: bool
973 :param root_apps: 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.
974 :type root_apps: bool
975 :param vpn_confidence: 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.
976 :type vpn_confidence: SearchEventsVpnConfidence
977 :param min_suspect_score: 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.
978 :type min_suspect_score: float
979 :param developer_tools: 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.
980 :type developer_tools: bool
981 :param location_spoofing: 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.
982 :type location_spoofing: bool
983 :param mitm_attack: 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.
984 :type mitm_attack: bool
985 :param rare_device: Filter events by Device Rarity detection result. > Note: When using this parameter, only events with the `rare_device` property set to `true` or `false` are returned. Events without a Device Rarity Smart Signal result are left out of the response. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/).
986 :type rare_device: bool
987 :param rare_device_percentile_bucket: Filter events by Device Rarity percentile bucket. `<p95` - device configuration is in the bottom 95% (most common). `p95-p99` - device is in the 95th to 99th percentile. `p99-p99.5` - device is in the 99th to 99.5th percentile. `p99.5-p99.9` - device is in the 99.5th to 99.9th percentile. `p99.9+` - device is in the top 0.1% (rarest). `not_seen` - device configuration has never been observed before. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/).
988 :type rare_device_percentile_bucket: SearchEventsRareDevicePercentileBucket
989 :param proxy: 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.
990 :type proxy: bool
991 :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14`
992 :type sdk_version: str
993 :param sdk_platform: 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.
994 :type sdk_platform: SearchEventsSdkPlatform
995 :param environment: Filter for events by providing one or more environment IDs (`environment_id` property). ### Array syntax To provide multiple environment IDs, use the repeated keys syntax (`environment=env1&environment=env2`). Other notations like comma-separated (`environment=env1,env2`) or bracket notation (`environment[]=env1&environment[]=env2`) are not supported.
996 :type environment: List[str]
997 :param proximity_id: 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.
998 :type proximity_id: str
999 :param total_hits: 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.
1000 :type total_hits: int
1001 :param tor_node: 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.
1002 :type tor_node: bool
1003 :param incremental_identification_status: Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response.
1004 :type incremental_identification_status: SearchEventsIncrementalIdentificationStatus
1005 :param simulator: Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response.
1006 :type simulator: bool
1007 :param source: Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team.
1008 :type source: List[SearchEventsSource]
1009 :param active_call: Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response.
1010 :type active_call: bool
1011 :param compromised_device_integrity: Filter events by Compromised Device Integrity result on Android devices. > Note: When using this parameter, only events with the `compromised_device_integrity` property set to `true` or `false` are returned. Events without a `compromised_device_integrity` Smart Signal result are left out of the response.
1012 :type compromised_device_integrity: bool
1013 :param _request_timeout: timeout setting for this request. If one
1014 number provided, it will be total request
1015 timeout. It can also be a pair (tuple) of
1016 (connection, read) timeouts.
1017 :type _request_timeout: int, tuple(int, int), optional
1018 :param _request_auth: set to override the auth_settings for an a single
1019 request; this effectively ignores the
1020 authentication in the spec for a single request.
1021 :type _request_auth: dict, optional
1022 :param _content_type: force content-type for the request.
1023 :type _content_type: str, Optional
1024 :param _headers: set to override the headers for a single
1025 request; this effectively ignores the headers
1026 in the spec for a single request.
1027 :type _headers: dict, optional
1028 :return: Returns the result object.
1029 """ # noqa: E501
1031 _param = self._search_events_serialize(
1032 limit=limit,
1033 pagination_key=pagination_key,
1034 visitor_id=visitor_id,
1035 high_recall_id=high_recall_id,
1036 bot=bot,
1037 bot_info=bot_info,
1038 bot_info_category=bot_info_category,
1039 bot_info_identity=bot_info_identity,
1040 bot_info_confidence=bot_info_confidence,
1041 bot_info_provider=bot_info_provider,
1042 bot_info_name=bot_info_name,
1043 ip_address=ip_address,
1044 asn=asn,
1045 linked_id=linked_id,
1046 url=url,
1047 bundle_id=bundle_id,
1048 package_name=package_name,
1049 origin=origin,
1050 start=start,
1051 end=end,
1052 reverse=reverse,
1053 suspect=suspect,
1054 vpn=vpn,
1055 virtual_machine=virtual_machine,
1056 tampering=tampering,
1057 anti_detect_browser=anti_detect_browser,
1058 incognito=incognito,
1059 privacy_settings=privacy_settings,
1060 jailbroken=jailbroken,
1061 frida=frida,
1062 factory_reset=factory_reset,
1063 cloned_app=cloned_app,
1064 emulator=emulator,
1065 root_apps=root_apps,
1066 vpn_confidence=vpn_confidence,
1067 min_suspect_score=min_suspect_score,
1068 developer_tools=developer_tools,
1069 location_spoofing=location_spoofing,
1070 mitm_attack=mitm_attack,
1071 rare_device=rare_device,
1072 rare_device_percentile_bucket=rare_device_percentile_bucket,
1073 proxy=proxy,
1074 sdk_version=sdk_version,
1075 sdk_platform=sdk_platform,
1076 environment=environment,
1077 proximity_id=proximity_id,
1078 total_hits=total_hits,
1079 tor_node=tor_node,
1080 incremental_identification_status=incremental_identification_status,
1081 simulator=simulator,
1082 source=source,
1083 active_call=active_call,
1084 compromised_device_integrity=compromised_device_integrity,
1085 _request_auth=_request_auth,
1086 _content_type=_content_type,
1087 _headers=_headers,
1088 )
1090 _response_types_map: dict[str, Optional[str]] = {
1091 '200': 'EventSearch',
1092 '400': 'ErrorResponse',
1093 '403': 'ErrorResponse',
1094 '404': 'ErrorResponse',
1095 '429': 'ErrorResponse',
1096 '500': 'ErrorResponse',
1097 '503': 'ErrorResponse',
1098 '504': 'ErrorResponse',
1099 }
1101 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1102 response_data.read()
1103 return self.api_client.response_deserialize(
1104 response_data=response_data,
1105 response_types_map=_response_types_map,
1106 ).data
1108 @validate_call
1109 def search_events_with_http_info(
1110 self,
1111 limit: Annotated[
1112 Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
1113 Field(
1114 description='Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events. '
1115 ),
1116 ] = None,
1117 pagination_key: Annotated[
1118 Optional[StrictStr],
1119 Field(
1120 description='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 100 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=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q` '
1121 ),
1122 ] = None,
1123 visitor_id: Annotated[
1124 Optional[StrictStr],
1125 Field(
1126 description='Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). '
1127 ),
1128 ] = None,
1129 high_recall_id: Annotated[
1130 Optional[StrictStr],
1131 Field(
1132 description='The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property). '
1133 ),
1134 ] = None,
1135 bot: Annotated[
1136 Optional[SearchEventsBot],
1137 Field(
1138 description='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. '
1139 ),
1140 ] = None,
1141 bot_info: Annotated[
1142 Optional[SearchEventsBotInfo],
1143 Field(
1144 description='Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present. '
1145 ),
1146 ] = None,
1147 bot_info_category: Annotated[
1148 Optional[list[BotInfoCategory]],
1149 Field(
1150 description='Filter events by their Bot Info Category. Multiple categories can be provided using the repeated keys syntax. For example, `bot_info_category=ai_agent&bot_info_category=ai_assistant`, will match events with a Bot Info Category of `ai_agent` or `ai_assistant`. Other notations like comma-separated or bracket notation are not supported. '
1151 ),
1152 ] = None,
1153 bot_info_identity: Annotated[
1154 Optional[list[BotInfoIdentity]],
1155 Field(
1156 description='Filter events by their Bot Info Identity type. Multiple identity types can be provided using the repeated keys syntax. For example, `bot_info_identity=verified&bot_info_identity=signed`, will match events with a Bot Info Identity of `verified` or `signed`. Other notations like comma-separated or bracket notation are not supported. '
1157 ),
1158 ] = None,
1159 bot_info_confidence: Annotated[
1160 Optional[list[BotInfoConfidence]],
1161 Field(
1162 description='Filter events by their Bot Info Confidence. Multiple confidences can be provided using the repeated keys syntax. For example, `bot_info_confidence=high&bot_info_confidence=medium`, will match events with a Bot Info Confidence of `high` or `medium`. Other notations like comma-separated or bracket notation are not supported. '
1163 ),
1164 ] = None,
1165 bot_info_provider: Annotated[
1166 Optional[list[StrictStr]],
1167 Field(
1168 description='Filter events by their Bot Info Provider. The provider must match exactly, partial or wildcard matching is not supported. Multiple Providers can be provided using the repeated keys syntax. For example, `bot_info_provider=OpenAI&bot_info_provider=AWS`, will match events with a Bot Info Provider of `OpenAI` or `AWS`. Other notations like comma-separated or bracket notation are not supported. '
1169 ),
1170 ] = None,
1171 bot_info_name: Annotated[
1172 Optional[list[StrictStr]],
1173 Field(
1174 description='Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported. '
1175 ),
1176 ] = None,
1177 ip_address: Annotated[
1178 Optional[StrictStr],
1179 Field(
1180 description='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 '
1181 ),
1182 ] = None,
1183 asn: Annotated[
1184 Optional[StrictStr],
1185 Field(
1186 description="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. "
1187 ),
1188 ] = None,
1189 linked_id: Annotated[
1190 Optional[StrictStr],
1191 Field(
1192 description='Filter events by your custom identifier. You can use [linked IDs](https://docs.fingerprint.com/reference/js-agent-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. '
1193 ),
1194 ] = None,
1195 url: Annotated[
1196 Optional[StrictStr],
1197 Field(
1198 description='Filter events by the URL (`url` property) associated with the event. '
1199 ),
1200 ] = None,
1201 bundle_id: Annotated[
1202 Optional[StrictStr],
1203 Field(description='Filter events by the Bundle ID (iOS) associated with the event. '),
1204 ] = None,
1205 package_name: Annotated[
1206 Optional[StrictStr],
1207 Field(
1208 description='Filter events by the Package Name (Android) associated with the event. '
1209 ),
1210 ] = None,
1211 origin: Annotated[
1212 Optional[StrictStr],
1213 Field(
1214 description='Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) '
1215 ),
1216 ] = None,
1217 start: Annotated[
1218 Optional[SearchEventsStartParameter],
1219 Field(
1220 description='Include events that happened after the provided `start` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to 7 days ago. Setting `start` does not change the default `end` date of `now` — adjust it separately if needed. ',
1221 ),
1222 ] = None,
1223 end: Annotated[
1224 Optional[SearchEventsEndParameter],
1225 Field(
1226 description='Include events that happened before the provided `end` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to now. Setting `end` does not change the default `start` date of `7 days ago` — adjust it separately if needed. ',
1227 ),
1228 ] = None,
1229 reverse: Annotated[
1230 Optional[StrictBool],
1231 Field(
1232 description='When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order). '
1233 ),
1234 ] = None,
1235 suspect: Annotated[
1236 Optional[StrictBool],
1237 Field(
1238 description='Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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. '
1239 ),
1240 ] = None,
1241 vpn: Annotated[
1242 Optional[StrictBool],
1243 Field(
1244 description='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. '
1245 ),
1246 ] = None,
1247 virtual_machine: Annotated[
1248 Optional[StrictBool],
1249 Field(
1250 description='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. '
1251 ),
1252 ] = None,
1253 tampering: Annotated[
1254 Optional[StrictBool],
1255 Field(
1256 description='Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. '
1257 ),
1258 ] = None,
1259 anti_detect_browser: Annotated[
1260 Optional[StrictBool],
1261 Field(
1262 description='Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering_details.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. '
1263 ),
1264 ] = None,
1265 incognito: Annotated[
1266 Optional[StrictBool],
1267 Field(
1268 description='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. '
1269 ),
1270 ] = None,
1271 privacy_settings: Annotated[
1272 Optional[StrictBool],
1273 Field(
1274 description='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. '
1275 ),
1276 ] = None,
1277 jailbroken: Annotated[
1278 Optional[StrictBool],
1279 Field(
1280 description='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. '
1281 ),
1282 ] = None,
1283 frida: Annotated[
1284 Optional[StrictBool],
1285 Field(
1286 description='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. '
1287 ),
1288 ] = None,
1289 factory_reset: Annotated[
1290 Optional[StrictBool],
1291 Field(
1292 description='Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset_timestamp` property populated are included. Events without a `factory_reset_timestamp` Smart Signal result are left out of the response. '
1293 ),
1294 ] = None,
1295 cloned_app: Annotated[
1296 Optional[StrictBool],
1297 Field(
1298 description='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. '
1299 ),
1300 ] = None,
1301 emulator: Annotated[
1302 Optional[StrictBool],
1303 Field(
1304 description='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. '
1305 ),
1306 ] = None,
1307 root_apps: Annotated[
1308 Optional[StrictBool],
1309 Field(
1310 description='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. '
1311 ),
1312 ] = None,
1313 vpn_confidence: Annotated[
1314 Optional[SearchEventsVpnConfidence],
1315 Field(
1316 description='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. '
1317 ),
1318 ] = None,
1319 min_suspect_score: Annotated[
1320 Optional[Union[StrictFloat, StrictInt]],
1321 Field(
1322 description='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. '
1323 ),
1324 ] = None,
1325 developer_tools: Annotated[
1326 Optional[StrictBool],
1327 Field(
1328 description='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. '
1329 ),
1330 ] = None,
1331 location_spoofing: Annotated[
1332 Optional[StrictBool],
1333 Field(
1334 description='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. '
1335 ),
1336 ] = None,
1337 mitm_attack: Annotated[
1338 Optional[StrictBool],
1339 Field(
1340 description='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. '
1341 ),
1342 ] = None,
1343 rare_device: Annotated[
1344 Optional[StrictBool],
1345 Field(
1346 description='Filter events by Device Rarity detection result. > Note: When using this parameter, only events with the `rare_device` property set to `true` or `false` are returned. Events without a Device Rarity Smart Signal result are left out of the response. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). '
1347 ),
1348 ] = None,
1349 rare_device_percentile_bucket: Annotated[
1350 Optional[SearchEventsRareDevicePercentileBucket],
1351 Field(
1352 description='Filter events by Device Rarity percentile bucket. `<p95` - device configuration is in the bottom 95% (most common). `p95-p99` - device is in the 95th to 99th percentile. `p99-p99.5` - device is in the 99th to 99.5th percentile. `p99.5-p99.9` - device is in the 99.5th to 99.9th percentile. `p99.9+` - device is in the top 0.1% (rarest). `not_seen` - device configuration has never been observed before. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). '
1353 ),
1354 ] = None,
1355 proxy: Annotated[
1356 Optional[StrictBool],
1357 Field(
1358 description='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. '
1359 ),
1360 ] = None,
1361 sdk_version: Annotated[
1362 Optional[StrictStr],
1363 Field(
1364 description='Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` '
1365 ),
1366 ] = None,
1367 sdk_platform: Annotated[
1368 Optional[SearchEventsSdkPlatform],
1369 Field(
1370 description='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. '
1371 ),
1372 ] = None,
1373 environment: Annotated[
1374 Optional[list[StrictStr]],
1375 Field(
1376 description='Filter for events by providing one or more environment IDs (`environment_id` property). ### Array syntax To provide multiple environment IDs, use the repeated keys syntax (`environment=env1&environment=env2`). Other notations like comma-separated (`environment=env1,env2`) or bracket notation (`environment[]=env1&environment[]=env2`) are not supported. '
1377 ),
1378 ] = None,
1379 proximity_id: Annotated[
1380 Optional[StrictStr],
1381 Field(
1382 description='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. '
1383 ),
1384 ] = None,
1385 total_hits: Annotated[
1386 Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
1387 Field(
1388 description='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. '
1389 ),
1390 ] = None,
1391 tor_node: Annotated[
1392 Optional[StrictBool],
1393 Field(
1394 description='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. '
1395 ),
1396 ] = None,
1397 incremental_identification_status: Annotated[
1398 Optional[SearchEventsIncrementalIdentificationStatus],
1399 Field(
1400 description='Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. '
1401 ),
1402 ] = None,
1403 simulator: Annotated[
1404 Optional[StrictBool],
1405 Field(
1406 description='Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response. '
1407 ),
1408 ] = None,
1409 source: Annotated[
1410 Optional[Annotated[list[SearchEventsSource], Field(max_length=1)]],
1411 Field(
1412 description='Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. '
1413 ),
1414 ] = None,
1415 active_call: Annotated[
1416 Optional[StrictBool],
1417 Field(
1418 description='Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response. '
1419 ),
1420 ] = None,
1421 compromised_device_integrity: Annotated[
1422 Optional[StrictBool],
1423 Field(
1424 description='Filter events by Compromised Device Integrity result on Android devices. > Note: When using this parameter, only events with the `compromised_device_integrity` property set to `true` or `false` are returned. Events without a `compromised_device_integrity` Smart Signal result are left out of the response. '
1425 ),
1426 ] = None,
1427 _request_timeout: Union[
1428 None,
1429 Annotated[StrictFloat, Field(gt=0)],
1430 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1431 ] = None,
1432 _request_auth: Optional[dict[StrictStr, Any]] = None,
1433 _content_type: Optional[StrictStr] = None,
1434 _headers: Optional[dict[StrictStr, Any]] = None,
1435 ) -> ApiResponse[EventSearch]:
1436 """Search events
1438 ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) By default, the API searches events from the last 7 days, sorts them by newest first and returns the last 10 events. - Use `start` and `end` to specify the time range of the search. - Use `reverse=true` to sort the results oldest first. - Use `limit` to specify the number of events to return. - Use `pagination_key` to get the next page of results if there are more than `limit` events. ### Filtering events with the `suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response.
1440 :param limit: Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events.
1441 :type limit: int
1442 :param pagination_key: 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 100 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=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q`
1443 :type pagination_key: str
1444 :param visitor_id: Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property).
1445 :type visitor_id: str
1446 :param high_recall_id: The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property).
1447 :type high_recall_id: str
1448 :param bot: 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.
1449 :type bot: SearchEventsBot
1450 :param bot_info: Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present.
1451 :type bot_info: SearchEventsBotInfo
1452 :param bot_info_category: Filter events by their Bot Info Category. Multiple categories can be provided using the repeated keys syntax. For example, `bot_info_category=ai_agent&bot_info_category=ai_assistant`, will match events with a Bot Info Category of `ai_agent` or `ai_assistant`. Other notations like comma-separated or bracket notation are not supported.
1453 :type bot_info_category: List[BotInfoCategory]
1454 :param bot_info_identity: Filter events by their Bot Info Identity type. Multiple identity types can be provided using the repeated keys syntax. For example, `bot_info_identity=verified&bot_info_identity=signed`, will match events with a Bot Info Identity of `verified` or `signed`. Other notations like comma-separated or bracket notation are not supported.
1455 :type bot_info_identity: List[BotInfoIdentity]
1456 :param bot_info_confidence: Filter events by their Bot Info Confidence. Multiple confidences can be provided using the repeated keys syntax. For example, `bot_info_confidence=high&bot_info_confidence=medium`, will match events with a Bot Info Confidence of `high` or `medium`. Other notations like comma-separated or bracket notation are not supported.
1457 :type bot_info_confidence: List[BotInfoConfidence]
1458 :param bot_info_provider: Filter events by their Bot Info Provider. The provider must match exactly, partial or wildcard matching is not supported. Multiple Providers can be provided using the repeated keys syntax. For example, `bot_info_provider=OpenAI&bot_info_provider=AWS`, will match events with a Bot Info Provider of `OpenAI` or `AWS`. Other notations like comma-separated or bracket notation are not supported.
1459 :type bot_info_provider: List[str]
1460 :param bot_info_name: Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported.
1461 :type bot_info_name: List[str]
1462 :param ip_address: 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
1463 :type ip_address: str
1464 :param asn: 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.
1465 :type asn: str
1466 :param linked_id: Filter events by your custom identifier. You can use [linked IDs](https://docs.fingerprint.com/reference/js-agent-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.
1467 :type linked_id: str
1468 :param url: Filter events by the URL (`url` property) associated with the event.
1469 :type url: str
1470 :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event.
1471 :type bundle_id: str
1472 :param package_name: Filter events by the Package Name (Android) associated with the event.
1473 :type package_name: str
1474 :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com)
1475 :type origin: str
1476 :param start: Include events that happened after the provided `start` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to 7 days ago. Setting `start` does not change the default `end` date of `now` — adjust it separately if needed.
1477 :type start: SearchEventsStartParameter
1478 :param end: Include events that happened before the provided `end` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to now. Setting `end` does not change the default `start` date of `7 days ago` — adjust it separately if needed.
1479 :type end: SearchEventsEndParameter
1480 :param reverse: When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order).
1481 :type reverse: bool
1482 :param suspect: Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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.
1483 :type suspect: bool
1484 :param vpn: 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.
1485 :type vpn: bool
1486 :param virtual_machine: 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.
1487 :type virtual_machine: bool
1488 :param tampering: Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response.
1489 :type tampering: bool
1490 :param anti_detect_browser: Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering_details.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response.
1491 :type anti_detect_browser: bool
1492 :param incognito: 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.
1493 :type incognito: bool
1494 :param privacy_settings: 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.
1495 :type privacy_settings: bool
1496 :param jailbroken: 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.
1497 :type jailbroken: bool
1498 :param frida: 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.
1499 :type frida: bool
1500 :param factory_reset: Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset_timestamp` property populated are included. Events without a `factory_reset_timestamp` Smart Signal result are left out of the response.
1501 :type factory_reset: bool
1502 :param cloned_app: 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.
1503 :type cloned_app: bool
1504 :param emulator: 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.
1505 :type emulator: bool
1506 :param root_apps: 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.
1507 :type root_apps: bool
1508 :param vpn_confidence: 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.
1509 :type vpn_confidence: SearchEventsVpnConfidence
1510 :param min_suspect_score: 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.
1511 :type min_suspect_score: float
1512 :param developer_tools: 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.
1513 :type developer_tools: bool
1514 :param location_spoofing: 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.
1515 :type location_spoofing: bool
1516 :param mitm_attack: 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.
1517 :type mitm_attack: bool
1518 :param rare_device: Filter events by Device Rarity detection result. > Note: When using this parameter, only events with the `rare_device` property set to `true` or `false` are returned. Events without a Device Rarity Smart Signal result are left out of the response. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/).
1519 :type rare_device: bool
1520 :param rare_device_percentile_bucket: Filter events by Device Rarity percentile bucket. `<p95` - device configuration is in the bottom 95% (most common). `p95-p99` - device is in the 95th to 99th percentile. `p99-p99.5` - device is in the 99th to 99.5th percentile. `p99.5-p99.9` - device is in the 99.5th to 99.9th percentile. `p99.9+` - device is in the top 0.1% (rarest). `not_seen` - device configuration has never been observed before. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/).
1521 :type rare_device_percentile_bucket: SearchEventsRareDevicePercentileBucket
1522 :param proxy: 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.
1523 :type proxy: bool
1524 :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14`
1525 :type sdk_version: str
1526 :param sdk_platform: 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.
1527 :type sdk_platform: SearchEventsSdkPlatform
1528 :param environment: Filter for events by providing one or more environment IDs (`environment_id` property). ### Array syntax To provide multiple environment IDs, use the repeated keys syntax (`environment=env1&environment=env2`). Other notations like comma-separated (`environment=env1,env2`) or bracket notation (`environment[]=env1&environment[]=env2`) are not supported.
1529 :type environment: List[str]
1530 :param proximity_id: 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.
1531 :type proximity_id: str
1532 :param total_hits: 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.
1533 :type total_hits: int
1534 :param tor_node: 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.
1535 :type tor_node: bool
1536 :param incremental_identification_status: Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response.
1537 :type incremental_identification_status: SearchEventsIncrementalIdentificationStatus
1538 :param simulator: Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response.
1539 :type simulator: bool
1540 :param source: Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team.
1541 :type source: List[SearchEventsSource]
1542 :param active_call: Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response.
1543 :type active_call: bool
1544 :param compromised_device_integrity: Filter events by Compromised Device Integrity result on Android devices. > Note: When using this parameter, only events with the `compromised_device_integrity` property set to `true` or `false` are returned. Events without a `compromised_device_integrity` Smart Signal result are left out of the response.
1545 :type compromised_device_integrity: bool
1546 :param _request_timeout: timeout setting for this request. If one
1547 number provided, it will be total request
1548 timeout. It can also be a pair (tuple) of
1549 (connection, read) timeouts.
1550 :type _request_timeout: int, tuple(int, int), optional
1551 :param _request_auth: set to override the auth_settings for an a single
1552 request; this effectively ignores the
1553 authentication in the spec for a single request.
1554 :type _request_auth: dict, optional
1555 :param _content_type: force content-type for the request.
1556 :type _content_type: str, Optional
1557 :param _headers: set to override the headers for a single
1558 request; this effectively ignores the headers
1559 in the spec for a single request.
1560 :type _headers: dict, optional
1561 :return: Returns the result object.
1562 """ # noqa: E501
1564 _param = self._search_events_serialize(
1565 limit=limit,
1566 pagination_key=pagination_key,
1567 visitor_id=visitor_id,
1568 high_recall_id=high_recall_id,
1569 bot=bot,
1570 bot_info=bot_info,
1571 bot_info_category=bot_info_category,
1572 bot_info_identity=bot_info_identity,
1573 bot_info_confidence=bot_info_confidence,
1574 bot_info_provider=bot_info_provider,
1575 bot_info_name=bot_info_name,
1576 ip_address=ip_address,
1577 asn=asn,
1578 linked_id=linked_id,
1579 url=url,
1580 bundle_id=bundle_id,
1581 package_name=package_name,
1582 origin=origin,
1583 start=start,
1584 end=end,
1585 reverse=reverse,
1586 suspect=suspect,
1587 vpn=vpn,
1588 virtual_machine=virtual_machine,
1589 tampering=tampering,
1590 anti_detect_browser=anti_detect_browser,
1591 incognito=incognito,
1592 privacy_settings=privacy_settings,
1593 jailbroken=jailbroken,
1594 frida=frida,
1595 factory_reset=factory_reset,
1596 cloned_app=cloned_app,
1597 emulator=emulator,
1598 root_apps=root_apps,
1599 vpn_confidence=vpn_confidence,
1600 min_suspect_score=min_suspect_score,
1601 developer_tools=developer_tools,
1602 location_spoofing=location_spoofing,
1603 mitm_attack=mitm_attack,
1604 rare_device=rare_device,
1605 rare_device_percentile_bucket=rare_device_percentile_bucket,
1606 proxy=proxy,
1607 sdk_version=sdk_version,
1608 sdk_platform=sdk_platform,
1609 environment=environment,
1610 proximity_id=proximity_id,
1611 total_hits=total_hits,
1612 tor_node=tor_node,
1613 incremental_identification_status=incremental_identification_status,
1614 simulator=simulator,
1615 source=source,
1616 active_call=active_call,
1617 compromised_device_integrity=compromised_device_integrity,
1618 _request_auth=_request_auth,
1619 _content_type=_content_type,
1620 _headers=_headers,
1621 )
1623 _response_types_map: dict[str, Optional[str]] = {
1624 '200': 'EventSearch',
1625 '400': 'ErrorResponse',
1626 '403': 'ErrorResponse',
1627 '404': 'ErrorResponse',
1628 '429': 'ErrorResponse',
1629 '500': 'ErrorResponse',
1630 '503': 'ErrorResponse',
1631 '504': 'ErrorResponse',
1632 }
1634 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1635 response_data.read()
1636 return self.api_client.response_deserialize(
1637 response_data=response_data,
1638 response_types_map=_response_types_map,
1639 )
1641 @validate_call
1642 def search_events_without_preload_content(
1643 self,
1644 limit: Annotated[
1645 Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
1646 Field(
1647 description='Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events. '
1648 ),
1649 ] = None,
1650 pagination_key: Annotated[
1651 Optional[StrictStr],
1652 Field(
1653 description='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 100 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=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q` '
1654 ),
1655 ] = None,
1656 visitor_id: Annotated[
1657 Optional[StrictStr],
1658 Field(
1659 description='Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). '
1660 ),
1661 ] = None,
1662 high_recall_id: Annotated[
1663 Optional[StrictStr],
1664 Field(
1665 description='The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property). '
1666 ),
1667 ] = None,
1668 bot: Annotated[
1669 Optional[SearchEventsBot],
1670 Field(
1671 description='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. '
1672 ),
1673 ] = None,
1674 bot_info: Annotated[
1675 Optional[SearchEventsBotInfo],
1676 Field(
1677 description='Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present. '
1678 ),
1679 ] = None,
1680 bot_info_category: Annotated[
1681 Optional[list[BotInfoCategory]],
1682 Field(
1683 description='Filter events by their Bot Info Category. Multiple categories can be provided using the repeated keys syntax. For example, `bot_info_category=ai_agent&bot_info_category=ai_assistant`, will match events with a Bot Info Category of `ai_agent` or `ai_assistant`. Other notations like comma-separated or bracket notation are not supported. '
1684 ),
1685 ] = None,
1686 bot_info_identity: Annotated[
1687 Optional[list[BotInfoIdentity]],
1688 Field(
1689 description='Filter events by their Bot Info Identity type. Multiple identity types can be provided using the repeated keys syntax. For example, `bot_info_identity=verified&bot_info_identity=signed`, will match events with a Bot Info Identity of `verified` or `signed`. Other notations like comma-separated or bracket notation are not supported. '
1690 ),
1691 ] = None,
1692 bot_info_confidence: Annotated[
1693 Optional[list[BotInfoConfidence]],
1694 Field(
1695 description='Filter events by their Bot Info Confidence. Multiple confidences can be provided using the repeated keys syntax. For example, `bot_info_confidence=high&bot_info_confidence=medium`, will match events with a Bot Info Confidence of `high` or `medium`. Other notations like comma-separated or bracket notation are not supported. '
1696 ),
1697 ] = None,
1698 bot_info_provider: Annotated[
1699 Optional[list[StrictStr]],
1700 Field(
1701 description='Filter events by their Bot Info Provider. The provider must match exactly, partial or wildcard matching is not supported. Multiple Providers can be provided using the repeated keys syntax. For example, `bot_info_provider=OpenAI&bot_info_provider=AWS`, will match events with a Bot Info Provider of `OpenAI` or `AWS`. Other notations like comma-separated or bracket notation are not supported. '
1702 ),
1703 ] = None,
1704 bot_info_name: Annotated[
1705 Optional[list[StrictStr]],
1706 Field(
1707 description='Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported. '
1708 ),
1709 ] = None,
1710 ip_address: Annotated[
1711 Optional[StrictStr],
1712 Field(
1713 description='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 '
1714 ),
1715 ] = None,
1716 asn: Annotated[
1717 Optional[StrictStr],
1718 Field(
1719 description="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. "
1720 ),
1721 ] = None,
1722 linked_id: Annotated[
1723 Optional[StrictStr],
1724 Field(
1725 description='Filter events by your custom identifier. You can use [linked IDs](https://docs.fingerprint.com/reference/js-agent-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. '
1726 ),
1727 ] = None,
1728 url: Annotated[
1729 Optional[StrictStr],
1730 Field(
1731 description='Filter events by the URL (`url` property) associated with the event. '
1732 ),
1733 ] = None,
1734 bundle_id: Annotated[
1735 Optional[StrictStr],
1736 Field(description='Filter events by the Bundle ID (iOS) associated with the event. '),
1737 ] = None,
1738 package_name: Annotated[
1739 Optional[StrictStr],
1740 Field(
1741 description='Filter events by the Package Name (Android) associated with the event. '
1742 ),
1743 ] = None,
1744 origin: Annotated[
1745 Optional[StrictStr],
1746 Field(
1747 description='Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) '
1748 ),
1749 ] = None,
1750 start: Annotated[
1751 Optional[SearchEventsStartParameter],
1752 Field(
1753 description='Include events that happened after the provided `start` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to 7 days ago. Setting `start` does not change the default `end` date of `now` — adjust it separately if needed. ',
1754 ),
1755 ] = None,
1756 end: Annotated[
1757 Optional[SearchEventsEndParameter],
1758 Field(
1759 description='Include events that happened before the provided `end` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to now. Setting `end` does not change the default `start` date of `7 days ago` — adjust it separately if needed. ',
1760 ),
1761 ] = None,
1762 reverse: Annotated[
1763 Optional[StrictBool],
1764 Field(
1765 description='When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order). '
1766 ),
1767 ] = None,
1768 suspect: Annotated[
1769 Optional[StrictBool],
1770 Field(
1771 description='Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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. '
1772 ),
1773 ] = None,
1774 vpn: Annotated[
1775 Optional[StrictBool],
1776 Field(
1777 description='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. '
1778 ),
1779 ] = None,
1780 virtual_machine: Annotated[
1781 Optional[StrictBool],
1782 Field(
1783 description='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. '
1784 ),
1785 ] = None,
1786 tampering: Annotated[
1787 Optional[StrictBool],
1788 Field(
1789 description='Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. '
1790 ),
1791 ] = None,
1792 anti_detect_browser: Annotated[
1793 Optional[StrictBool],
1794 Field(
1795 description='Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering_details.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. '
1796 ),
1797 ] = None,
1798 incognito: Annotated[
1799 Optional[StrictBool],
1800 Field(
1801 description='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. '
1802 ),
1803 ] = None,
1804 privacy_settings: Annotated[
1805 Optional[StrictBool],
1806 Field(
1807 description='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. '
1808 ),
1809 ] = None,
1810 jailbroken: Annotated[
1811 Optional[StrictBool],
1812 Field(
1813 description='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. '
1814 ),
1815 ] = None,
1816 frida: Annotated[
1817 Optional[StrictBool],
1818 Field(
1819 description='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. '
1820 ),
1821 ] = None,
1822 factory_reset: Annotated[
1823 Optional[StrictBool],
1824 Field(
1825 description='Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset_timestamp` property populated are included. Events without a `factory_reset_timestamp` Smart Signal result are left out of the response. '
1826 ),
1827 ] = None,
1828 cloned_app: Annotated[
1829 Optional[StrictBool],
1830 Field(
1831 description='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. '
1832 ),
1833 ] = None,
1834 emulator: Annotated[
1835 Optional[StrictBool],
1836 Field(
1837 description='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. '
1838 ),
1839 ] = None,
1840 root_apps: Annotated[
1841 Optional[StrictBool],
1842 Field(
1843 description='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. '
1844 ),
1845 ] = None,
1846 vpn_confidence: Annotated[
1847 Optional[SearchEventsVpnConfidence],
1848 Field(
1849 description='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. '
1850 ),
1851 ] = None,
1852 min_suspect_score: Annotated[
1853 Optional[Union[StrictFloat, StrictInt]],
1854 Field(
1855 description='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. '
1856 ),
1857 ] = None,
1858 developer_tools: Annotated[
1859 Optional[StrictBool],
1860 Field(
1861 description='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. '
1862 ),
1863 ] = None,
1864 location_spoofing: Annotated[
1865 Optional[StrictBool],
1866 Field(
1867 description='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. '
1868 ),
1869 ] = None,
1870 mitm_attack: Annotated[
1871 Optional[StrictBool],
1872 Field(
1873 description='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. '
1874 ),
1875 ] = None,
1876 rare_device: Annotated[
1877 Optional[StrictBool],
1878 Field(
1879 description='Filter events by Device Rarity detection result. > Note: When using this parameter, only events with the `rare_device` property set to `true` or `false` are returned. Events without a Device Rarity Smart Signal result are left out of the response. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). '
1880 ),
1881 ] = None,
1882 rare_device_percentile_bucket: Annotated[
1883 Optional[SearchEventsRareDevicePercentileBucket],
1884 Field(
1885 description='Filter events by Device Rarity percentile bucket. `<p95` - device configuration is in the bottom 95% (most common). `p95-p99` - device is in the 95th to 99th percentile. `p99-p99.5` - device is in the 99th to 99.5th percentile. `p99.5-p99.9` - device is in the 99.5th to 99.9th percentile. `p99.9+` - device is in the top 0.1% (rarest). `not_seen` - device configuration has never been observed before. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). '
1886 ),
1887 ] = None,
1888 proxy: Annotated[
1889 Optional[StrictBool],
1890 Field(
1891 description='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. '
1892 ),
1893 ] = None,
1894 sdk_version: Annotated[
1895 Optional[StrictStr],
1896 Field(
1897 description='Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` '
1898 ),
1899 ] = None,
1900 sdk_platform: Annotated[
1901 Optional[SearchEventsSdkPlatform],
1902 Field(
1903 description='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. '
1904 ),
1905 ] = None,
1906 environment: Annotated[
1907 Optional[list[StrictStr]],
1908 Field(
1909 description='Filter for events by providing one or more environment IDs (`environment_id` property). ### Array syntax To provide multiple environment IDs, use the repeated keys syntax (`environment=env1&environment=env2`). Other notations like comma-separated (`environment=env1,env2`) or bracket notation (`environment[]=env1&environment[]=env2`) are not supported. '
1910 ),
1911 ] = None,
1912 proximity_id: Annotated[
1913 Optional[StrictStr],
1914 Field(
1915 description='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. '
1916 ),
1917 ] = None,
1918 total_hits: Annotated[
1919 Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
1920 Field(
1921 description='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. '
1922 ),
1923 ] = None,
1924 tor_node: Annotated[
1925 Optional[StrictBool],
1926 Field(
1927 description='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. '
1928 ),
1929 ] = None,
1930 incremental_identification_status: Annotated[
1931 Optional[SearchEventsIncrementalIdentificationStatus],
1932 Field(
1933 description='Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. '
1934 ),
1935 ] = None,
1936 simulator: Annotated[
1937 Optional[StrictBool],
1938 Field(
1939 description='Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response. '
1940 ),
1941 ] = None,
1942 source: Annotated[
1943 Optional[Annotated[list[SearchEventsSource], Field(max_length=1)]],
1944 Field(
1945 description='Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. '
1946 ),
1947 ] = None,
1948 active_call: Annotated[
1949 Optional[StrictBool],
1950 Field(
1951 description='Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response. '
1952 ),
1953 ] = None,
1954 compromised_device_integrity: Annotated[
1955 Optional[StrictBool],
1956 Field(
1957 description='Filter events by Compromised Device Integrity result on Android devices. > Note: When using this parameter, only events with the `compromised_device_integrity` property set to `true` or `false` are returned. Events without a `compromised_device_integrity` Smart Signal result are left out of the response. '
1958 ),
1959 ] = None,
1960 _request_timeout: Union[
1961 None,
1962 Annotated[StrictFloat, Field(gt=0)],
1963 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1964 ] = None,
1965 _request_auth: Optional[dict[StrictStr, Any]] = None,
1966 _content_type: Optional[StrictStr] = None,
1967 _headers: Optional[dict[StrictStr, Any]] = None,
1968 ) -> RESTResponseType:
1969 """Search events
1971 ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) By default, the API searches events from the last 7 days, sorts them by newest first and returns the last 10 events. - Use `start` and `end` to specify the time range of the search. - Use `reverse=true` to sort the results oldest first. - Use `limit` to specify the number of events to return. - Use `pagination_key` to get the next page of results if there are more than `limit` events. ### Filtering events with the `suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response.
1973 :param limit: Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events.
1974 :type limit: int
1975 :param pagination_key: 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 100 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=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q`
1976 :type pagination_key: str
1977 :param visitor_id: Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property).
1978 :type visitor_id: str
1979 :param high_recall_id: The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property).
1980 :type high_recall_id: str
1981 :param bot: 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.
1982 :type bot: SearchEventsBot
1983 :param bot_info: Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present.
1984 :type bot_info: SearchEventsBotInfo
1985 :param bot_info_category: Filter events by their Bot Info Category. Multiple categories can be provided using the repeated keys syntax. For example, `bot_info_category=ai_agent&bot_info_category=ai_assistant`, will match events with a Bot Info Category of `ai_agent` or `ai_assistant`. Other notations like comma-separated or bracket notation are not supported.
1986 :type bot_info_category: List[BotInfoCategory]
1987 :param bot_info_identity: Filter events by their Bot Info Identity type. Multiple identity types can be provided using the repeated keys syntax. For example, `bot_info_identity=verified&bot_info_identity=signed`, will match events with a Bot Info Identity of `verified` or `signed`. Other notations like comma-separated or bracket notation are not supported.
1988 :type bot_info_identity: List[BotInfoIdentity]
1989 :param bot_info_confidence: Filter events by their Bot Info Confidence. Multiple confidences can be provided using the repeated keys syntax. For example, `bot_info_confidence=high&bot_info_confidence=medium`, will match events with a Bot Info Confidence of `high` or `medium`. Other notations like comma-separated or bracket notation are not supported.
1990 :type bot_info_confidence: List[BotInfoConfidence]
1991 :param bot_info_provider: Filter events by their Bot Info Provider. The provider must match exactly, partial or wildcard matching is not supported. Multiple Providers can be provided using the repeated keys syntax. For example, `bot_info_provider=OpenAI&bot_info_provider=AWS`, will match events with a Bot Info Provider of `OpenAI` or `AWS`. Other notations like comma-separated or bracket notation are not supported.
1992 :type bot_info_provider: List[str]
1993 :param bot_info_name: Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported.
1994 :type bot_info_name: List[str]
1995 :param ip_address: 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
1996 :type ip_address: str
1997 :param asn: 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.
1998 :type asn: str
1999 :param linked_id: Filter events by your custom identifier. You can use [linked IDs](https://docs.fingerprint.com/reference/js-agent-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.
2000 :type linked_id: str
2001 :param url: Filter events by the URL (`url` property) associated with the event.
2002 :type url: str
2003 :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event.
2004 :type bundle_id: str
2005 :param package_name: Filter events by the Package Name (Android) associated with the event.
2006 :type package_name: str
2007 :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com)
2008 :type origin: str
2009 :param start: Include events that happened after the provided `start` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to 7 days ago. Setting `start` does not change the default `end` date of `now` — adjust it separately if needed.
2010 :type start: SearchEventsStartParameter
2011 :param end: Include events that happened before the provided `end` date formatted as an RFC3339 timestamp. For backward compatibility, a Unix milliseconds timestamp is also accepted. Defaults to now. Setting `end` does not change the default `start` date of `7 days ago` — adjust it separately if needed.
2012 :type end: SearchEventsEndParameter
2013 :param reverse: When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order).
2014 :type reverse: bool
2015 :param suspect: Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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.
2016 :type suspect: bool
2017 :param vpn: 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.
2018 :type vpn: bool
2019 :param virtual_machine: 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.
2020 :type virtual_machine: bool
2021 :param tampering: Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response.
2022 :type tampering: bool
2023 :param anti_detect_browser: Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering_details.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response.
2024 :type anti_detect_browser: bool
2025 :param incognito: 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.
2026 :type incognito: bool
2027 :param privacy_settings: 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.
2028 :type privacy_settings: bool
2029 :param jailbroken: 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.
2030 :type jailbroken: bool
2031 :param frida: 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.
2032 :type frida: bool
2033 :param factory_reset: Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset_timestamp` property populated are included. Events without a `factory_reset_timestamp` Smart Signal result are left out of the response.
2034 :type factory_reset: bool
2035 :param cloned_app: 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.
2036 :type cloned_app: bool
2037 :param emulator: 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.
2038 :type emulator: bool
2039 :param root_apps: 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.
2040 :type root_apps: bool
2041 :param vpn_confidence: 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.
2042 :type vpn_confidence: SearchEventsVpnConfidence
2043 :param min_suspect_score: 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.
2044 :type min_suspect_score: float
2045 :param developer_tools: 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.
2046 :type developer_tools: bool
2047 :param location_spoofing: 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.
2048 :type location_spoofing: bool
2049 :param mitm_attack: 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.
2050 :type mitm_attack: bool
2051 :param rare_device: Filter events by Device Rarity detection result. > Note: When using this parameter, only events with the `rare_device` property set to `true` or `false` are returned. Events without a Device Rarity Smart Signal result are left out of the response. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/).
2052 :type rare_device: bool
2053 :param rare_device_percentile_bucket: Filter events by Device Rarity percentile bucket. `<p95` - device configuration is in the bottom 95% (most common). `p95-p99` - device is in the 95th to 99th percentile. `p99-p99.5` - device is in the 99th to 99.5th percentile. `p99.5-p99.9` - device is in the 99.5th to 99.9th percentile. `p99.9+` - device is in the top 0.1% (rarest). `not_seen` - device configuration has never been observed before. > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/).
2054 :type rare_device_percentile_bucket: SearchEventsRareDevicePercentileBucket
2055 :param proxy: 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.
2056 :type proxy: bool
2057 :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14`
2058 :type sdk_version: str
2059 :param sdk_platform: 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.
2060 :type sdk_platform: SearchEventsSdkPlatform
2061 :param environment: Filter for events by providing one or more environment IDs (`environment_id` property). ### Array syntax To provide multiple environment IDs, use the repeated keys syntax (`environment=env1&environment=env2`). Other notations like comma-separated (`environment=env1,env2`) or bracket notation (`environment[]=env1&environment[]=env2`) are not supported.
2062 :type environment: List[str]
2063 :param proximity_id: 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.
2064 :type proximity_id: str
2065 :param total_hits: 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.
2066 :type total_hits: int
2067 :param tor_node: 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.
2068 :type tor_node: bool
2069 :param incremental_identification_status: Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response.
2070 :type incremental_identification_status: SearchEventsIncrementalIdentificationStatus
2071 :param simulator: Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response.
2072 :type simulator: bool
2073 :param source: Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team.
2074 :type source: List[SearchEventsSource]
2075 :param active_call: Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response.
2076 :type active_call: bool
2077 :param compromised_device_integrity: Filter events by Compromised Device Integrity result on Android devices. > Note: When using this parameter, only events with the `compromised_device_integrity` property set to `true` or `false` are returned. Events without a `compromised_device_integrity` Smart Signal result are left out of the response.
2078 :type compromised_device_integrity: bool
2079 :param _request_timeout: timeout setting for this request. If one
2080 number provided, it will be total request
2081 timeout. It can also be a pair (tuple) of
2082 (connection, read) timeouts.
2083 :type _request_timeout: int, tuple(int, int), optional
2084 :param _request_auth: set to override the auth_settings for an a single
2085 request; this effectively ignores the
2086 authentication in the spec for a single request.
2087 :type _request_auth: dict, optional
2088 :param _content_type: force content-type for the request.
2089 :type _content_type: str, Optional
2090 :param _headers: set to override the headers for a single
2091 request; this effectively ignores the headers
2092 in the spec for a single request.
2093 :type _headers: dict, optional
2094 :return: Returns the result object.
2095 """ # noqa: E501
2097 _param = self._search_events_serialize(
2098 limit=limit,
2099 pagination_key=pagination_key,
2100 visitor_id=visitor_id,
2101 high_recall_id=high_recall_id,
2102 bot=bot,
2103 bot_info=bot_info,
2104 bot_info_category=bot_info_category,
2105 bot_info_identity=bot_info_identity,
2106 bot_info_confidence=bot_info_confidence,
2107 bot_info_provider=bot_info_provider,
2108 bot_info_name=bot_info_name,
2109 ip_address=ip_address,
2110 asn=asn,
2111 linked_id=linked_id,
2112 url=url,
2113 bundle_id=bundle_id,
2114 package_name=package_name,
2115 origin=origin,
2116 start=start,
2117 end=end,
2118 reverse=reverse,
2119 suspect=suspect,
2120 vpn=vpn,
2121 virtual_machine=virtual_machine,
2122 tampering=tampering,
2123 anti_detect_browser=anti_detect_browser,
2124 incognito=incognito,
2125 privacy_settings=privacy_settings,
2126 jailbroken=jailbroken,
2127 frida=frida,
2128 factory_reset=factory_reset,
2129 cloned_app=cloned_app,
2130 emulator=emulator,
2131 root_apps=root_apps,
2132 vpn_confidence=vpn_confidence,
2133 min_suspect_score=min_suspect_score,
2134 developer_tools=developer_tools,
2135 location_spoofing=location_spoofing,
2136 mitm_attack=mitm_attack,
2137 rare_device=rare_device,
2138 rare_device_percentile_bucket=rare_device_percentile_bucket,
2139 proxy=proxy,
2140 sdk_version=sdk_version,
2141 sdk_platform=sdk_platform,
2142 environment=environment,
2143 proximity_id=proximity_id,
2144 total_hits=total_hits,
2145 tor_node=tor_node,
2146 incremental_identification_status=incremental_identification_status,
2147 simulator=simulator,
2148 source=source,
2149 active_call=active_call,
2150 compromised_device_integrity=compromised_device_integrity,
2151 _request_auth=_request_auth,
2152 _content_type=_content_type,
2153 _headers=_headers,
2154 )
2156 _response_types_map: dict[str, Optional[str]] = {
2157 '200': 'EventSearch',
2158 '400': 'ErrorResponse',
2159 '403': 'ErrorResponse',
2160 '404': 'ErrorResponse',
2161 '429': 'ErrorResponse',
2162 '500': 'ErrorResponse',
2163 '503': 'ErrorResponse',
2164 '504': 'ErrorResponse',
2165 }
2167 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2168 return response_data.response
2170 def _search_events_serialize(
2171 self,
2172 limit: Optional[int],
2173 pagination_key: Optional[str],
2174 visitor_id: Optional[str],
2175 high_recall_id: Optional[str],
2176 bot: Optional[SearchEventsBot],
2177 bot_info: Optional[SearchEventsBotInfo],
2178 bot_info_category: Optional[list[BotInfoCategory]],
2179 bot_info_identity: Optional[list[BotInfoIdentity]],
2180 bot_info_confidence: Optional[list[BotInfoConfidence]],
2181 bot_info_provider: Optional[list[str]],
2182 bot_info_name: Optional[list[str]],
2183 ip_address: Optional[str],
2184 asn: Optional[str],
2185 linked_id: Optional[str],
2186 url: Optional[str],
2187 bundle_id: Optional[str],
2188 package_name: Optional[str],
2189 origin: Optional[str],
2190 start: Optional[SearchEventsStartParameter],
2191 end: Optional[SearchEventsEndParameter],
2192 reverse: Optional[bool],
2193 suspect: Optional[bool],
2194 vpn: Optional[bool],
2195 virtual_machine: Optional[bool],
2196 tampering: Optional[bool],
2197 anti_detect_browser: Optional[bool],
2198 incognito: Optional[bool],
2199 privacy_settings: Optional[bool],
2200 jailbroken: Optional[bool],
2201 frida: Optional[bool],
2202 factory_reset: Optional[bool],
2203 cloned_app: Optional[bool],
2204 emulator: Optional[bool],
2205 root_apps: Optional[bool],
2206 vpn_confidence: Optional[SearchEventsVpnConfidence],
2207 min_suspect_score: Optional[float],
2208 developer_tools: Optional[bool],
2209 location_spoofing: Optional[bool],
2210 mitm_attack: Optional[bool],
2211 rare_device: Optional[bool],
2212 rare_device_percentile_bucket: Optional[SearchEventsRareDevicePercentileBucket],
2213 proxy: Optional[bool],
2214 sdk_version: Optional[str],
2215 sdk_platform: Optional[SearchEventsSdkPlatform],
2216 environment: Optional[list[str]],
2217 proximity_id: Optional[str],
2218 total_hits: Optional[int],
2219 tor_node: Optional[bool],
2220 incremental_identification_status: Optional[SearchEventsIncrementalIdentificationStatus],
2221 simulator: Optional[bool],
2222 source: Optional[list[SearchEventsSource]],
2223 active_call: Optional[bool],
2224 compromised_device_integrity: Optional[bool],
2225 _request_auth: Optional[dict[StrictStr, Any]],
2226 _content_type: Optional[StrictStr],
2227 _headers: Optional[dict[StrictStr, Any]],
2228 ) -> RequestSerialized:
2230 _collection_formats: dict[str, str] = {
2231 'bot_info_category': 'multi',
2232 'bot_info_identity': 'multi',
2233 'bot_info_confidence': 'multi',
2234 'bot_info_provider': 'multi',
2235 'bot_info_name': 'multi',
2236 'environment': 'multi',
2237 'source': 'multi',
2238 }
2240 _path_params: dict[str, str] = {}
2241 _query_params: list[tuple[str, ParamValue]] = []
2242 _header_params: dict[str, Optional[str]] = _headers or {}
2243 _form_params: list[tuple[str, ParamValue]] = []
2244 _files: dict[
2245 str,
2246 Union[str, bytes, list[str], list[bytes], tuple[str, bytes], list[tuple[str, bytes]]],
2247 ] = {}
2248 _body_params: Optional[Any] = None
2250 # process the query parameters
2251 if limit is not None:
2252 _query_params.append(('limit', limit))
2254 # process the query parameters
2255 if pagination_key is not None:
2256 _query_params.append(('pagination_key', pagination_key))
2258 # process the query parameters
2259 if visitor_id is not None:
2260 _query_params.append(('visitor_id', visitor_id))
2262 # process the query parameters
2263 if high_recall_id is not None:
2264 _query_params.append(('high_recall_id', high_recall_id))
2266 # process the query parameters
2267 if bot is not None:
2268 _query_params.append(('bot', bot.value))
2270 # process the query parameters
2271 if bot_info is not None:
2272 _query_params.append(('bot_info', bot_info.value))
2274 # process the query parameters
2275 if bot_info_category is not None:
2276 _query_params.append(('bot_info_category', bot_info_category))
2278 # process the query parameters
2279 if bot_info_identity is not None:
2280 _query_params.append(('bot_info_identity', bot_info_identity))
2282 # process the query parameters
2283 if bot_info_confidence is not None:
2284 _query_params.append(('bot_info_confidence', bot_info_confidence))
2286 # process the query parameters
2287 if bot_info_provider is not None:
2288 _query_params.append(('bot_info_provider', bot_info_provider))
2290 # process the query parameters
2291 if bot_info_name is not None:
2292 _query_params.append(('bot_info_name', bot_info_name))
2294 # process the query parameters
2295 if ip_address is not None:
2296 _query_params.append(('ip_address', ip_address))
2298 # process the query parameters
2299 if asn is not None:
2300 _query_params.append(('asn', asn))
2302 # process the query parameters
2303 if linked_id is not None:
2304 _query_params.append(('linked_id', linked_id))
2306 # process the query parameters
2307 if url is not None:
2308 _query_params.append(('url', url))
2310 # process the query parameters
2311 if bundle_id is not None:
2312 _query_params.append(('bundle_id', bundle_id))
2314 # process the query parameters
2315 if package_name is not None:
2316 _query_params.append(('package_name', package_name))
2318 # process the query parameters
2319 if origin is not None:
2320 _query_params.append(('origin', origin))
2322 # process the query parameters
2323 if start is not None:
2324 if isinstance(start, datetime):
2325 _query_params.append(('start', start.isoformat(timespec='microseconds')))
2326 elif isinstance(start, date):
2327 _query_params.append(('start', start.isoformat()))
2328 else:
2329 _query_params.append(('start', start))
2330 # process the query parameters
2331 if end is not None:
2332 if isinstance(end, datetime):
2333 _query_params.append(('end', end.isoformat(timespec='microseconds')))
2334 elif isinstance(end, date):
2335 _query_params.append(('end', end.isoformat()))
2336 else:
2337 _query_params.append(('end', end))
2338 # process the query parameters
2339 if reverse is not None:
2340 _query_params.append(('reverse', reverse))
2342 # process the query parameters
2343 if suspect is not None:
2344 _query_params.append(('suspect', suspect))
2346 # process the query parameters
2347 if vpn is not None:
2348 _query_params.append(('vpn', vpn))
2350 # process the query parameters
2351 if virtual_machine is not None:
2352 _query_params.append(('virtual_machine', virtual_machine))
2354 # process the query parameters
2355 if tampering is not None:
2356 _query_params.append(('tampering', tampering))
2358 # process the query parameters
2359 if anti_detect_browser is not None:
2360 _query_params.append(('anti_detect_browser', anti_detect_browser))
2362 # process the query parameters
2363 if incognito is not None:
2364 _query_params.append(('incognito', incognito))
2366 # process the query parameters
2367 if privacy_settings is not None:
2368 _query_params.append(('privacy_settings', privacy_settings))
2370 # process the query parameters
2371 if jailbroken is not None:
2372 _query_params.append(('jailbroken', jailbroken))
2374 # process the query parameters
2375 if frida is not None:
2376 _query_params.append(('frida', frida))
2378 # process the query parameters
2379 if factory_reset is not None:
2380 _query_params.append(('factory_reset', factory_reset))
2382 # process the query parameters
2383 if cloned_app is not None:
2384 _query_params.append(('cloned_app', cloned_app))
2386 # process the query parameters
2387 if emulator is not None:
2388 _query_params.append(('emulator', emulator))
2390 # process the query parameters
2391 if root_apps is not None:
2392 _query_params.append(('root_apps', root_apps))
2394 # process the query parameters
2395 if vpn_confidence is not None:
2396 _query_params.append(('vpn_confidence', vpn_confidence.value))
2398 # process the query parameters
2399 if min_suspect_score is not None:
2400 _query_params.append(('min_suspect_score', min_suspect_score))
2402 # process the query parameters
2403 if developer_tools is not None:
2404 _query_params.append(('developer_tools', developer_tools))
2406 # process the query parameters
2407 if location_spoofing is not None:
2408 _query_params.append(('location_spoofing', location_spoofing))
2410 # process the query parameters
2411 if mitm_attack is not None:
2412 _query_params.append(('mitm_attack', mitm_attack))
2414 # process the query parameters
2415 if rare_device is not None:
2416 _query_params.append(('rare_device', rare_device))
2418 # process the query parameters
2419 if rare_device_percentile_bucket is not None:
2420 _query_params.append(
2421 ('rare_device_percentile_bucket', rare_device_percentile_bucket.value)
2422 )
2424 # process the query parameters
2425 if proxy is not None:
2426 _query_params.append(('proxy', proxy))
2428 # process the query parameters
2429 if sdk_version is not None:
2430 _query_params.append(('sdk_version', sdk_version))
2432 # process the query parameters
2433 if sdk_platform is not None:
2434 _query_params.append(('sdk_platform', sdk_platform.value))
2436 # process the query parameters
2437 if environment is not None:
2438 _query_params.append(('environment', environment))
2440 # process the query parameters
2441 if proximity_id is not None:
2442 _query_params.append(('proximity_id', proximity_id))
2444 # process the query parameters
2445 if total_hits is not None:
2446 _query_params.append(('total_hits', total_hits))
2448 # process the query parameters
2449 if tor_node is not None:
2450 _query_params.append(('tor_node', tor_node))
2452 # process the query parameters
2453 if incremental_identification_status is not None:
2454 _query_params.append(
2455 ('incremental_identification_status', incremental_identification_status.value)
2456 )
2458 # process the query parameters
2459 if simulator is not None:
2460 _query_params.append(('simulator', simulator))
2462 # process the query parameters
2463 if source is not None:
2464 _query_params.append(('source', source))
2466 # process the query parameters
2467 if active_call is not None:
2468 _query_params.append(('active_call', active_call))
2470 # process the query parameters
2471 if compromised_device_integrity is not None:
2472 _query_params.append(('compromised_device_integrity', compromised_device_integrity))
2474 # set the HTTP header `Accept`
2475 if 'Accept' not in _header_params:
2476 _header_params['Accept'] = self.api_client.select_header_accept(['application/json'])
2478 # authentication setting
2479 _auth_settings: list[str] = ['bearerAuth']
2481 return self.api_client.param_serialize(
2482 method='GET',
2483 resource_path='/events',
2484 path_params=_path_params,
2485 query_params=_query_params,
2486 header_params=_header_params,
2487 body=_body_params,
2488 post_params=_form_params,
2489 files=_files,
2490 auth_settings=_auth_settings,
2491 collection_formats=_collection_formats,
2492 _request_auth=_request_auth,
2493 )
2495 @validate_call
2496 def update_event(
2497 self,
2498 event_id: Annotated[
2499 StrictStr,
2500 Field(
2501 description='The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id).'
2502 ),
2503 ],
2504 event_update: EventUpdate,
2505 _request_timeout: Union[
2506 None,
2507 Annotated[StrictFloat, Field(gt=0)],
2508 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2509 ] = None,
2510 _request_auth: Optional[dict[StrictStr, Any]] = None,
2511 _content_type: Optional[StrictStr] = None,
2512 _headers: Optional[dict[StrictStr, Any]] = None,
2513 ) -> None:
2514 """Update an event
2516 Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** You can only update events created within the last 10 days. Updating an older event returns HTTP 400 with the message `event is too old to be updated (> 10 days)`, even if your plan retains events for longer. **Warning** Events created by the Automation Intelligence API (`POST /edge`) cannot be updated. Updating them returns HTTP 400. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request.
2518 :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required)
2519 :type event_id: str
2520 :param event_update: (required)
2521 :type event_update: EventUpdate
2522 :param _request_timeout: timeout setting for this request. If one
2523 number provided, it will be total request
2524 timeout. It can also be a pair (tuple) of
2525 (connection, read) timeouts.
2526 :type _request_timeout: int, tuple(int, int), optional
2527 :param _request_auth: set to override the auth_settings for an a single
2528 request; this effectively ignores the
2529 authentication in the spec for a single request.
2530 :type _request_auth: dict, optional
2531 :param _content_type: force content-type for the request.
2532 :type _content_type: str, Optional
2533 :param _headers: set to override the headers for a single
2534 request; this effectively ignores the headers
2535 in the spec for a single request.
2536 :type _headers: dict, optional
2537 :return: Returns the result object.
2538 """ # noqa: E501
2540 _param = self._update_event_serialize(
2541 event_id=event_id,
2542 event_update=event_update,
2543 _request_auth=_request_auth,
2544 _content_type=_content_type,
2545 _headers=_headers,
2546 )
2548 _response_types_map: dict[str, Optional[str]] = {
2549 '200': None,
2550 '400': 'ErrorResponse',
2551 '403': 'ErrorResponse',
2552 '404': 'ErrorResponse',
2553 '409': 'ErrorResponse',
2554 }
2556 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2557 response_data.read()
2558 self.api_client.response_deserialize(
2559 response_data=response_data,
2560 response_types_map=_response_types_map,
2561 )
2563 @validate_call
2564 def update_event_with_http_info(
2565 self,
2566 event_id: Annotated[
2567 StrictStr,
2568 Field(
2569 description='The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id).'
2570 ),
2571 ],
2572 event_update: EventUpdate,
2573 _request_timeout: Union[
2574 None,
2575 Annotated[StrictFloat, Field(gt=0)],
2576 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2577 ] = None,
2578 _request_auth: Optional[dict[StrictStr, Any]] = None,
2579 _content_type: Optional[StrictStr] = None,
2580 _headers: Optional[dict[StrictStr, Any]] = None,
2581 ) -> ApiResponse[None]:
2582 """Update an event
2584 Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** You can only update events created within the last 10 days. Updating an older event returns HTTP 400 with the message `event is too old to be updated (> 10 days)`, even if your plan retains events for longer. **Warning** Events created by the Automation Intelligence API (`POST /edge`) cannot be updated. Updating them returns HTTP 400. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request.
2586 :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required)
2587 :type event_id: str
2588 :param event_update: (required)
2589 :type event_update: EventUpdate
2590 :param _request_timeout: timeout setting for this request. If one
2591 number provided, it will be total request
2592 timeout. It can also be a pair (tuple) of
2593 (connection, read) timeouts.
2594 :type _request_timeout: int, tuple(int, int), optional
2595 :param _request_auth: set to override the auth_settings for an a single
2596 request; this effectively ignores the
2597 authentication in the spec for a single request.
2598 :type _request_auth: dict, optional
2599 :param _content_type: force content-type for the request.
2600 :type _content_type: str, Optional
2601 :param _headers: set to override the headers for a single
2602 request; this effectively ignores the headers
2603 in the spec for a single request.
2604 :type _headers: dict, optional
2605 :return: Returns the result object.
2606 """ # noqa: E501
2608 _param = self._update_event_serialize(
2609 event_id=event_id,
2610 event_update=event_update,
2611 _request_auth=_request_auth,
2612 _content_type=_content_type,
2613 _headers=_headers,
2614 )
2616 _response_types_map: dict[str, Optional[str]] = {
2617 '200': None,
2618 '400': 'ErrorResponse',
2619 '403': 'ErrorResponse',
2620 '404': 'ErrorResponse',
2621 '409': 'ErrorResponse',
2622 }
2624 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2625 response_data.read()
2626 return self.api_client.response_deserialize(
2627 response_data=response_data,
2628 response_types_map=_response_types_map,
2629 )
2631 @validate_call
2632 def update_event_without_preload_content(
2633 self,
2634 event_id: Annotated[
2635 StrictStr,
2636 Field(
2637 description='The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id).'
2638 ),
2639 ],
2640 event_update: EventUpdate,
2641 _request_timeout: Union[
2642 None,
2643 Annotated[StrictFloat, Field(gt=0)],
2644 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2645 ] = None,
2646 _request_auth: Optional[dict[StrictStr, Any]] = None,
2647 _content_type: Optional[StrictStr] = None,
2648 _headers: Optional[dict[StrictStr, Any]] = None,
2649 ) -> RESTResponseType:
2650 """Update an event
2652 Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** You can only update events created within the last 10 days. Updating an older event returns HTTP 400 with the message `event is too old to be updated (> 10 days)`, even if your plan retains events for longer. **Warning** Events created by the Automation Intelligence API (`POST /edge`) cannot be updated. Updating them returns HTTP 400. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request.
2654 :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required)
2655 :type event_id: str
2656 :param event_update: (required)
2657 :type event_update: EventUpdate
2658 :param _request_timeout: timeout setting for this request. If one
2659 number provided, it will be total request
2660 timeout. It can also be a pair (tuple) of
2661 (connection, read) timeouts.
2662 :type _request_timeout: int, tuple(int, int), optional
2663 :param _request_auth: set to override the auth_settings for an a single
2664 request; this effectively ignores the
2665 authentication in the spec for a single request.
2666 :type _request_auth: dict, optional
2667 :param _content_type: force content-type for the request.
2668 :type _content_type: str, Optional
2669 :param _headers: set to override the headers for a single
2670 request; this effectively ignores the headers
2671 in the spec for a single request.
2672 :type _headers: dict, optional
2673 :return: Returns the result object.
2674 """ # noqa: E501
2676 _param = self._update_event_serialize(
2677 event_id=event_id,
2678 event_update=event_update,
2679 _request_auth=_request_auth,
2680 _content_type=_content_type,
2681 _headers=_headers,
2682 )
2684 _response_types_map: dict[str, Optional[str]] = {
2685 '200': None,
2686 '400': 'ErrorResponse',
2687 '403': 'ErrorResponse',
2688 '404': 'ErrorResponse',
2689 '409': 'ErrorResponse',
2690 }
2692 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2693 return response_data.response
2695 def _update_event_serialize(
2696 self,
2697 event_id: str,
2698 event_update: EventUpdate,
2699 _request_auth: Optional[dict[StrictStr, Any]],
2700 _content_type: Optional[StrictStr],
2701 _headers: Optional[dict[StrictStr, Any]],
2702 ) -> RequestSerialized:
2704 _collection_formats: dict[str, str] = {}
2706 _path_params: dict[str, str] = {}
2707 _query_params: list[tuple[str, ParamValue]] = []
2708 _header_params: dict[str, Optional[str]] = _headers or {}
2709 _form_params: list[tuple[str, ParamValue]] = []
2710 _files: dict[
2711 str,
2712 Union[str, bytes, list[str], list[bytes], tuple[str, bytes], list[tuple[str, bytes]]],
2713 ] = {}
2714 _body_params: Optional[Any] = None
2716 # process the path parameters
2717 if event_id is not None:
2718 _path_params['event_id'] = event_id
2720 # process the body parameter
2721 if event_update is not None:
2722 _body_params = event_update
2724 # set the HTTP header `Accept`
2725 if 'Accept' not in _header_params:
2726 _header_params['Accept'] = self.api_client.select_header_accept(['application/json'])
2728 # set the HTTP header `Content-Type`
2729 if _content_type:
2730 _header_params['Content-Type'] = _content_type
2731 else:
2732 _default_content_type = self.api_client.select_header_content_type(
2733 ['application/json']
2734 )
2735 if _default_content_type is not None:
2736 _header_params['Content-Type'] = _default_content_type
2738 # authentication setting
2739 _auth_settings: list[str] = ['bearerAuth']
2741 return self.api_client.param_serialize(
2742 method='PATCH',
2743 resource_path='/events/{event_id}',
2744 path_params=_path_params,
2745 query_params=_query_params,
2746 header_params=_header_params,
2747 body=_body_params,
2748 post_params=_form_params,
2749 files=_files,
2750 auth_settings=_auth_settings,
2751 collection_formats=_collection_formats,
2752 _request_auth=_request_auth,
2753 )