Coverage for fingerprint_server_sdk/api/fingerprint_api.py: 84%
281 statements
« prev ^ index » next coverage.py v7.14.3, created at 2026-10-15 10:54 +0000
« prev ^ index » next coverage.py v7.14.3, created at 2026-10-15 10:54 +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 _request_timeout: Union[
889 None,
890 Annotated[StrictFloat, Field(gt=0)],
891 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
892 ] = None,
893 _request_auth: Optional[dict[StrictStr, Any]] = None,
894 _content_type: Optional[StrictStr] = None,
895 _headers: Optional[dict[StrictStr, Any]] = None,
896 ) -> EventSearch:
897 """Search events
899 ## 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.
901 :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.
902 :type limit: int
903 :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`
904 :type pagination_key: str
905 :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).
906 :type visitor_id: str
907 :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).
908 :type high_recall_id: str
909 :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.
910 :type bot: SearchEventsBot
911 :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.
912 :type bot_info: SearchEventsBotInfo
913 :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.
914 :type bot_info_category: List[BotInfoCategory]
915 :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.
916 :type bot_info_identity: List[BotInfoIdentity]
917 :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.
918 :type bot_info_confidence: List[BotInfoConfidence]
919 :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.
920 :type bot_info_provider: List[str]
921 :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.
922 :type bot_info_name: List[str]
923 :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
924 :type ip_address: str
925 :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.
926 :type asn: str
927 :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.
928 :type linked_id: str
929 :param url: Filter events by the URL (`url` property) associated with the event.
930 :type url: str
931 :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event.
932 :type bundle_id: str
933 :param package_name: Filter events by the Package Name (Android) associated with the event.
934 :type package_name: str
935 :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com)
936 :type origin: str
937 :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.
938 :type start: SearchEventsStartParameter
939 :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.
940 :type end: SearchEventsEndParameter
941 :param reverse: When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order).
942 :type reverse: bool
943 :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.
944 :type suspect: bool
945 :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.
946 :type vpn: bool
947 :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.
948 :type virtual_machine: bool
949 :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.
950 :type tampering: bool
951 :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.
952 :type anti_detect_browser: bool
953 :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.
954 :type incognito: bool
955 :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.
956 :type privacy_settings: bool
957 :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.
958 :type jailbroken: bool
959 :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.
960 :type frida: bool
961 :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.
962 :type factory_reset: bool
963 :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.
964 :type cloned_app: bool
965 :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.
966 :type emulator: bool
967 :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.
968 :type root_apps: bool
969 :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.
970 :type vpn_confidence: SearchEventsVpnConfidence
971 :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.
972 :type min_suspect_score: float
973 :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.
974 :type developer_tools: bool
975 :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.
976 :type location_spoofing: bool
977 :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.
978 :type mitm_attack: bool
979 :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/).
980 :type rare_device: bool
981 :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/).
982 :type rare_device_percentile_bucket: SearchEventsRareDevicePercentileBucket
983 :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.
984 :type proxy: bool
985 :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14`
986 :type sdk_version: str
987 :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.
988 :type sdk_platform: SearchEventsSdkPlatform
989 :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.
990 :type environment: List[str]
991 :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.
992 :type proximity_id: str
993 :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.
994 :type total_hits: int
995 :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.
996 :type tor_node: bool
997 :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.
998 :type incremental_identification_status: SearchEventsIncrementalIdentificationStatus
999 :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.
1000 :type simulator: bool
1001 :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.
1002 :type source: List[SearchEventsSource]
1003 :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.
1004 :type active_call: bool
1005 :param _request_timeout: timeout setting for this request. If one
1006 number provided, it will be total request
1007 timeout. It can also be a pair (tuple) of
1008 (connection, read) timeouts.
1009 :type _request_timeout: int, tuple(int, int), optional
1010 :param _request_auth: set to override the auth_settings for an a single
1011 request; this effectively ignores the
1012 authentication in the spec for a single request.
1013 :type _request_auth: dict, optional
1014 :param _content_type: force content-type for the request.
1015 :type _content_type: str, Optional
1016 :param _headers: set to override the headers for a single
1017 request; this effectively ignores the headers
1018 in the spec for a single request.
1019 :type _headers: dict, optional
1020 :return: Returns the result object.
1021 """ # noqa: E501
1023 _param = self._search_events_serialize(
1024 limit=limit,
1025 pagination_key=pagination_key,
1026 visitor_id=visitor_id,
1027 high_recall_id=high_recall_id,
1028 bot=bot,
1029 bot_info=bot_info,
1030 bot_info_category=bot_info_category,
1031 bot_info_identity=bot_info_identity,
1032 bot_info_confidence=bot_info_confidence,
1033 bot_info_provider=bot_info_provider,
1034 bot_info_name=bot_info_name,
1035 ip_address=ip_address,
1036 asn=asn,
1037 linked_id=linked_id,
1038 url=url,
1039 bundle_id=bundle_id,
1040 package_name=package_name,
1041 origin=origin,
1042 start=start,
1043 end=end,
1044 reverse=reverse,
1045 suspect=suspect,
1046 vpn=vpn,
1047 virtual_machine=virtual_machine,
1048 tampering=tampering,
1049 anti_detect_browser=anti_detect_browser,
1050 incognito=incognito,
1051 privacy_settings=privacy_settings,
1052 jailbroken=jailbroken,
1053 frida=frida,
1054 factory_reset=factory_reset,
1055 cloned_app=cloned_app,
1056 emulator=emulator,
1057 root_apps=root_apps,
1058 vpn_confidence=vpn_confidence,
1059 min_suspect_score=min_suspect_score,
1060 developer_tools=developer_tools,
1061 location_spoofing=location_spoofing,
1062 mitm_attack=mitm_attack,
1063 rare_device=rare_device,
1064 rare_device_percentile_bucket=rare_device_percentile_bucket,
1065 proxy=proxy,
1066 sdk_version=sdk_version,
1067 sdk_platform=sdk_platform,
1068 environment=environment,
1069 proximity_id=proximity_id,
1070 total_hits=total_hits,
1071 tor_node=tor_node,
1072 incremental_identification_status=incremental_identification_status,
1073 simulator=simulator,
1074 source=source,
1075 active_call=active_call,
1076 _request_auth=_request_auth,
1077 _content_type=_content_type,
1078 _headers=_headers,
1079 )
1081 _response_types_map: dict[str, Optional[str]] = {
1082 '200': 'EventSearch',
1083 '400': 'ErrorResponse',
1084 '403': 'ErrorResponse',
1085 '404': 'ErrorResponse',
1086 '429': 'ErrorResponse',
1087 '500': 'ErrorResponse',
1088 '503': 'ErrorResponse',
1089 '504': 'ErrorResponse',
1090 }
1092 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1093 response_data.read()
1094 return self.api_client.response_deserialize(
1095 response_data=response_data,
1096 response_types_map=_response_types_map,
1097 ).data
1099 @validate_call
1100 def search_events_with_http_info(
1101 self,
1102 limit: Annotated[
1103 Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
1104 Field(
1105 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. '
1106 ),
1107 ] = None,
1108 pagination_key: Annotated[
1109 Optional[StrictStr],
1110 Field(
1111 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` '
1112 ),
1113 ] = None,
1114 visitor_id: Annotated[
1115 Optional[StrictStr],
1116 Field(
1117 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). '
1118 ),
1119 ] = None,
1120 high_recall_id: Annotated[
1121 Optional[StrictStr],
1122 Field(
1123 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). '
1124 ),
1125 ] = None,
1126 bot: Annotated[
1127 Optional[SearchEventsBot],
1128 Field(
1129 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. '
1130 ),
1131 ] = None,
1132 bot_info: Annotated[
1133 Optional[SearchEventsBotInfo],
1134 Field(
1135 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. '
1136 ),
1137 ] = None,
1138 bot_info_category: Annotated[
1139 Optional[list[BotInfoCategory]],
1140 Field(
1141 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. '
1142 ),
1143 ] = None,
1144 bot_info_identity: Annotated[
1145 Optional[list[BotInfoIdentity]],
1146 Field(
1147 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. '
1148 ),
1149 ] = None,
1150 bot_info_confidence: Annotated[
1151 Optional[list[BotInfoConfidence]],
1152 Field(
1153 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. '
1154 ),
1155 ] = None,
1156 bot_info_provider: Annotated[
1157 Optional[list[StrictStr]],
1158 Field(
1159 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. '
1160 ),
1161 ] = None,
1162 bot_info_name: Annotated[
1163 Optional[list[StrictStr]],
1164 Field(
1165 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. '
1166 ),
1167 ] = None,
1168 ip_address: Annotated[
1169 Optional[StrictStr],
1170 Field(
1171 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 '
1172 ),
1173 ] = None,
1174 asn: Annotated[
1175 Optional[StrictStr],
1176 Field(
1177 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. "
1178 ),
1179 ] = None,
1180 linked_id: Annotated[
1181 Optional[StrictStr],
1182 Field(
1183 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. '
1184 ),
1185 ] = None,
1186 url: Annotated[
1187 Optional[StrictStr],
1188 Field(
1189 description='Filter events by the URL (`url` property) associated with the event. '
1190 ),
1191 ] = None,
1192 bundle_id: Annotated[
1193 Optional[StrictStr],
1194 Field(description='Filter events by the Bundle ID (iOS) associated with the event. '),
1195 ] = None,
1196 package_name: Annotated[
1197 Optional[StrictStr],
1198 Field(
1199 description='Filter events by the Package Name (Android) associated with the event. '
1200 ),
1201 ] = None,
1202 origin: Annotated[
1203 Optional[StrictStr],
1204 Field(
1205 description='Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) '
1206 ),
1207 ] = None,
1208 start: Annotated[
1209 Optional[SearchEventsStartParameter],
1210 Field(
1211 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. ',
1212 ),
1213 ] = None,
1214 end: Annotated[
1215 Optional[SearchEventsEndParameter],
1216 Field(
1217 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. ',
1218 ),
1219 ] = None,
1220 reverse: Annotated[
1221 Optional[StrictBool],
1222 Field(
1223 description='When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order). '
1224 ),
1225 ] = None,
1226 suspect: Annotated[
1227 Optional[StrictBool],
1228 Field(
1229 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. '
1230 ),
1231 ] = None,
1232 vpn: Annotated[
1233 Optional[StrictBool],
1234 Field(
1235 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. '
1236 ),
1237 ] = None,
1238 virtual_machine: Annotated[
1239 Optional[StrictBool],
1240 Field(
1241 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. '
1242 ),
1243 ] = None,
1244 tampering: Annotated[
1245 Optional[StrictBool],
1246 Field(
1247 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. '
1248 ),
1249 ] = None,
1250 anti_detect_browser: Annotated[
1251 Optional[StrictBool],
1252 Field(
1253 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. '
1254 ),
1255 ] = None,
1256 incognito: Annotated[
1257 Optional[StrictBool],
1258 Field(
1259 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. '
1260 ),
1261 ] = None,
1262 privacy_settings: Annotated[
1263 Optional[StrictBool],
1264 Field(
1265 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. '
1266 ),
1267 ] = None,
1268 jailbroken: Annotated[
1269 Optional[StrictBool],
1270 Field(
1271 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. '
1272 ),
1273 ] = None,
1274 frida: Annotated[
1275 Optional[StrictBool],
1276 Field(
1277 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. '
1278 ),
1279 ] = None,
1280 factory_reset: Annotated[
1281 Optional[StrictBool],
1282 Field(
1283 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. '
1284 ),
1285 ] = None,
1286 cloned_app: Annotated[
1287 Optional[StrictBool],
1288 Field(
1289 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. '
1290 ),
1291 ] = None,
1292 emulator: Annotated[
1293 Optional[StrictBool],
1294 Field(
1295 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. '
1296 ),
1297 ] = None,
1298 root_apps: Annotated[
1299 Optional[StrictBool],
1300 Field(
1301 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. '
1302 ),
1303 ] = None,
1304 vpn_confidence: Annotated[
1305 Optional[SearchEventsVpnConfidence],
1306 Field(
1307 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. '
1308 ),
1309 ] = None,
1310 min_suspect_score: Annotated[
1311 Optional[Union[StrictFloat, StrictInt]],
1312 Field(
1313 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. '
1314 ),
1315 ] = None,
1316 developer_tools: Annotated[
1317 Optional[StrictBool],
1318 Field(
1319 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. '
1320 ),
1321 ] = None,
1322 location_spoofing: Annotated[
1323 Optional[StrictBool],
1324 Field(
1325 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. '
1326 ),
1327 ] = None,
1328 mitm_attack: Annotated[
1329 Optional[StrictBool],
1330 Field(
1331 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. '
1332 ),
1333 ] = None,
1334 rare_device: Annotated[
1335 Optional[StrictBool],
1336 Field(
1337 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/). '
1338 ),
1339 ] = None,
1340 rare_device_percentile_bucket: Annotated[
1341 Optional[SearchEventsRareDevicePercentileBucket],
1342 Field(
1343 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/). '
1344 ),
1345 ] = None,
1346 proxy: Annotated[
1347 Optional[StrictBool],
1348 Field(
1349 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. '
1350 ),
1351 ] = None,
1352 sdk_version: Annotated[
1353 Optional[StrictStr],
1354 Field(
1355 description='Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` '
1356 ),
1357 ] = None,
1358 sdk_platform: Annotated[
1359 Optional[SearchEventsSdkPlatform],
1360 Field(
1361 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. '
1362 ),
1363 ] = None,
1364 environment: Annotated[
1365 Optional[list[StrictStr]],
1366 Field(
1367 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. '
1368 ),
1369 ] = None,
1370 proximity_id: Annotated[
1371 Optional[StrictStr],
1372 Field(
1373 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. '
1374 ),
1375 ] = None,
1376 total_hits: Annotated[
1377 Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
1378 Field(
1379 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. '
1380 ),
1381 ] = None,
1382 tor_node: Annotated[
1383 Optional[StrictBool],
1384 Field(
1385 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. '
1386 ),
1387 ] = None,
1388 incremental_identification_status: Annotated[
1389 Optional[SearchEventsIncrementalIdentificationStatus],
1390 Field(
1391 description='Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. '
1392 ),
1393 ] = None,
1394 simulator: Annotated[
1395 Optional[StrictBool],
1396 Field(
1397 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. '
1398 ),
1399 ] = None,
1400 source: Annotated[
1401 Optional[Annotated[list[SearchEventsSource], Field(max_length=1)]],
1402 Field(
1403 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. '
1404 ),
1405 ] = None,
1406 active_call: Annotated[
1407 Optional[StrictBool],
1408 Field(
1409 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. '
1410 ),
1411 ] = None,
1412 _request_timeout: Union[
1413 None,
1414 Annotated[StrictFloat, Field(gt=0)],
1415 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1416 ] = None,
1417 _request_auth: Optional[dict[StrictStr, Any]] = None,
1418 _content_type: Optional[StrictStr] = None,
1419 _headers: Optional[dict[StrictStr, Any]] = None,
1420 ) -> ApiResponse[EventSearch]:
1421 """Search events
1423 ## 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.
1425 :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.
1426 :type limit: int
1427 :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`
1428 :type pagination_key: str
1429 :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).
1430 :type visitor_id: str
1431 :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).
1432 :type high_recall_id: str
1433 :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.
1434 :type bot: SearchEventsBot
1435 :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.
1436 :type bot_info: SearchEventsBotInfo
1437 :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.
1438 :type bot_info_category: List[BotInfoCategory]
1439 :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.
1440 :type bot_info_identity: List[BotInfoIdentity]
1441 :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.
1442 :type bot_info_confidence: List[BotInfoConfidence]
1443 :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.
1444 :type bot_info_provider: List[str]
1445 :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.
1446 :type bot_info_name: List[str]
1447 :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
1448 :type ip_address: str
1449 :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.
1450 :type asn: str
1451 :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.
1452 :type linked_id: str
1453 :param url: Filter events by the URL (`url` property) associated with the event.
1454 :type url: str
1455 :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event.
1456 :type bundle_id: str
1457 :param package_name: Filter events by the Package Name (Android) associated with the event.
1458 :type package_name: str
1459 :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com)
1460 :type origin: str
1461 :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.
1462 :type start: SearchEventsStartParameter
1463 :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.
1464 :type end: SearchEventsEndParameter
1465 :param reverse: When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order).
1466 :type reverse: bool
1467 :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.
1468 :type suspect: bool
1469 :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.
1470 :type vpn: bool
1471 :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.
1472 :type virtual_machine: bool
1473 :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.
1474 :type tampering: bool
1475 :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.
1476 :type anti_detect_browser: bool
1477 :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.
1478 :type incognito: bool
1479 :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.
1480 :type privacy_settings: bool
1481 :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.
1482 :type jailbroken: bool
1483 :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.
1484 :type frida: bool
1485 :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.
1486 :type factory_reset: bool
1487 :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.
1488 :type cloned_app: bool
1489 :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.
1490 :type emulator: bool
1491 :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.
1492 :type root_apps: bool
1493 :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.
1494 :type vpn_confidence: SearchEventsVpnConfidence
1495 :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.
1496 :type min_suspect_score: float
1497 :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.
1498 :type developer_tools: bool
1499 :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.
1500 :type location_spoofing: bool
1501 :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.
1502 :type mitm_attack: bool
1503 :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/).
1504 :type rare_device: bool
1505 :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/).
1506 :type rare_device_percentile_bucket: SearchEventsRareDevicePercentileBucket
1507 :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.
1508 :type proxy: bool
1509 :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14`
1510 :type sdk_version: str
1511 :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.
1512 :type sdk_platform: SearchEventsSdkPlatform
1513 :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.
1514 :type environment: List[str]
1515 :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.
1516 :type proximity_id: str
1517 :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.
1518 :type total_hits: int
1519 :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.
1520 :type tor_node: bool
1521 :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.
1522 :type incremental_identification_status: SearchEventsIncrementalIdentificationStatus
1523 :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.
1524 :type simulator: bool
1525 :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.
1526 :type source: List[SearchEventsSource]
1527 :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.
1528 :type active_call: bool
1529 :param _request_timeout: timeout setting for this request. If one
1530 number provided, it will be total request
1531 timeout. It can also be a pair (tuple) of
1532 (connection, read) timeouts.
1533 :type _request_timeout: int, tuple(int, int), optional
1534 :param _request_auth: set to override the auth_settings for an a single
1535 request; this effectively ignores the
1536 authentication in the spec for a single request.
1537 :type _request_auth: dict, optional
1538 :param _content_type: force content-type for the request.
1539 :type _content_type: str, Optional
1540 :param _headers: set to override the headers for a single
1541 request; this effectively ignores the headers
1542 in the spec for a single request.
1543 :type _headers: dict, optional
1544 :return: Returns the result object.
1545 """ # noqa: E501
1547 _param = self._search_events_serialize(
1548 limit=limit,
1549 pagination_key=pagination_key,
1550 visitor_id=visitor_id,
1551 high_recall_id=high_recall_id,
1552 bot=bot,
1553 bot_info=bot_info,
1554 bot_info_category=bot_info_category,
1555 bot_info_identity=bot_info_identity,
1556 bot_info_confidence=bot_info_confidence,
1557 bot_info_provider=bot_info_provider,
1558 bot_info_name=bot_info_name,
1559 ip_address=ip_address,
1560 asn=asn,
1561 linked_id=linked_id,
1562 url=url,
1563 bundle_id=bundle_id,
1564 package_name=package_name,
1565 origin=origin,
1566 start=start,
1567 end=end,
1568 reverse=reverse,
1569 suspect=suspect,
1570 vpn=vpn,
1571 virtual_machine=virtual_machine,
1572 tampering=tampering,
1573 anti_detect_browser=anti_detect_browser,
1574 incognito=incognito,
1575 privacy_settings=privacy_settings,
1576 jailbroken=jailbroken,
1577 frida=frida,
1578 factory_reset=factory_reset,
1579 cloned_app=cloned_app,
1580 emulator=emulator,
1581 root_apps=root_apps,
1582 vpn_confidence=vpn_confidence,
1583 min_suspect_score=min_suspect_score,
1584 developer_tools=developer_tools,
1585 location_spoofing=location_spoofing,
1586 mitm_attack=mitm_attack,
1587 rare_device=rare_device,
1588 rare_device_percentile_bucket=rare_device_percentile_bucket,
1589 proxy=proxy,
1590 sdk_version=sdk_version,
1591 sdk_platform=sdk_platform,
1592 environment=environment,
1593 proximity_id=proximity_id,
1594 total_hits=total_hits,
1595 tor_node=tor_node,
1596 incremental_identification_status=incremental_identification_status,
1597 simulator=simulator,
1598 source=source,
1599 active_call=active_call,
1600 _request_auth=_request_auth,
1601 _content_type=_content_type,
1602 _headers=_headers,
1603 )
1605 _response_types_map: dict[str, Optional[str]] = {
1606 '200': 'EventSearch',
1607 '400': 'ErrorResponse',
1608 '403': 'ErrorResponse',
1609 '404': 'ErrorResponse',
1610 '429': 'ErrorResponse',
1611 '500': 'ErrorResponse',
1612 '503': 'ErrorResponse',
1613 '504': 'ErrorResponse',
1614 }
1616 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1617 response_data.read()
1618 return self.api_client.response_deserialize(
1619 response_data=response_data,
1620 response_types_map=_response_types_map,
1621 )
1623 @validate_call
1624 def search_events_without_preload_content(
1625 self,
1626 limit: Annotated[
1627 Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
1628 Field(
1629 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. '
1630 ),
1631 ] = None,
1632 pagination_key: Annotated[
1633 Optional[StrictStr],
1634 Field(
1635 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` '
1636 ),
1637 ] = None,
1638 visitor_id: Annotated[
1639 Optional[StrictStr],
1640 Field(
1641 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). '
1642 ),
1643 ] = None,
1644 high_recall_id: Annotated[
1645 Optional[StrictStr],
1646 Field(
1647 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). '
1648 ),
1649 ] = None,
1650 bot: Annotated[
1651 Optional[SearchEventsBot],
1652 Field(
1653 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. '
1654 ),
1655 ] = None,
1656 bot_info: Annotated[
1657 Optional[SearchEventsBotInfo],
1658 Field(
1659 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. '
1660 ),
1661 ] = None,
1662 bot_info_category: Annotated[
1663 Optional[list[BotInfoCategory]],
1664 Field(
1665 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. '
1666 ),
1667 ] = None,
1668 bot_info_identity: Annotated[
1669 Optional[list[BotInfoIdentity]],
1670 Field(
1671 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. '
1672 ),
1673 ] = None,
1674 bot_info_confidence: Annotated[
1675 Optional[list[BotInfoConfidence]],
1676 Field(
1677 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. '
1678 ),
1679 ] = None,
1680 bot_info_provider: Annotated[
1681 Optional[list[StrictStr]],
1682 Field(
1683 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. '
1684 ),
1685 ] = None,
1686 bot_info_name: Annotated[
1687 Optional[list[StrictStr]],
1688 Field(
1689 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. '
1690 ),
1691 ] = None,
1692 ip_address: Annotated[
1693 Optional[StrictStr],
1694 Field(
1695 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 '
1696 ),
1697 ] = None,
1698 asn: Annotated[
1699 Optional[StrictStr],
1700 Field(
1701 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. "
1702 ),
1703 ] = None,
1704 linked_id: Annotated[
1705 Optional[StrictStr],
1706 Field(
1707 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. '
1708 ),
1709 ] = None,
1710 url: Annotated[
1711 Optional[StrictStr],
1712 Field(
1713 description='Filter events by the URL (`url` property) associated with the event. '
1714 ),
1715 ] = None,
1716 bundle_id: Annotated[
1717 Optional[StrictStr],
1718 Field(description='Filter events by the Bundle ID (iOS) associated with the event. '),
1719 ] = None,
1720 package_name: Annotated[
1721 Optional[StrictStr],
1722 Field(
1723 description='Filter events by the Package Name (Android) associated with the event. '
1724 ),
1725 ] = None,
1726 origin: Annotated[
1727 Optional[StrictStr],
1728 Field(
1729 description='Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) '
1730 ),
1731 ] = None,
1732 start: Annotated[
1733 Optional[SearchEventsStartParameter],
1734 Field(
1735 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. ',
1736 ),
1737 ] = None,
1738 end: Annotated[
1739 Optional[SearchEventsEndParameter],
1740 Field(
1741 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. ',
1742 ),
1743 ] = None,
1744 reverse: Annotated[
1745 Optional[StrictBool],
1746 Field(
1747 description='When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order). '
1748 ),
1749 ] = None,
1750 suspect: Annotated[
1751 Optional[StrictBool],
1752 Field(
1753 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. '
1754 ),
1755 ] = None,
1756 vpn: Annotated[
1757 Optional[StrictBool],
1758 Field(
1759 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. '
1760 ),
1761 ] = None,
1762 virtual_machine: Annotated[
1763 Optional[StrictBool],
1764 Field(
1765 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. '
1766 ),
1767 ] = None,
1768 tampering: Annotated[
1769 Optional[StrictBool],
1770 Field(
1771 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. '
1772 ),
1773 ] = None,
1774 anti_detect_browser: Annotated[
1775 Optional[StrictBool],
1776 Field(
1777 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. '
1778 ),
1779 ] = None,
1780 incognito: Annotated[
1781 Optional[StrictBool],
1782 Field(
1783 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. '
1784 ),
1785 ] = None,
1786 privacy_settings: Annotated[
1787 Optional[StrictBool],
1788 Field(
1789 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. '
1790 ),
1791 ] = None,
1792 jailbroken: Annotated[
1793 Optional[StrictBool],
1794 Field(
1795 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. '
1796 ),
1797 ] = None,
1798 frida: Annotated[
1799 Optional[StrictBool],
1800 Field(
1801 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. '
1802 ),
1803 ] = None,
1804 factory_reset: Annotated[
1805 Optional[StrictBool],
1806 Field(
1807 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. '
1808 ),
1809 ] = None,
1810 cloned_app: Annotated[
1811 Optional[StrictBool],
1812 Field(
1813 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. '
1814 ),
1815 ] = None,
1816 emulator: Annotated[
1817 Optional[StrictBool],
1818 Field(
1819 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. '
1820 ),
1821 ] = None,
1822 root_apps: Annotated[
1823 Optional[StrictBool],
1824 Field(
1825 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. '
1826 ),
1827 ] = None,
1828 vpn_confidence: Annotated[
1829 Optional[SearchEventsVpnConfidence],
1830 Field(
1831 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. '
1832 ),
1833 ] = None,
1834 min_suspect_score: Annotated[
1835 Optional[Union[StrictFloat, StrictInt]],
1836 Field(
1837 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. '
1838 ),
1839 ] = None,
1840 developer_tools: Annotated[
1841 Optional[StrictBool],
1842 Field(
1843 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. '
1844 ),
1845 ] = None,
1846 location_spoofing: Annotated[
1847 Optional[StrictBool],
1848 Field(
1849 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. '
1850 ),
1851 ] = None,
1852 mitm_attack: Annotated[
1853 Optional[StrictBool],
1854 Field(
1855 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. '
1856 ),
1857 ] = None,
1858 rare_device: Annotated[
1859 Optional[StrictBool],
1860 Field(
1861 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/). '
1862 ),
1863 ] = None,
1864 rare_device_percentile_bucket: Annotated[
1865 Optional[SearchEventsRareDevicePercentileBucket],
1866 Field(
1867 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/). '
1868 ),
1869 ] = None,
1870 proxy: Annotated[
1871 Optional[StrictBool],
1872 Field(
1873 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. '
1874 ),
1875 ] = None,
1876 sdk_version: Annotated[
1877 Optional[StrictStr],
1878 Field(
1879 description='Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` '
1880 ),
1881 ] = None,
1882 sdk_platform: Annotated[
1883 Optional[SearchEventsSdkPlatform],
1884 Field(
1885 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. '
1886 ),
1887 ] = None,
1888 environment: Annotated[
1889 Optional[list[StrictStr]],
1890 Field(
1891 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. '
1892 ),
1893 ] = None,
1894 proximity_id: Annotated[
1895 Optional[StrictStr],
1896 Field(
1897 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. '
1898 ),
1899 ] = None,
1900 total_hits: Annotated[
1901 Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
1902 Field(
1903 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. '
1904 ),
1905 ] = None,
1906 tor_node: Annotated[
1907 Optional[StrictBool],
1908 Field(
1909 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. '
1910 ),
1911 ] = None,
1912 incremental_identification_status: Annotated[
1913 Optional[SearchEventsIncrementalIdentificationStatus],
1914 Field(
1915 description='Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. '
1916 ),
1917 ] = None,
1918 simulator: Annotated[
1919 Optional[StrictBool],
1920 Field(
1921 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. '
1922 ),
1923 ] = None,
1924 source: Annotated[
1925 Optional[Annotated[list[SearchEventsSource], Field(max_length=1)]],
1926 Field(
1927 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. '
1928 ),
1929 ] = None,
1930 active_call: Annotated[
1931 Optional[StrictBool],
1932 Field(
1933 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. '
1934 ),
1935 ] = None,
1936 _request_timeout: Union[
1937 None,
1938 Annotated[StrictFloat, Field(gt=0)],
1939 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1940 ] = None,
1941 _request_auth: Optional[dict[StrictStr, Any]] = None,
1942 _content_type: Optional[StrictStr] = None,
1943 _headers: Optional[dict[StrictStr, Any]] = None,
1944 ) -> RESTResponseType:
1945 """Search events
1947 ## 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.
1949 :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.
1950 :type limit: int
1951 :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`
1952 :type pagination_key: str
1953 :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).
1954 :type visitor_id: str
1955 :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).
1956 :type high_recall_id: str
1957 :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.
1958 :type bot: SearchEventsBot
1959 :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.
1960 :type bot_info: SearchEventsBotInfo
1961 :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.
1962 :type bot_info_category: List[BotInfoCategory]
1963 :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.
1964 :type bot_info_identity: List[BotInfoIdentity]
1965 :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.
1966 :type bot_info_confidence: List[BotInfoConfidence]
1967 :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.
1968 :type bot_info_provider: List[str]
1969 :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.
1970 :type bot_info_name: List[str]
1971 :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
1972 :type ip_address: str
1973 :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.
1974 :type asn: str
1975 :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.
1976 :type linked_id: str
1977 :param url: Filter events by the URL (`url` property) associated with the event.
1978 :type url: str
1979 :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event.
1980 :type bundle_id: str
1981 :param package_name: Filter events by the Package Name (Android) associated with the event.
1982 :type package_name: str
1983 :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com)
1984 :type origin: str
1985 :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.
1986 :type start: SearchEventsStartParameter
1987 :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.
1988 :type end: SearchEventsEndParameter
1989 :param reverse: When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order).
1990 :type reverse: bool
1991 :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.
1992 :type suspect: bool
1993 :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.
1994 :type vpn: bool
1995 :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.
1996 :type virtual_machine: bool
1997 :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.
1998 :type tampering: bool
1999 :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.
2000 :type anti_detect_browser: bool
2001 :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.
2002 :type incognito: bool
2003 :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.
2004 :type privacy_settings: bool
2005 :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.
2006 :type jailbroken: bool
2007 :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.
2008 :type frida: bool
2009 :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.
2010 :type factory_reset: bool
2011 :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.
2012 :type cloned_app: bool
2013 :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.
2014 :type emulator: bool
2015 :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.
2016 :type root_apps: bool
2017 :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.
2018 :type vpn_confidence: SearchEventsVpnConfidence
2019 :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.
2020 :type min_suspect_score: float
2021 :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.
2022 :type developer_tools: bool
2023 :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.
2024 :type location_spoofing: bool
2025 :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.
2026 :type mitm_attack: bool
2027 :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/).
2028 :type rare_device: bool
2029 :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/).
2030 :type rare_device_percentile_bucket: SearchEventsRareDevicePercentileBucket
2031 :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.
2032 :type proxy: bool
2033 :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14`
2034 :type sdk_version: str
2035 :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.
2036 :type sdk_platform: SearchEventsSdkPlatform
2037 :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.
2038 :type environment: List[str]
2039 :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.
2040 :type proximity_id: str
2041 :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.
2042 :type total_hits: int
2043 :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.
2044 :type tor_node: bool
2045 :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.
2046 :type incremental_identification_status: SearchEventsIncrementalIdentificationStatus
2047 :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.
2048 :type simulator: bool
2049 :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.
2050 :type source: List[SearchEventsSource]
2051 :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.
2052 :type active_call: bool
2053 :param _request_timeout: timeout setting for this request. If one
2054 number provided, it will be total request
2055 timeout. It can also be a pair (tuple) of
2056 (connection, read) timeouts.
2057 :type _request_timeout: int, tuple(int, int), optional
2058 :param _request_auth: set to override the auth_settings for an a single
2059 request; this effectively ignores the
2060 authentication in the spec for a single request.
2061 :type _request_auth: dict, optional
2062 :param _content_type: force content-type for the request.
2063 :type _content_type: str, Optional
2064 :param _headers: set to override the headers for a single
2065 request; this effectively ignores the headers
2066 in the spec for a single request.
2067 :type _headers: dict, optional
2068 :return: Returns the result object.
2069 """ # noqa: E501
2071 _param = self._search_events_serialize(
2072 limit=limit,
2073 pagination_key=pagination_key,
2074 visitor_id=visitor_id,
2075 high_recall_id=high_recall_id,
2076 bot=bot,
2077 bot_info=bot_info,
2078 bot_info_category=bot_info_category,
2079 bot_info_identity=bot_info_identity,
2080 bot_info_confidence=bot_info_confidence,
2081 bot_info_provider=bot_info_provider,
2082 bot_info_name=bot_info_name,
2083 ip_address=ip_address,
2084 asn=asn,
2085 linked_id=linked_id,
2086 url=url,
2087 bundle_id=bundle_id,
2088 package_name=package_name,
2089 origin=origin,
2090 start=start,
2091 end=end,
2092 reverse=reverse,
2093 suspect=suspect,
2094 vpn=vpn,
2095 virtual_machine=virtual_machine,
2096 tampering=tampering,
2097 anti_detect_browser=anti_detect_browser,
2098 incognito=incognito,
2099 privacy_settings=privacy_settings,
2100 jailbroken=jailbroken,
2101 frida=frida,
2102 factory_reset=factory_reset,
2103 cloned_app=cloned_app,
2104 emulator=emulator,
2105 root_apps=root_apps,
2106 vpn_confidence=vpn_confidence,
2107 min_suspect_score=min_suspect_score,
2108 developer_tools=developer_tools,
2109 location_spoofing=location_spoofing,
2110 mitm_attack=mitm_attack,
2111 rare_device=rare_device,
2112 rare_device_percentile_bucket=rare_device_percentile_bucket,
2113 proxy=proxy,
2114 sdk_version=sdk_version,
2115 sdk_platform=sdk_platform,
2116 environment=environment,
2117 proximity_id=proximity_id,
2118 total_hits=total_hits,
2119 tor_node=tor_node,
2120 incremental_identification_status=incremental_identification_status,
2121 simulator=simulator,
2122 source=source,
2123 active_call=active_call,
2124 _request_auth=_request_auth,
2125 _content_type=_content_type,
2126 _headers=_headers,
2127 )
2129 _response_types_map: dict[str, Optional[str]] = {
2130 '200': 'EventSearch',
2131 '400': 'ErrorResponse',
2132 '403': 'ErrorResponse',
2133 '404': 'ErrorResponse',
2134 '429': 'ErrorResponse',
2135 '500': 'ErrorResponse',
2136 '503': 'ErrorResponse',
2137 '504': 'ErrorResponse',
2138 }
2140 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2141 return response_data.response
2143 def _search_events_serialize(
2144 self,
2145 limit: Optional[int],
2146 pagination_key: Optional[str],
2147 visitor_id: Optional[str],
2148 high_recall_id: Optional[str],
2149 bot: Optional[SearchEventsBot],
2150 bot_info: Optional[SearchEventsBotInfo],
2151 bot_info_category: Optional[list[BotInfoCategory]],
2152 bot_info_identity: Optional[list[BotInfoIdentity]],
2153 bot_info_confidence: Optional[list[BotInfoConfidence]],
2154 bot_info_provider: Optional[list[str]],
2155 bot_info_name: Optional[list[str]],
2156 ip_address: Optional[str],
2157 asn: Optional[str],
2158 linked_id: Optional[str],
2159 url: Optional[str],
2160 bundle_id: Optional[str],
2161 package_name: Optional[str],
2162 origin: Optional[str],
2163 start: Optional[SearchEventsStartParameter],
2164 end: Optional[SearchEventsEndParameter],
2165 reverse: Optional[bool],
2166 suspect: Optional[bool],
2167 vpn: Optional[bool],
2168 virtual_machine: Optional[bool],
2169 tampering: Optional[bool],
2170 anti_detect_browser: Optional[bool],
2171 incognito: Optional[bool],
2172 privacy_settings: Optional[bool],
2173 jailbroken: Optional[bool],
2174 frida: Optional[bool],
2175 factory_reset: Optional[bool],
2176 cloned_app: Optional[bool],
2177 emulator: Optional[bool],
2178 root_apps: Optional[bool],
2179 vpn_confidence: Optional[SearchEventsVpnConfidence],
2180 min_suspect_score: Optional[float],
2181 developer_tools: Optional[bool],
2182 location_spoofing: Optional[bool],
2183 mitm_attack: Optional[bool],
2184 rare_device: Optional[bool],
2185 rare_device_percentile_bucket: Optional[SearchEventsRareDevicePercentileBucket],
2186 proxy: Optional[bool],
2187 sdk_version: Optional[str],
2188 sdk_platform: Optional[SearchEventsSdkPlatform],
2189 environment: Optional[list[str]],
2190 proximity_id: Optional[str],
2191 total_hits: Optional[int],
2192 tor_node: Optional[bool],
2193 incremental_identification_status: Optional[SearchEventsIncrementalIdentificationStatus],
2194 simulator: Optional[bool],
2195 source: Optional[list[SearchEventsSource]],
2196 active_call: Optional[bool],
2197 _request_auth: Optional[dict[StrictStr, Any]],
2198 _content_type: Optional[StrictStr],
2199 _headers: Optional[dict[StrictStr, Any]],
2200 ) -> RequestSerialized:
2202 _collection_formats: dict[str, str] = {
2203 'bot_info_category': 'multi',
2204 'bot_info_identity': 'multi',
2205 'bot_info_confidence': 'multi',
2206 'bot_info_provider': 'multi',
2207 'bot_info_name': 'multi',
2208 'environment': 'multi',
2209 'source': 'multi',
2210 }
2212 _path_params: dict[str, str] = {}
2213 _query_params: list[tuple[str, ParamValue]] = []
2214 _header_params: dict[str, Optional[str]] = _headers or {}
2215 _form_params: list[tuple[str, ParamValue]] = []
2216 _files: dict[
2217 str,
2218 Union[str, bytes, list[str], list[bytes], tuple[str, bytes], list[tuple[str, bytes]]],
2219 ] = {}
2220 _body_params: Optional[Any] = None
2222 # process the query parameters
2223 if limit is not None:
2224 _query_params.append(('limit', limit))
2226 # process the query parameters
2227 if pagination_key is not None:
2228 _query_params.append(('pagination_key', pagination_key))
2230 # process the query parameters
2231 if visitor_id is not None:
2232 _query_params.append(('visitor_id', visitor_id))
2234 # process the query parameters
2235 if high_recall_id is not None:
2236 _query_params.append(('high_recall_id', high_recall_id))
2238 # process the query parameters
2239 if bot is not None:
2240 _query_params.append(('bot', bot.value))
2242 # process the query parameters
2243 if bot_info is not None:
2244 _query_params.append(('bot_info', bot_info.value))
2246 # process the query parameters
2247 if bot_info_category is not None:
2248 _query_params.append(('bot_info_category', bot_info_category))
2250 # process the query parameters
2251 if bot_info_identity is not None:
2252 _query_params.append(('bot_info_identity', bot_info_identity))
2254 # process the query parameters
2255 if bot_info_confidence is not None:
2256 _query_params.append(('bot_info_confidence', bot_info_confidence))
2258 # process the query parameters
2259 if bot_info_provider is not None:
2260 _query_params.append(('bot_info_provider', bot_info_provider))
2262 # process the query parameters
2263 if bot_info_name is not None:
2264 _query_params.append(('bot_info_name', bot_info_name))
2266 # process the query parameters
2267 if ip_address is not None:
2268 _query_params.append(('ip_address', ip_address))
2270 # process the query parameters
2271 if asn is not None:
2272 _query_params.append(('asn', asn))
2274 # process the query parameters
2275 if linked_id is not None:
2276 _query_params.append(('linked_id', linked_id))
2278 # process the query parameters
2279 if url is not None:
2280 _query_params.append(('url', url))
2282 # process the query parameters
2283 if bundle_id is not None:
2284 _query_params.append(('bundle_id', bundle_id))
2286 # process the query parameters
2287 if package_name is not None:
2288 _query_params.append(('package_name', package_name))
2290 # process the query parameters
2291 if origin is not None:
2292 _query_params.append(('origin', origin))
2294 # process the query parameters
2295 if start is not None:
2296 if isinstance(start, datetime):
2297 _query_params.append(('start', start.isoformat(timespec='microseconds')))
2298 elif isinstance(start, date):
2299 _query_params.append(('start', start.isoformat()))
2300 else:
2301 _query_params.append(('start', start))
2302 # process the query parameters
2303 if end is not None:
2304 if isinstance(end, datetime):
2305 _query_params.append(('end', end.isoformat(timespec='microseconds')))
2306 elif isinstance(end, date):
2307 _query_params.append(('end', end.isoformat()))
2308 else:
2309 _query_params.append(('end', end))
2310 # process the query parameters
2311 if reverse is not None:
2312 _query_params.append(('reverse', reverse))
2314 # process the query parameters
2315 if suspect is not None:
2316 _query_params.append(('suspect', suspect))
2318 # process the query parameters
2319 if vpn is not None:
2320 _query_params.append(('vpn', vpn))
2322 # process the query parameters
2323 if virtual_machine is not None:
2324 _query_params.append(('virtual_machine', virtual_machine))
2326 # process the query parameters
2327 if tampering is not None:
2328 _query_params.append(('tampering', tampering))
2330 # process the query parameters
2331 if anti_detect_browser is not None:
2332 _query_params.append(('anti_detect_browser', anti_detect_browser))
2334 # process the query parameters
2335 if incognito is not None:
2336 _query_params.append(('incognito', incognito))
2338 # process the query parameters
2339 if privacy_settings is not None:
2340 _query_params.append(('privacy_settings', privacy_settings))
2342 # process the query parameters
2343 if jailbroken is not None:
2344 _query_params.append(('jailbroken', jailbroken))
2346 # process the query parameters
2347 if frida is not None:
2348 _query_params.append(('frida', frida))
2350 # process the query parameters
2351 if factory_reset is not None:
2352 _query_params.append(('factory_reset', factory_reset))
2354 # process the query parameters
2355 if cloned_app is not None:
2356 _query_params.append(('cloned_app', cloned_app))
2358 # process the query parameters
2359 if emulator is not None:
2360 _query_params.append(('emulator', emulator))
2362 # process the query parameters
2363 if root_apps is not None:
2364 _query_params.append(('root_apps', root_apps))
2366 # process the query parameters
2367 if vpn_confidence is not None:
2368 _query_params.append(('vpn_confidence', vpn_confidence.value))
2370 # process the query parameters
2371 if min_suspect_score is not None:
2372 _query_params.append(('min_suspect_score', min_suspect_score))
2374 # process the query parameters
2375 if developer_tools is not None:
2376 _query_params.append(('developer_tools', developer_tools))
2378 # process the query parameters
2379 if location_spoofing is not None:
2380 _query_params.append(('location_spoofing', location_spoofing))
2382 # process the query parameters
2383 if mitm_attack is not None:
2384 _query_params.append(('mitm_attack', mitm_attack))
2386 # process the query parameters
2387 if rare_device is not None:
2388 _query_params.append(('rare_device', rare_device))
2390 # process the query parameters
2391 if rare_device_percentile_bucket is not None:
2392 _query_params.append(
2393 ('rare_device_percentile_bucket', rare_device_percentile_bucket.value)
2394 )
2396 # process the query parameters
2397 if proxy is not None:
2398 _query_params.append(('proxy', proxy))
2400 # process the query parameters
2401 if sdk_version is not None:
2402 _query_params.append(('sdk_version', sdk_version))
2404 # process the query parameters
2405 if sdk_platform is not None:
2406 _query_params.append(('sdk_platform', sdk_platform.value))
2408 # process the query parameters
2409 if environment is not None:
2410 _query_params.append(('environment', environment))
2412 # process the query parameters
2413 if proximity_id is not None:
2414 _query_params.append(('proximity_id', proximity_id))
2416 # process the query parameters
2417 if total_hits is not None:
2418 _query_params.append(('total_hits', total_hits))
2420 # process the query parameters
2421 if tor_node is not None:
2422 _query_params.append(('tor_node', tor_node))
2424 # process the query parameters
2425 if incremental_identification_status is not None:
2426 _query_params.append(
2427 ('incremental_identification_status', incremental_identification_status.value)
2428 )
2430 # process the query parameters
2431 if simulator is not None:
2432 _query_params.append(('simulator', simulator))
2434 # process the query parameters
2435 if source is not None:
2436 _query_params.append(('source', source))
2438 # process the query parameters
2439 if active_call is not None:
2440 _query_params.append(('active_call', active_call))
2442 # set the HTTP header `Accept`
2443 if 'Accept' not in _header_params:
2444 _header_params['Accept'] = self.api_client.select_header_accept(['application/json'])
2446 # authentication setting
2447 _auth_settings: list[str] = ['bearerAuth']
2449 return self.api_client.param_serialize(
2450 method='GET',
2451 resource_path='/events',
2452 path_params=_path_params,
2453 query_params=_query_params,
2454 header_params=_header_params,
2455 body=_body_params,
2456 post_params=_form_params,
2457 files=_files,
2458 auth_settings=_auth_settings,
2459 collection_formats=_collection_formats,
2460 _request_auth=_request_auth,
2461 )
2463 @validate_call
2464 def update_event(
2465 self,
2466 event_id: Annotated[
2467 StrictStr,
2468 Field(
2469 description='The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id).'
2470 ),
2471 ],
2472 event_update: EventUpdate,
2473 _request_timeout: Union[
2474 None,
2475 Annotated[StrictFloat, Field(gt=0)],
2476 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2477 ] = None,
2478 _request_auth: Optional[dict[StrictStr, Any]] = None,
2479 _content_type: Optional[StrictStr] = None,
2480 _headers: Optional[dict[StrictStr, Any]] = None,
2481 ) -> None:
2482 """Update an event
2484 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** It's not possible to update events older than one month. **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.
2486 :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required)
2487 :type event_id: str
2488 :param event_update: (required)
2489 :type event_update: EventUpdate
2490 :param _request_timeout: timeout setting for this request. If one
2491 number provided, it will be total request
2492 timeout. It can also be a pair (tuple) of
2493 (connection, read) timeouts.
2494 :type _request_timeout: int, tuple(int, int), optional
2495 :param _request_auth: set to override the auth_settings for an a single
2496 request; this effectively ignores the
2497 authentication in the spec for a single request.
2498 :type _request_auth: dict, optional
2499 :param _content_type: force content-type for the request.
2500 :type _content_type: str, Optional
2501 :param _headers: set to override the headers for a single
2502 request; this effectively ignores the headers
2503 in the spec for a single request.
2504 :type _headers: dict, optional
2505 :return: Returns the result object.
2506 """ # noqa: E501
2508 _param = self._update_event_serialize(
2509 event_id=event_id,
2510 event_update=event_update,
2511 _request_auth=_request_auth,
2512 _content_type=_content_type,
2513 _headers=_headers,
2514 )
2516 _response_types_map: dict[str, Optional[str]] = {
2517 '200': None,
2518 '400': 'ErrorResponse',
2519 '403': 'ErrorResponse',
2520 '404': 'ErrorResponse',
2521 '409': 'ErrorResponse',
2522 }
2524 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2525 response_data.read()
2526 self.api_client.response_deserialize(
2527 response_data=response_data,
2528 response_types_map=_response_types_map,
2529 )
2531 @validate_call
2532 def update_event_with_http_info(
2533 self,
2534 event_id: Annotated[
2535 StrictStr,
2536 Field(
2537 description='The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id).'
2538 ),
2539 ],
2540 event_update: EventUpdate,
2541 _request_timeout: Union[
2542 None,
2543 Annotated[StrictFloat, Field(gt=0)],
2544 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2545 ] = None,
2546 _request_auth: Optional[dict[StrictStr, Any]] = None,
2547 _content_type: Optional[StrictStr] = None,
2548 _headers: Optional[dict[StrictStr, Any]] = None,
2549 ) -> ApiResponse[None]:
2550 """Update an event
2552 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** It's not possible to update events older than one month. **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.
2554 :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required)
2555 :type event_id: str
2556 :param event_update: (required)
2557 :type event_update: EventUpdate
2558 :param _request_timeout: timeout setting for this request. If one
2559 number provided, it will be total request
2560 timeout. It can also be a pair (tuple) of
2561 (connection, read) timeouts.
2562 :type _request_timeout: int, tuple(int, int), optional
2563 :param _request_auth: set to override the auth_settings for an a single
2564 request; this effectively ignores the
2565 authentication in the spec for a single request.
2566 :type _request_auth: dict, optional
2567 :param _content_type: force content-type for the request.
2568 :type _content_type: str, Optional
2569 :param _headers: set to override the headers for a single
2570 request; this effectively ignores the headers
2571 in the spec for a single request.
2572 :type _headers: dict, optional
2573 :return: Returns the result object.
2574 """ # noqa: E501
2576 _param = self._update_event_serialize(
2577 event_id=event_id,
2578 event_update=event_update,
2579 _request_auth=_request_auth,
2580 _content_type=_content_type,
2581 _headers=_headers,
2582 )
2584 _response_types_map: dict[str, Optional[str]] = {
2585 '200': None,
2586 '400': 'ErrorResponse',
2587 '403': 'ErrorResponse',
2588 '404': 'ErrorResponse',
2589 '409': 'ErrorResponse',
2590 }
2592 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2593 response_data.read()
2594 return self.api_client.response_deserialize(
2595 response_data=response_data,
2596 response_types_map=_response_types_map,
2597 )
2599 @validate_call
2600 def update_event_without_preload_content(
2601 self,
2602 event_id: Annotated[
2603 StrictStr,
2604 Field(
2605 description='The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id).'
2606 ),
2607 ],
2608 event_update: EventUpdate,
2609 _request_timeout: Union[
2610 None,
2611 Annotated[StrictFloat, Field(gt=0)],
2612 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2613 ] = None,
2614 _request_auth: Optional[dict[StrictStr, Any]] = None,
2615 _content_type: Optional[StrictStr] = None,
2616 _headers: Optional[dict[StrictStr, Any]] = None,
2617 ) -> RESTResponseType:
2618 """Update an event
2620 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** It's not possible to update events older than one month. **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.
2622 :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required)
2623 :type event_id: str
2624 :param event_update: (required)
2625 :type event_update: EventUpdate
2626 :param _request_timeout: timeout setting for this request. If one
2627 number provided, it will be total request
2628 timeout. It can also be a pair (tuple) of
2629 (connection, read) timeouts.
2630 :type _request_timeout: int, tuple(int, int), optional
2631 :param _request_auth: set to override the auth_settings for an a single
2632 request; this effectively ignores the
2633 authentication in the spec for a single request.
2634 :type _request_auth: dict, optional
2635 :param _content_type: force content-type for the request.
2636 :type _content_type: str, Optional
2637 :param _headers: set to override the headers for a single
2638 request; this effectively ignores the headers
2639 in the spec for a single request.
2640 :type _headers: dict, optional
2641 :return: Returns the result object.
2642 """ # noqa: E501
2644 _param = self._update_event_serialize(
2645 event_id=event_id,
2646 event_update=event_update,
2647 _request_auth=_request_auth,
2648 _content_type=_content_type,
2649 _headers=_headers,
2650 )
2652 _response_types_map: dict[str, Optional[str]] = {
2653 '200': None,
2654 '400': 'ErrorResponse',
2655 '403': 'ErrorResponse',
2656 '404': 'ErrorResponse',
2657 '409': 'ErrorResponse',
2658 }
2660 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2661 return response_data.response
2663 def _update_event_serialize(
2664 self,
2665 event_id: str,
2666 event_update: EventUpdate,
2667 _request_auth: Optional[dict[StrictStr, Any]],
2668 _content_type: Optional[StrictStr],
2669 _headers: Optional[dict[StrictStr, Any]],
2670 ) -> RequestSerialized:
2672 _collection_formats: dict[str, str] = {}
2674 _path_params: dict[str, str] = {}
2675 _query_params: list[tuple[str, ParamValue]] = []
2676 _header_params: dict[str, Optional[str]] = _headers or {}
2677 _form_params: list[tuple[str, ParamValue]] = []
2678 _files: dict[
2679 str,
2680 Union[str, bytes, list[str], list[bytes], tuple[str, bytes], list[tuple[str, bytes]]],
2681 ] = {}
2682 _body_params: Optional[Any] = None
2684 # process the path parameters
2685 if event_id is not None:
2686 _path_params['event_id'] = event_id
2688 # process the body parameter
2689 if event_update is not None:
2690 _body_params = event_update
2692 # set the HTTP header `Accept`
2693 if 'Accept' not in _header_params:
2694 _header_params['Accept'] = self.api_client.select_header_accept(['application/json'])
2696 # set the HTTP header `Content-Type`
2697 if _content_type:
2698 _header_params['Content-Type'] = _content_type
2699 else:
2700 _default_content_type = self.api_client.select_header_content_type(
2701 ['application/json']
2702 )
2703 if _default_content_type is not None:
2704 _header_params['Content-Type'] = _default_content_type
2706 # authentication setting
2707 _auth_settings: list[str] = ['bearerAuth']
2709 return self.api_client.param_serialize(
2710 method='PATCH',
2711 resource_path='/events/{event_id}',
2712 path_params=_path_params,
2713 query_params=_query_params,
2714 header_params=_header_params,
2715 body=_body_params,
2716 post_params=_form_params,
2717 files=_files,
2718 auth_settings=_auth_settings,
2719 collection_formats=_collection_formats,
2720 _request_auth=_request_auth,
2721 )