Coverage for fingerprint_server_sdk/api/fingerprint_api.py: 84%
281 statements
« prev ^ index » next coverage.py v7.14.3, created at 2026-09-25 15:12 +0000
« prev ^ index » next coverage.py v7.14.3, created at 2026-09-25 15:12 +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 '504': 'ErrorResponse',
367 }
369 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
370 response_data.read()
371 return self.api_client.response_deserialize(
372 response_data=response_data,
373 response_types_map=_response_types_map,
374 ).data
376 @validate_call
377 def get_event_with_http_info(
378 self,
379 event_id: Annotated[
380 StrictStr,
381 Field(
382 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).'
383 ),
384 ],
385 ruleset_id: Annotated[
386 Optional[StrictStr],
387 Field(
388 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. '
389 ),
390 ] = None,
391 _request_timeout: Union[
392 None,
393 Annotated[StrictFloat, Field(gt=0)],
394 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
395 ] = None,
396 _request_auth: Optional[dict[StrictStr, Any]] = None,
397 _content_type: Optional[StrictStr] = None,
398 _headers: Optional[dict[StrictStr, Any]] = None,
399 ) -> ApiResponse[Event]:
400 """Get an event by event ID
402 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`.
404 :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)
405 :type event_id: str
406 :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.
407 :type ruleset_id: str
408 :param _request_timeout: timeout setting for this request. If one
409 number provided, it will be total request
410 timeout. It can also be a pair (tuple) of
411 (connection, read) timeouts.
412 :type _request_timeout: int, tuple(int, int), optional
413 :param _request_auth: set to override the auth_settings for an a single
414 request; this effectively ignores the
415 authentication in the spec for a single request.
416 :type _request_auth: dict, optional
417 :param _content_type: force content-type for the request.
418 :type _content_type: str, Optional
419 :param _headers: set to override the headers for a single
420 request; this effectively ignores the headers
421 in the spec for a single request.
422 :type _headers: dict, optional
423 :return: Returns the result object.
424 """ # noqa: E501
426 _param = self._get_event_serialize(
427 event_id=event_id,
428 ruleset_id=ruleset_id,
429 _request_auth=_request_auth,
430 _content_type=_content_type,
431 _headers=_headers,
432 )
434 _response_types_map: dict[str, Optional[str]] = {
435 '200': 'Event',
436 '400': 'ErrorResponse',
437 '403': 'ErrorResponse',
438 '404': 'ErrorResponse',
439 '429': 'ErrorResponse',
440 '500': 'ErrorResponse',
441 '504': 'ErrorResponse',
442 }
444 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
445 response_data.read()
446 return self.api_client.response_deserialize(
447 response_data=response_data,
448 response_types_map=_response_types_map,
449 )
451 @validate_call
452 def get_event_without_preload_content(
453 self,
454 event_id: Annotated[
455 StrictStr,
456 Field(
457 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).'
458 ),
459 ],
460 ruleset_id: Annotated[
461 Optional[StrictStr],
462 Field(
463 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. '
464 ),
465 ] = None,
466 _request_timeout: Union[
467 None,
468 Annotated[StrictFloat, Field(gt=0)],
469 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
470 ] = None,
471 _request_auth: Optional[dict[StrictStr, Any]] = None,
472 _content_type: Optional[StrictStr] = None,
473 _headers: Optional[dict[StrictStr, Any]] = None,
474 ) -> RESTResponseType:
475 """Get an event by event ID
477 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`.
479 :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)
480 :type event_id: str
481 :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.
482 :type ruleset_id: str
483 :param _request_timeout: timeout setting for this request. If one
484 number provided, it will be total request
485 timeout. It can also be a pair (tuple) of
486 (connection, read) timeouts.
487 :type _request_timeout: int, tuple(int, int), optional
488 :param _request_auth: set to override the auth_settings for an a single
489 request; this effectively ignores the
490 authentication in the spec for a single request.
491 :type _request_auth: dict, optional
492 :param _content_type: force content-type for the request.
493 :type _content_type: str, Optional
494 :param _headers: set to override the headers for a single
495 request; this effectively ignores the headers
496 in the spec for a single request.
497 :type _headers: dict, optional
498 :return: Returns the result object.
499 """ # noqa: E501
501 _param = self._get_event_serialize(
502 event_id=event_id,
503 ruleset_id=ruleset_id,
504 _request_auth=_request_auth,
505 _content_type=_content_type,
506 _headers=_headers,
507 )
509 _response_types_map: dict[str, Optional[str]] = {
510 '200': 'Event',
511 '400': 'ErrorResponse',
512 '403': 'ErrorResponse',
513 '404': 'ErrorResponse',
514 '429': 'ErrorResponse',
515 '500': 'ErrorResponse',
516 '504': 'ErrorResponse',
517 }
519 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
520 return response_data.response
522 def _get_event_serialize(
523 self,
524 event_id: str,
525 ruleset_id: Optional[str],
526 _request_auth: Optional[dict[StrictStr, Any]],
527 _content_type: Optional[StrictStr],
528 _headers: Optional[dict[StrictStr, Any]],
529 ) -> RequestSerialized:
531 _collection_formats: dict[str, str] = {}
533 _path_params: dict[str, str] = {}
534 _query_params: list[tuple[str, ParamValue]] = []
535 _header_params: dict[str, Optional[str]] = _headers or {}
536 _form_params: list[tuple[str, ParamValue]] = []
537 _files: dict[
538 str,
539 Union[str, bytes, list[str], list[bytes], tuple[str, bytes], list[tuple[str, bytes]]],
540 ] = {}
541 _body_params: Optional[Any] = None
543 # process the path parameters
544 if event_id is not None:
545 _path_params['event_id'] = event_id
547 # process the query parameters
548 if ruleset_id is not None:
549 _query_params.append(('ruleset_id', ruleset_id))
551 # set the HTTP header `Accept`
552 if 'Accept' not in _header_params:
553 _header_params['Accept'] = self.api_client.select_header_accept(['application/json'])
555 # authentication setting
556 _auth_settings: list[str] = ['bearerAuth']
558 return self.api_client.param_serialize(
559 method='GET',
560 resource_path='/events/{event_id}',
561 path_params=_path_params,
562 query_params=_query_params,
563 header_params=_header_params,
564 body=_body_params,
565 post_params=_form_params,
566 files=_files,
567 auth_settings=_auth_settings,
568 collection_formats=_collection_formats,
569 _request_auth=_request_auth,
570 )
572 @validate_call
573 def search_events(
574 self,
575 limit: Annotated[
576 Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
577 Field(
578 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. '
579 ),
580 ] = None,
581 pagination_key: Annotated[
582 Optional[StrictStr],
583 Field(
584 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` '
585 ),
586 ] = None,
587 visitor_id: Annotated[
588 Optional[StrictStr],
589 Field(
590 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). '
591 ),
592 ] = None,
593 high_recall_id: Annotated[
594 Optional[StrictStr],
595 Field(
596 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). '
597 ),
598 ] = None,
599 bot: Annotated[
600 Optional[SearchEventsBot],
601 Field(
602 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. '
603 ),
604 ] = None,
605 bot_info: Annotated[
606 Optional[SearchEventsBotInfo],
607 Field(
608 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. '
609 ),
610 ] = None,
611 bot_info_category: Annotated[
612 Optional[list[BotInfoCategory]],
613 Field(
614 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. '
615 ),
616 ] = None,
617 bot_info_identity: Annotated[
618 Optional[list[BotInfoIdentity]],
619 Field(
620 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. '
621 ),
622 ] = None,
623 bot_info_confidence: Annotated[
624 Optional[list[BotInfoConfidence]],
625 Field(
626 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. '
627 ),
628 ] = None,
629 bot_info_provider: Annotated[
630 Optional[list[StrictStr]],
631 Field(
632 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. '
633 ),
634 ] = None,
635 bot_info_name: Annotated[
636 Optional[list[StrictStr]],
637 Field(
638 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. '
639 ),
640 ] = None,
641 ip_address: Annotated[
642 Optional[StrictStr],
643 Field(
644 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 '
645 ),
646 ] = None,
647 asn: Annotated[
648 Optional[StrictStr],
649 Field(
650 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. "
651 ),
652 ] = None,
653 linked_id: Annotated[
654 Optional[StrictStr],
655 Field(
656 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. '
657 ),
658 ] = None,
659 url: Annotated[
660 Optional[StrictStr],
661 Field(
662 description='Filter events by the URL (`url` property) associated with the event. '
663 ),
664 ] = None,
665 bundle_id: Annotated[
666 Optional[StrictStr],
667 Field(description='Filter events by the Bundle ID (iOS) associated with the event. '),
668 ] = None,
669 package_name: Annotated[
670 Optional[StrictStr],
671 Field(
672 description='Filter events by the Package Name (Android) associated with the event. '
673 ),
674 ] = None,
675 origin: Annotated[
676 Optional[StrictStr],
677 Field(
678 description='Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) '
679 ),
680 ] = None,
681 start: Annotated[
682 Optional[SearchEventsStartParameter],
683 Field(
684 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. ',
685 ),
686 ] = None,
687 end: Annotated[
688 Optional[SearchEventsEndParameter],
689 Field(
690 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. ',
691 ),
692 ] = None,
693 reverse: Annotated[
694 Optional[StrictBool],
695 Field(
696 description='When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order). '
697 ),
698 ] = None,
699 suspect: Annotated[
700 Optional[StrictBool],
701 Field(
702 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. '
703 ),
704 ] = None,
705 vpn: Annotated[
706 Optional[StrictBool],
707 Field(
708 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. '
709 ),
710 ] = None,
711 virtual_machine: Annotated[
712 Optional[StrictBool],
713 Field(
714 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. '
715 ),
716 ] = None,
717 tampering: Annotated[
718 Optional[StrictBool],
719 Field(
720 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. '
721 ),
722 ] = None,
723 anti_detect_browser: Annotated[
724 Optional[StrictBool],
725 Field(
726 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. '
727 ),
728 ] = None,
729 incognito: Annotated[
730 Optional[StrictBool],
731 Field(
732 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. '
733 ),
734 ] = None,
735 privacy_settings: Annotated[
736 Optional[StrictBool],
737 Field(
738 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. '
739 ),
740 ] = None,
741 jailbroken: Annotated[
742 Optional[StrictBool],
743 Field(
744 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. '
745 ),
746 ] = None,
747 frida: Annotated[
748 Optional[StrictBool],
749 Field(
750 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. '
751 ),
752 ] = None,
753 factory_reset: Annotated[
754 Optional[StrictBool],
755 Field(
756 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. '
757 ),
758 ] = None,
759 cloned_app: Annotated[
760 Optional[StrictBool],
761 Field(
762 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. '
763 ),
764 ] = None,
765 emulator: Annotated[
766 Optional[StrictBool],
767 Field(
768 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. '
769 ),
770 ] = None,
771 root_apps: Annotated[
772 Optional[StrictBool],
773 Field(
774 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. '
775 ),
776 ] = None,
777 vpn_confidence: Annotated[
778 Optional[SearchEventsVpnConfidence],
779 Field(
780 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. '
781 ),
782 ] = None,
783 min_suspect_score: Annotated[
784 Optional[Union[StrictFloat, StrictInt]],
785 Field(
786 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. '
787 ),
788 ] = None,
789 developer_tools: Annotated[
790 Optional[StrictBool],
791 Field(
792 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. '
793 ),
794 ] = None,
795 location_spoofing: Annotated[
796 Optional[StrictBool],
797 Field(
798 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. '
799 ),
800 ] = None,
801 mitm_attack: Annotated[
802 Optional[StrictBool],
803 Field(
804 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. '
805 ),
806 ] = None,
807 rare_device: Annotated[
808 Optional[StrictBool],
809 Field(
810 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/). '
811 ),
812 ] = None,
813 rare_device_percentile_bucket: Annotated[
814 Optional[SearchEventsRareDevicePercentileBucket],
815 Field(
816 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/). '
817 ),
818 ] = None,
819 proxy: Annotated[
820 Optional[StrictBool],
821 Field(
822 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. '
823 ),
824 ] = None,
825 sdk_version: Annotated[
826 Optional[StrictStr],
827 Field(
828 description='Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` '
829 ),
830 ] = None,
831 sdk_platform: Annotated[
832 Optional[SearchEventsSdkPlatform],
833 Field(
834 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. '
835 ),
836 ] = None,
837 environment: Annotated[
838 Optional[list[StrictStr]],
839 Field(
840 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. '
841 ),
842 ] = None,
843 proximity_id: Annotated[
844 Optional[StrictStr],
845 Field(
846 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. '
847 ),
848 ] = None,
849 total_hits: Annotated[
850 Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
851 Field(
852 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. '
853 ),
854 ] = None,
855 tor_node: Annotated[
856 Optional[StrictBool],
857 Field(
858 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. '
859 ),
860 ] = None,
861 incremental_identification_status: Annotated[
862 Optional[SearchEventsIncrementalIdentificationStatus],
863 Field(
864 description='Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. '
865 ),
866 ] = None,
867 simulator: Annotated[
868 Optional[StrictBool],
869 Field(
870 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. '
871 ),
872 ] = None,
873 source: Annotated[
874 Optional[Annotated[list[SearchEventsSource], Field(max_length=1)]],
875 Field(
876 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. '
877 ),
878 ] = None,
879 active_call: Annotated[
880 Optional[StrictBool],
881 Field(
882 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. '
883 ),
884 ] = None,
885 _request_timeout: Union[
886 None,
887 Annotated[StrictFloat, Field(gt=0)],
888 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
889 ] = None,
890 _request_auth: Optional[dict[StrictStr, Any]] = None,
891 _content_type: Optional[StrictStr] = None,
892 _headers: Optional[dict[StrictStr, Any]] = None,
893 ) -> EventSearch:
894 """Search events
896 ## 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.
898 :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.
899 :type limit: int
900 :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`
901 :type pagination_key: str
902 :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).
903 :type visitor_id: str
904 :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).
905 :type high_recall_id: str
906 :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.
907 :type bot: SearchEventsBot
908 :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.
909 :type bot_info: SearchEventsBotInfo
910 :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.
911 :type bot_info_category: List[BotInfoCategory]
912 :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.
913 :type bot_info_identity: List[BotInfoIdentity]
914 :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.
915 :type bot_info_confidence: List[BotInfoConfidence]
916 :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.
917 :type bot_info_provider: List[str]
918 :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.
919 :type bot_info_name: List[str]
920 :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
921 :type ip_address: str
922 :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.
923 :type asn: str
924 :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.
925 :type linked_id: str
926 :param url: Filter events by the URL (`url` property) associated with the event.
927 :type url: str
928 :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event.
929 :type bundle_id: str
930 :param package_name: Filter events by the Package Name (Android) associated with the event.
931 :type package_name: str
932 :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com)
933 :type origin: str
934 :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.
935 :type start: SearchEventsStartParameter
936 :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.
937 :type end: SearchEventsEndParameter
938 :param reverse: When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order).
939 :type reverse: bool
940 :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.
941 :type suspect: bool
942 :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.
943 :type vpn: bool
944 :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.
945 :type virtual_machine: bool
946 :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.
947 :type tampering: bool
948 :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.
949 :type anti_detect_browser: bool
950 :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.
951 :type incognito: bool
952 :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.
953 :type privacy_settings: bool
954 :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.
955 :type jailbroken: bool
956 :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.
957 :type frida: bool
958 :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.
959 :type factory_reset: bool
960 :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.
961 :type cloned_app: bool
962 :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.
963 :type emulator: bool
964 :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.
965 :type root_apps: bool
966 :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.
967 :type vpn_confidence: SearchEventsVpnConfidence
968 :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.
969 :type min_suspect_score: float
970 :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.
971 :type developer_tools: bool
972 :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.
973 :type location_spoofing: bool
974 :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.
975 :type mitm_attack: bool
976 :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/).
977 :type rare_device: bool
978 :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/).
979 :type rare_device_percentile_bucket: SearchEventsRareDevicePercentileBucket
980 :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.
981 :type proxy: bool
982 :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14`
983 :type sdk_version: str
984 :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.
985 :type sdk_platform: SearchEventsSdkPlatform
986 :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.
987 :type environment: List[str]
988 :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.
989 :type proximity_id: str
990 :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.
991 :type total_hits: int
992 :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.
993 :type tor_node: bool
994 :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.
995 :type incremental_identification_status: SearchEventsIncrementalIdentificationStatus
996 :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.
997 :type simulator: bool
998 :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.
999 :type source: List[SearchEventsSource]
1000 :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.
1001 :type active_call: bool
1002 :param _request_timeout: timeout setting for this request. If one
1003 number provided, it will be total request
1004 timeout. It can also be a pair (tuple) of
1005 (connection, read) timeouts.
1006 :type _request_timeout: int, tuple(int, int), optional
1007 :param _request_auth: set to override the auth_settings for an a single
1008 request; this effectively ignores the
1009 authentication in the spec for a single request.
1010 :type _request_auth: dict, optional
1011 :param _content_type: force content-type for the request.
1012 :type _content_type: str, Optional
1013 :param _headers: set to override the headers for a single
1014 request; this effectively ignores the headers
1015 in the spec for a single request.
1016 :type _headers: dict, optional
1017 :return: Returns the result object.
1018 """ # noqa: E501
1020 _param = self._search_events_serialize(
1021 limit=limit,
1022 pagination_key=pagination_key,
1023 visitor_id=visitor_id,
1024 high_recall_id=high_recall_id,
1025 bot=bot,
1026 bot_info=bot_info,
1027 bot_info_category=bot_info_category,
1028 bot_info_identity=bot_info_identity,
1029 bot_info_confidence=bot_info_confidence,
1030 bot_info_provider=bot_info_provider,
1031 bot_info_name=bot_info_name,
1032 ip_address=ip_address,
1033 asn=asn,
1034 linked_id=linked_id,
1035 url=url,
1036 bundle_id=bundle_id,
1037 package_name=package_name,
1038 origin=origin,
1039 start=start,
1040 end=end,
1041 reverse=reverse,
1042 suspect=suspect,
1043 vpn=vpn,
1044 virtual_machine=virtual_machine,
1045 tampering=tampering,
1046 anti_detect_browser=anti_detect_browser,
1047 incognito=incognito,
1048 privacy_settings=privacy_settings,
1049 jailbroken=jailbroken,
1050 frida=frida,
1051 factory_reset=factory_reset,
1052 cloned_app=cloned_app,
1053 emulator=emulator,
1054 root_apps=root_apps,
1055 vpn_confidence=vpn_confidence,
1056 min_suspect_score=min_suspect_score,
1057 developer_tools=developer_tools,
1058 location_spoofing=location_spoofing,
1059 mitm_attack=mitm_attack,
1060 rare_device=rare_device,
1061 rare_device_percentile_bucket=rare_device_percentile_bucket,
1062 proxy=proxy,
1063 sdk_version=sdk_version,
1064 sdk_platform=sdk_platform,
1065 environment=environment,
1066 proximity_id=proximity_id,
1067 total_hits=total_hits,
1068 tor_node=tor_node,
1069 incremental_identification_status=incremental_identification_status,
1070 simulator=simulator,
1071 source=source,
1072 active_call=active_call,
1073 _request_auth=_request_auth,
1074 _content_type=_content_type,
1075 _headers=_headers,
1076 )
1078 _response_types_map: dict[str, Optional[str]] = {
1079 '200': 'EventSearch',
1080 '400': 'ErrorResponse',
1081 '403': 'ErrorResponse',
1082 '404': 'ErrorResponse',
1083 '429': 'ErrorResponse',
1084 '500': 'ErrorResponse',
1085 '504': 'ErrorResponse',
1086 }
1088 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1089 response_data.read()
1090 return self.api_client.response_deserialize(
1091 response_data=response_data,
1092 response_types_map=_response_types_map,
1093 ).data
1095 @validate_call
1096 def search_events_with_http_info(
1097 self,
1098 limit: Annotated[
1099 Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
1100 Field(
1101 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. '
1102 ),
1103 ] = None,
1104 pagination_key: Annotated[
1105 Optional[StrictStr],
1106 Field(
1107 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` '
1108 ),
1109 ] = None,
1110 visitor_id: Annotated[
1111 Optional[StrictStr],
1112 Field(
1113 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). '
1114 ),
1115 ] = None,
1116 high_recall_id: Annotated[
1117 Optional[StrictStr],
1118 Field(
1119 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). '
1120 ),
1121 ] = None,
1122 bot: Annotated[
1123 Optional[SearchEventsBot],
1124 Field(
1125 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. '
1126 ),
1127 ] = None,
1128 bot_info: Annotated[
1129 Optional[SearchEventsBotInfo],
1130 Field(
1131 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. '
1132 ),
1133 ] = None,
1134 bot_info_category: Annotated[
1135 Optional[list[BotInfoCategory]],
1136 Field(
1137 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. '
1138 ),
1139 ] = None,
1140 bot_info_identity: Annotated[
1141 Optional[list[BotInfoIdentity]],
1142 Field(
1143 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. '
1144 ),
1145 ] = None,
1146 bot_info_confidence: Annotated[
1147 Optional[list[BotInfoConfidence]],
1148 Field(
1149 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. '
1150 ),
1151 ] = None,
1152 bot_info_provider: Annotated[
1153 Optional[list[StrictStr]],
1154 Field(
1155 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. '
1156 ),
1157 ] = None,
1158 bot_info_name: Annotated[
1159 Optional[list[StrictStr]],
1160 Field(
1161 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. '
1162 ),
1163 ] = None,
1164 ip_address: Annotated[
1165 Optional[StrictStr],
1166 Field(
1167 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 '
1168 ),
1169 ] = None,
1170 asn: Annotated[
1171 Optional[StrictStr],
1172 Field(
1173 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. "
1174 ),
1175 ] = None,
1176 linked_id: Annotated[
1177 Optional[StrictStr],
1178 Field(
1179 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. '
1180 ),
1181 ] = None,
1182 url: Annotated[
1183 Optional[StrictStr],
1184 Field(
1185 description='Filter events by the URL (`url` property) associated with the event. '
1186 ),
1187 ] = None,
1188 bundle_id: Annotated[
1189 Optional[StrictStr],
1190 Field(description='Filter events by the Bundle ID (iOS) associated with the event. '),
1191 ] = None,
1192 package_name: Annotated[
1193 Optional[StrictStr],
1194 Field(
1195 description='Filter events by the Package Name (Android) associated with the event. '
1196 ),
1197 ] = None,
1198 origin: Annotated[
1199 Optional[StrictStr],
1200 Field(
1201 description='Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) '
1202 ),
1203 ] = None,
1204 start: Annotated[
1205 Optional[SearchEventsStartParameter],
1206 Field(
1207 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. ',
1208 ),
1209 ] = None,
1210 end: Annotated[
1211 Optional[SearchEventsEndParameter],
1212 Field(
1213 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. ',
1214 ),
1215 ] = None,
1216 reverse: Annotated[
1217 Optional[StrictBool],
1218 Field(
1219 description='When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order). '
1220 ),
1221 ] = None,
1222 suspect: Annotated[
1223 Optional[StrictBool],
1224 Field(
1225 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. '
1226 ),
1227 ] = None,
1228 vpn: Annotated[
1229 Optional[StrictBool],
1230 Field(
1231 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. '
1232 ),
1233 ] = None,
1234 virtual_machine: Annotated[
1235 Optional[StrictBool],
1236 Field(
1237 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. '
1238 ),
1239 ] = None,
1240 tampering: Annotated[
1241 Optional[StrictBool],
1242 Field(
1243 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. '
1244 ),
1245 ] = None,
1246 anti_detect_browser: Annotated[
1247 Optional[StrictBool],
1248 Field(
1249 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. '
1250 ),
1251 ] = None,
1252 incognito: Annotated[
1253 Optional[StrictBool],
1254 Field(
1255 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. '
1256 ),
1257 ] = None,
1258 privacy_settings: Annotated[
1259 Optional[StrictBool],
1260 Field(
1261 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. '
1262 ),
1263 ] = None,
1264 jailbroken: Annotated[
1265 Optional[StrictBool],
1266 Field(
1267 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. '
1268 ),
1269 ] = None,
1270 frida: Annotated[
1271 Optional[StrictBool],
1272 Field(
1273 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. '
1274 ),
1275 ] = None,
1276 factory_reset: Annotated[
1277 Optional[StrictBool],
1278 Field(
1279 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. '
1280 ),
1281 ] = None,
1282 cloned_app: Annotated[
1283 Optional[StrictBool],
1284 Field(
1285 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. '
1286 ),
1287 ] = None,
1288 emulator: Annotated[
1289 Optional[StrictBool],
1290 Field(
1291 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. '
1292 ),
1293 ] = None,
1294 root_apps: Annotated[
1295 Optional[StrictBool],
1296 Field(
1297 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. '
1298 ),
1299 ] = None,
1300 vpn_confidence: Annotated[
1301 Optional[SearchEventsVpnConfidence],
1302 Field(
1303 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. '
1304 ),
1305 ] = None,
1306 min_suspect_score: Annotated[
1307 Optional[Union[StrictFloat, StrictInt]],
1308 Field(
1309 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. '
1310 ),
1311 ] = None,
1312 developer_tools: Annotated[
1313 Optional[StrictBool],
1314 Field(
1315 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. '
1316 ),
1317 ] = None,
1318 location_spoofing: Annotated[
1319 Optional[StrictBool],
1320 Field(
1321 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. '
1322 ),
1323 ] = None,
1324 mitm_attack: Annotated[
1325 Optional[StrictBool],
1326 Field(
1327 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. '
1328 ),
1329 ] = None,
1330 rare_device: Annotated[
1331 Optional[StrictBool],
1332 Field(
1333 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/). '
1334 ),
1335 ] = None,
1336 rare_device_percentile_bucket: Annotated[
1337 Optional[SearchEventsRareDevicePercentileBucket],
1338 Field(
1339 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/). '
1340 ),
1341 ] = None,
1342 proxy: Annotated[
1343 Optional[StrictBool],
1344 Field(
1345 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. '
1346 ),
1347 ] = None,
1348 sdk_version: Annotated[
1349 Optional[StrictStr],
1350 Field(
1351 description='Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` '
1352 ),
1353 ] = None,
1354 sdk_platform: Annotated[
1355 Optional[SearchEventsSdkPlatform],
1356 Field(
1357 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. '
1358 ),
1359 ] = None,
1360 environment: Annotated[
1361 Optional[list[StrictStr]],
1362 Field(
1363 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. '
1364 ),
1365 ] = None,
1366 proximity_id: Annotated[
1367 Optional[StrictStr],
1368 Field(
1369 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. '
1370 ),
1371 ] = None,
1372 total_hits: Annotated[
1373 Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
1374 Field(
1375 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. '
1376 ),
1377 ] = None,
1378 tor_node: Annotated[
1379 Optional[StrictBool],
1380 Field(
1381 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. '
1382 ),
1383 ] = None,
1384 incremental_identification_status: Annotated[
1385 Optional[SearchEventsIncrementalIdentificationStatus],
1386 Field(
1387 description='Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. '
1388 ),
1389 ] = None,
1390 simulator: Annotated[
1391 Optional[StrictBool],
1392 Field(
1393 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. '
1394 ),
1395 ] = None,
1396 source: Annotated[
1397 Optional[Annotated[list[SearchEventsSource], Field(max_length=1)]],
1398 Field(
1399 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. '
1400 ),
1401 ] = None,
1402 active_call: Annotated[
1403 Optional[StrictBool],
1404 Field(
1405 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. '
1406 ),
1407 ] = None,
1408 _request_timeout: Union[
1409 None,
1410 Annotated[StrictFloat, Field(gt=0)],
1411 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1412 ] = None,
1413 _request_auth: Optional[dict[StrictStr, Any]] = None,
1414 _content_type: Optional[StrictStr] = None,
1415 _headers: Optional[dict[StrictStr, Any]] = None,
1416 ) -> ApiResponse[EventSearch]:
1417 """Search events
1419 ## 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.
1421 :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.
1422 :type limit: int
1423 :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`
1424 :type pagination_key: str
1425 :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).
1426 :type visitor_id: str
1427 :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).
1428 :type high_recall_id: str
1429 :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.
1430 :type bot: SearchEventsBot
1431 :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.
1432 :type bot_info: SearchEventsBotInfo
1433 :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.
1434 :type bot_info_category: List[BotInfoCategory]
1435 :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.
1436 :type bot_info_identity: List[BotInfoIdentity]
1437 :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.
1438 :type bot_info_confidence: List[BotInfoConfidence]
1439 :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.
1440 :type bot_info_provider: List[str]
1441 :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.
1442 :type bot_info_name: List[str]
1443 :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
1444 :type ip_address: str
1445 :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.
1446 :type asn: str
1447 :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.
1448 :type linked_id: str
1449 :param url: Filter events by the URL (`url` property) associated with the event.
1450 :type url: str
1451 :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event.
1452 :type bundle_id: str
1453 :param package_name: Filter events by the Package Name (Android) associated with the event.
1454 :type package_name: str
1455 :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com)
1456 :type origin: str
1457 :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.
1458 :type start: SearchEventsStartParameter
1459 :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.
1460 :type end: SearchEventsEndParameter
1461 :param reverse: When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order).
1462 :type reverse: bool
1463 :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.
1464 :type suspect: bool
1465 :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.
1466 :type vpn: bool
1467 :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.
1468 :type virtual_machine: bool
1469 :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.
1470 :type tampering: bool
1471 :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.
1472 :type anti_detect_browser: bool
1473 :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.
1474 :type incognito: bool
1475 :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.
1476 :type privacy_settings: bool
1477 :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.
1478 :type jailbroken: bool
1479 :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.
1480 :type frida: bool
1481 :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.
1482 :type factory_reset: bool
1483 :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.
1484 :type cloned_app: bool
1485 :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.
1486 :type emulator: bool
1487 :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.
1488 :type root_apps: bool
1489 :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.
1490 :type vpn_confidence: SearchEventsVpnConfidence
1491 :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.
1492 :type min_suspect_score: float
1493 :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.
1494 :type developer_tools: bool
1495 :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.
1496 :type location_spoofing: bool
1497 :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.
1498 :type mitm_attack: bool
1499 :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/).
1500 :type rare_device: bool
1501 :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/).
1502 :type rare_device_percentile_bucket: SearchEventsRareDevicePercentileBucket
1503 :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.
1504 :type proxy: bool
1505 :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14`
1506 :type sdk_version: str
1507 :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.
1508 :type sdk_platform: SearchEventsSdkPlatform
1509 :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.
1510 :type environment: List[str]
1511 :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.
1512 :type proximity_id: str
1513 :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.
1514 :type total_hits: int
1515 :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.
1516 :type tor_node: bool
1517 :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.
1518 :type incremental_identification_status: SearchEventsIncrementalIdentificationStatus
1519 :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.
1520 :type simulator: bool
1521 :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.
1522 :type source: List[SearchEventsSource]
1523 :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.
1524 :type active_call: bool
1525 :param _request_timeout: timeout setting for this request. If one
1526 number provided, it will be total request
1527 timeout. It can also be a pair (tuple) of
1528 (connection, read) timeouts.
1529 :type _request_timeout: int, tuple(int, int), optional
1530 :param _request_auth: set to override the auth_settings for an a single
1531 request; this effectively ignores the
1532 authentication in the spec for a single request.
1533 :type _request_auth: dict, optional
1534 :param _content_type: force content-type for the request.
1535 :type _content_type: str, Optional
1536 :param _headers: set to override the headers for a single
1537 request; this effectively ignores the headers
1538 in the spec for a single request.
1539 :type _headers: dict, optional
1540 :return: Returns the result object.
1541 """ # noqa: E501
1543 _param = self._search_events_serialize(
1544 limit=limit,
1545 pagination_key=pagination_key,
1546 visitor_id=visitor_id,
1547 high_recall_id=high_recall_id,
1548 bot=bot,
1549 bot_info=bot_info,
1550 bot_info_category=bot_info_category,
1551 bot_info_identity=bot_info_identity,
1552 bot_info_confidence=bot_info_confidence,
1553 bot_info_provider=bot_info_provider,
1554 bot_info_name=bot_info_name,
1555 ip_address=ip_address,
1556 asn=asn,
1557 linked_id=linked_id,
1558 url=url,
1559 bundle_id=bundle_id,
1560 package_name=package_name,
1561 origin=origin,
1562 start=start,
1563 end=end,
1564 reverse=reverse,
1565 suspect=suspect,
1566 vpn=vpn,
1567 virtual_machine=virtual_machine,
1568 tampering=tampering,
1569 anti_detect_browser=anti_detect_browser,
1570 incognito=incognito,
1571 privacy_settings=privacy_settings,
1572 jailbroken=jailbroken,
1573 frida=frida,
1574 factory_reset=factory_reset,
1575 cloned_app=cloned_app,
1576 emulator=emulator,
1577 root_apps=root_apps,
1578 vpn_confidence=vpn_confidence,
1579 min_suspect_score=min_suspect_score,
1580 developer_tools=developer_tools,
1581 location_spoofing=location_spoofing,
1582 mitm_attack=mitm_attack,
1583 rare_device=rare_device,
1584 rare_device_percentile_bucket=rare_device_percentile_bucket,
1585 proxy=proxy,
1586 sdk_version=sdk_version,
1587 sdk_platform=sdk_platform,
1588 environment=environment,
1589 proximity_id=proximity_id,
1590 total_hits=total_hits,
1591 tor_node=tor_node,
1592 incremental_identification_status=incremental_identification_status,
1593 simulator=simulator,
1594 source=source,
1595 active_call=active_call,
1596 _request_auth=_request_auth,
1597 _content_type=_content_type,
1598 _headers=_headers,
1599 )
1601 _response_types_map: dict[str, Optional[str]] = {
1602 '200': 'EventSearch',
1603 '400': 'ErrorResponse',
1604 '403': 'ErrorResponse',
1605 '404': 'ErrorResponse',
1606 '429': 'ErrorResponse',
1607 '500': 'ErrorResponse',
1608 '504': 'ErrorResponse',
1609 }
1611 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
1612 response_data.read()
1613 return self.api_client.response_deserialize(
1614 response_data=response_data,
1615 response_types_map=_response_types_map,
1616 )
1618 @validate_call
1619 def search_events_without_preload_content(
1620 self,
1621 limit: Annotated[
1622 Optional[Annotated[int, Field(le=100, strict=True, ge=1)]],
1623 Field(
1624 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. '
1625 ),
1626 ] = None,
1627 pagination_key: Annotated[
1628 Optional[StrictStr],
1629 Field(
1630 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` '
1631 ),
1632 ] = None,
1633 visitor_id: Annotated[
1634 Optional[StrictStr],
1635 Field(
1636 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). '
1637 ),
1638 ] = None,
1639 high_recall_id: Annotated[
1640 Optional[StrictStr],
1641 Field(
1642 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). '
1643 ),
1644 ] = None,
1645 bot: Annotated[
1646 Optional[SearchEventsBot],
1647 Field(
1648 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. '
1649 ),
1650 ] = None,
1651 bot_info: Annotated[
1652 Optional[SearchEventsBotInfo],
1653 Field(
1654 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. '
1655 ),
1656 ] = None,
1657 bot_info_category: Annotated[
1658 Optional[list[BotInfoCategory]],
1659 Field(
1660 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. '
1661 ),
1662 ] = None,
1663 bot_info_identity: Annotated[
1664 Optional[list[BotInfoIdentity]],
1665 Field(
1666 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. '
1667 ),
1668 ] = None,
1669 bot_info_confidence: Annotated[
1670 Optional[list[BotInfoConfidence]],
1671 Field(
1672 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. '
1673 ),
1674 ] = None,
1675 bot_info_provider: Annotated[
1676 Optional[list[StrictStr]],
1677 Field(
1678 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. '
1679 ),
1680 ] = None,
1681 bot_info_name: Annotated[
1682 Optional[list[StrictStr]],
1683 Field(
1684 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. '
1685 ),
1686 ] = None,
1687 ip_address: Annotated[
1688 Optional[StrictStr],
1689 Field(
1690 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 '
1691 ),
1692 ] = None,
1693 asn: Annotated[
1694 Optional[StrictStr],
1695 Field(
1696 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. "
1697 ),
1698 ] = None,
1699 linked_id: Annotated[
1700 Optional[StrictStr],
1701 Field(
1702 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. '
1703 ),
1704 ] = None,
1705 url: Annotated[
1706 Optional[StrictStr],
1707 Field(
1708 description='Filter events by the URL (`url` property) associated with the event. '
1709 ),
1710 ] = None,
1711 bundle_id: Annotated[
1712 Optional[StrictStr],
1713 Field(description='Filter events by the Bundle ID (iOS) associated with the event. '),
1714 ] = None,
1715 package_name: Annotated[
1716 Optional[StrictStr],
1717 Field(
1718 description='Filter events by the Package Name (Android) associated with the event. '
1719 ),
1720 ] = None,
1721 origin: Annotated[
1722 Optional[StrictStr],
1723 Field(
1724 description='Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) '
1725 ),
1726 ] = None,
1727 start: Annotated[
1728 Optional[SearchEventsStartParameter],
1729 Field(
1730 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. ',
1731 ),
1732 ] = None,
1733 end: Annotated[
1734 Optional[SearchEventsEndParameter],
1735 Field(
1736 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. ',
1737 ),
1738 ] = None,
1739 reverse: Annotated[
1740 Optional[StrictBool],
1741 Field(
1742 description='When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order). '
1743 ),
1744 ] = None,
1745 suspect: Annotated[
1746 Optional[StrictBool],
1747 Field(
1748 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. '
1749 ),
1750 ] = None,
1751 vpn: Annotated[
1752 Optional[StrictBool],
1753 Field(
1754 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. '
1755 ),
1756 ] = None,
1757 virtual_machine: Annotated[
1758 Optional[StrictBool],
1759 Field(
1760 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. '
1761 ),
1762 ] = None,
1763 tampering: Annotated[
1764 Optional[StrictBool],
1765 Field(
1766 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. '
1767 ),
1768 ] = None,
1769 anti_detect_browser: Annotated[
1770 Optional[StrictBool],
1771 Field(
1772 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. '
1773 ),
1774 ] = None,
1775 incognito: Annotated[
1776 Optional[StrictBool],
1777 Field(
1778 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. '
1779 ),
1780 ] = None,
1781 privacy_settings: Annotated[
1782 Optional[StrictBool],
1783 Field(
1784 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. '
1785 ),
1786 ] = None,
1787 jailbroken: Annotated[
1788 Optional[StrictBool],
1789 Field(
1790 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. '
1791 ),
1792 ] = None,
1793 frida: Annotated[
1794 Optional[StrictBool],
1795 Field(
1796 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. '
1797 ),
1798 ] = None,
1799 factory_reset: Annotated[
1800 Optional[StrictBool],
1801 Field(
1802 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. '
1803 ),
1804 ] = None,
1805 cloned_app: Annotated[
1806 Optional[StrictBool],
1807 Field(
1808 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. '
1809 ),
1810 ] = None,
1811 emulator: Annotated[
1812 Optional[StrictBool],
1813 Field(
1814 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. '
1815 ),
1816 ] = None,
1817 root_apps: Annotated[
1818 Optional[StrictBool],
1819 Field(
1820 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. '
1821 ),
1822 ] = None,
1823 vpn_confidence: Annotated[
1824 Optional[SearchEventsVpnConfidence],
1825 Field(
1826 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. '
1827 ),
1828 ] = None,
1829 min_suspect_score: Annotated[
1830 Optional[Union[StrictFloat, StrictInt]],
1831 Field(
1832 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. '
1833 ),
1834 ] = None,
1835 developer_tools: Annotated[
1836 Optional[StrictBool],
1837 Field(
1838 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. '
1839 ),
1840 ] = None,
1841 location_spoofing: Annotated[
1842 Optional[StrictBool],
1843 Field(
1844 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. '
1845 ),
1846 ] = None,
1847 mitm_attack: Annotated[
1848 Optional[StrictBool],
1849 Field(
1850 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. '
1851 ),
1852 ] = None,
1853 rare_device: Annotated[
1854 Optional[StrictBool],
1855 Field(
1856 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/). '
1857 ),
1858 ] = None,
1859 rare_device_percentile_bucket: Annotated[
1860 Optional[SearchEventsRareDevicePercentileBucket],
1861 Field(
1862 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/). '
1863 ),
1864 ] = None,
1865 proxy: Annotated[
1866 Optional[StrictBool],
1867 Field(
1868 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. '
1869 ),
1870 ] = None,
1871 sdk_version: Annotated[
1872 Optional[StrictStr],
1873 Field(
1874 description='Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` '
1875 ),
1876 ] = None,
1877 sdk_platform: Annotated[
1878 Optional[SearchEventsSdkPlatform],
1879 Field(
1880 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. '
1881 ),
1882 ] = None,
1883 environment: Annotated[
1884 Optional[list[StrictStr]],
1885 Field(
1886 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. '
1887 ),
1888 ] = None,
1889 proximity_id: Annotated[
1890 Optional[StrictStr],
1891 Field(
1892 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. '
1893 ),
1894 ] = None,
1895 total_hits: Annotated[
1896 Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]],
1897 Field(
1898 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. '
1899 ),
1900 ] = None,
1901 tor_node: Annotated[
1902 Optional[StrictBool],
1903 Field(
1904 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. '
1905 ),
1906 ] = None,
1907 incremental_identification_status: Annotated[
1908 Optional[SearchEventsIncrementalIdentificationStatus],
1909 Field(
1910 description='Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. '
1911 ),
1912 ] = None,
1913 simulator: Annotated[
1914 Optional[StrictBool],
1915 Field(
1916 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. '
1917 ),
1918 ] = None,
1919 source: Annotated[
1920 Optional[Annotated[list[SearchEventsSource], Field(max_length=1)]],
1921 Field(
1922 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. '
1923 ),
1924 ] = None,
1925 active_call: Annotated[
1926 Optional[StrictBool],
1927 Field(
1928 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. '
1929 ),
1930 ] = None,
1931 _request_timeout: Union[
1932 None,
1933 Annotated[StrictFloat, Field(gt=0)],
1934 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
1935 ] = None,
1936 _request_auth: Optional[dict[StrictStr, Any]] = None,
1937 _content_type: Optional[StrictStr] = None,
1938 _headers: Optional[dict[StrictStr, Any]] = None,
1939 ) -> RESTResponseType:
1940 """Search events
1942 ## 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.
1944 :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.
1945 :type limit: int
1946 :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`
1947 :type pagination_key: str
1948 :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).
1949 :type visitor_id: str
1950 :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).
1951 :type high_recall_id: str
1952 :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.
1953 :type bot: SearchEventsBot
1954 :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.
1955 :type bot_info: SearchEventsBotInfo
1956 :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.
1957 :type bot_info_category: List[BotInfoCategory]
1958 :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.
1959 :type bot_info_identity: List[BotInfoIdentity]
1960 :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.
1961 :type bot_info_confidence: List[BotInfoConfidence]
1962 :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.
1963 :type bot_info_provider: List[str]
1964 :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.
1965 :type bot_info_name: List[str]
1966 :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
1967 :type ip_address: str
1968 :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.
1969 :type asn: str
1970 :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.
1971 :type linked_id: str
1972 :param url: Filter events by the URL (`url` property) associated with the event.
1973 :type url: str
1974 :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event.
1975 :type bundle_id: str
1976 :param package_name: Filter events by the Package Name (Android) associated with the event.
1977 :type package_name: str
1978 :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com)
1979 :type origin: str
1980 :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.
1981 :type start: SearchEventsStartParameter
1982 :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.
1983 :type end: SearchEventsEndParameter
1984 :param reverse: When `true`, sort events oldest first (ascending timestamp order). Defaults to `false` (newest first, descending timestamp order).
1985 :type reverse: bool
1986 :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.
1987 :type suspect: bool
1988 :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.
1989 :type vpn: bool
1990 :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.
1991 :type virtual_machine: bool
1992 :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.
1993 :type tampering: bool
1994 :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.
1995 :type anti_detect_browser: bool
1996 :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.
1997 :type incognito: bool
1998 :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.
1999 :type privacy_settings: bool
2000 :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.
2001 :type jailbroken: bool
2002 :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.
2003 :type frida: bool
2004 :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.
2005 :type factory_reset: bool
2006 :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.
2007 :type cloned_app: bool
2008 :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.
2009 :type emulator: bool
2010 :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.
2011 :type root_apps: bool
2012 :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.
2013 :type vpn_confidence: SearchEventsVpnConfidence
2014 :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.
2015 :type min_suspect_score: float
2016 :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.
2017 :type developer_tools: bool
2018 :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.
2019 :type location_spoofing: bool
2020 :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.
2021 :type mitm_attack: bool
2022 :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/).
2023 :type rare_device: bool
2024 :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/).
2025 :type rare_device_percentile_bucket: SearchEventsRareDevicePercentileBucket
2026 :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.
2027 :type proxy: bool
2028 :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14`
2029 :type sdk_version: str
2030 :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.
2031 :type sdk_platform: SearchEventsSdkPlatform
2032 :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.
2033 :type environment: List[str]
2034 :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.
2035 :type proximity_id: str
2036 :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.
2037 :type total_hits: int
2038 :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.
2039 :type tor_node: bool
2040 :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.
2041 :type incremental_identification_status: SearchEventsIncrementalIdentificationStatus
2042 :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.
2043 :type simulator: bool
2044 :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.
2045 :type source: List[SearchEventsSource]
2046 :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.
2047 :type active_call: bool
2048 :param _request_timeout: timeout setting for this request. If one
2049 number provided, it will be total request
2050 timeout. It can also be a pair (tuple) of
2051 (connection, read) timeouts.
2052 :type _request_timeout: int, tuple(int, int), optional
2053 :param _request_auth: set to override the auth_settings for an a single
2054 request; this effectively ignores the
2055 authentication in the spec for a single request.
2056 :type _request_auth: dict, optional
2057 :param _content_type: force content-type for the request.
2058 :type _content_type: str, Optional
2059 :param _headers: set to override the headers for a single
2060 request; this effectively ignores the headers
2061 in the spec for a single request.
2062 :type _headers: dict, optional
2063 :return: Returns the result object.
2064 """ # noqa: E501
2066 _param = self._search_events_serialize(
2067 limit=limit,
2068 pagination_key=pagination_key,
2069 visitor_id=visitor_id,
2070 high_recall_id=high_recall_id,
2071 bot=bot,
2072 bot_info=bot_info,
2073 bot_info_category=bot_info_category,
2074 bot_info_identity=bot_info_identity,
2075 bot_info_confidence=bot_info_confidence,
2076 bot_info_provider=bot_info_provider,
2077 bot_info_name=bot_info_name,
2078 ip_address=ip_address,
2079 asn=asn,
2080 linked_id=linked_id,
2081 url=url,
2082 bundle_id=bundle_id,
2083 package_name=package_name,
2084 origin=origin,
2085 start=start,
2086 end=end,
2087 reverse=reverse,
2088 suspect=suspect,
2089 vpn=vpn,
2090 virtual_machine=virtual_machine,
2091 tampering=tampering,
2092 anti_detect_browser=anti_detect_browser,
2093 incognito=incognito,
2094 privacy_settings=privacy_settings,
2095 jailbroken=jailbroken,
2096 frida=frida,
2097 factory_reset=factory_reset,
2098 cloned_app=cloned_app,
2099 emulator=emulator,
2100 root_apps=root_apps,
2101 vpn_confidence=vpn_confidence,
2102 min_suspect_score=min_suspect_score,
2103 developer_tools=developer_tools,
2104 location_spoofing=location_spoofing,
2105 mitm_attack=mitm_attack,
2106 rare_device=rare_device,
2107 rare_device_percentile_bucket=rare_device_percentile_bucket,
2108 proxy=proxy,
2109 sdk_version=sdk_version,
2110 sdk_platform=sdk_platform,
2111 environment=environment,
2112 proximity_id=proximity_id,
2113 total_hits=total_hits,
2114 tor_node=tor_node,
2115 incremental_identification_status=incremental_identification_status,
2116 simulator=simulator,
2117 source=source,
2118 active_call=active_call,
2119 _request_auth=_request_auth,
2120 _content_type=_content_type,
2121 _headers=_headers,
2122 )
2124 _response_types_map: dict[str, Optional[str]] = {
2125 '200': 'EventSearch',
2126 '400': 'ErrorResponse',
2127 '403': 'ErrorResponse',
2128 '404': 'ErrorResponse',
2129 '429': 'ErrorResponse',
2130 '500': 'ErrorResponse',
2131 '504': 'ErrorResponse',
2132 }
2134 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2135 return response_data.response
2137 def _search_events_serialize(
2138 self,
2139 limit: Optional[int],
2140 pagination_key: Optional[str],
2141 visitor_id: Optional[str],
2142 high_recall_id: Optional[str],
2143 bot: Optional[SearchEventsBot],
2144 bot_info: Optional[SearchEventsBotInfo],
2145 bot_info_category: Optional[list[BotInfoCategory]],
2146 bot_info_identity: Optional[list[BotInfoIdentity]],
2147 bot_info_confidence: Optional[list[BotInfoConfidence]],
2148 bot_info_provider: Optional[list[str]],
2149 bot_info_name: Optional[list[str]],
2150 ip_address: Optional[str],
2151 asn: Optional[str],
2152 linked_id: Optional[str],
2153 url: Optional[str],
2154 bundle_id: Optional[str],
2155 package_name: Optional[str],
2156 origin: Optional[str],
2157 start: Optional[SearchEventsStartParameter],
2158 end: Optional[SearchEventsEndParameter],
2159 reverse: Optional[bool],
2160 suspect: Optional[bool],
2161 vpn: Optional[bool],
2162 virtual_machine: Optional[bool],
2163 tampering: Optional[bool],
2164 anti_detect_browser: Optional[bool],
2165 incognito: Optional[bool],
2166 privacy_settings: Optional[bool],
2167 jailbroken: Optional[bool],
2168 frida: Optional[bool],
2169 factory_reset: Optional[bool],
2170 cloned_app: Optional[bool],
2171 emulator: Optional[bool],
2172 root_apps: Optional[bool],
2173 vpn_confidence: Optional[SearchEventsVpnConfidence],
2174 min_suspect_score: Optional[float],
2175 developer_tools: Optional[bool],
2176 location_spoofing: Optional[bool],
2177 mitm_attack: Optional[bool],
2178 rare_device: Optional[bool],
2179 rare_device_percentile_bucket: Optional[SearchEventsRareDevicePercentileBucket],
2180 proxy: Optional[bool],
2181 sdk_version: Optional[str],
2182 sdk_platform: Optional[SearchEventsSdkPlatform],
2183 environment: Optional[list[str]],
2184 proximity_id: Optional[str],
2185 total_hits: Optional[int],
2186 tor_node: Optional[bool],
2187 incremental_identification_status: Optional[SearchEventsIncrementalIdentificationStatus],
2188 simulator: Optional[bool],
2189 source: Optional[list[SearchEventsSource]],
2190 active_call: Optional[bool],
2191 _request_auth: Optional[dict[StrictStr, Any]],
2192 _content_type: Optional[StrictStr],
2193 _headers: Optional[dict[StrictStr, Any]],
2194 ) -> RequestSerialized:
2196 _collection_formats: dict[str, str] = {
2197 'bot_info_category': 'multi',
2198 'bot_info_identity': 'multi',
2199 'bot_info_confidence': 'multi',
2200 'bot_info_provider': 'multi',
2201 'bot_info_name': 'multi',
2202 'environment': 'multi',
2203 'source': 'multi',
2204 }
2206 _path_params: dict[str, str] = {}
2207 _query_params: list[tuple[str, ParamValue]] = []
2208 _header_params: dict[str, Optional[str]] = _headers or {}
2209 _form_params: list[tuple[str, ParamValue]] = []
2210 _files: dict[
2211 str,
2212 Union[str, bytes, list[str], list[bytes], tuple[str, bytes], list[tuple[str, bytes]]],
2213 ] = {}
2214 _body_params: Optional[Any] = None
2216 # process the query parameters
2217 if limit is not None:
2218 _query_params.append(('limit', limit))
2220 # process the query parameters
2221 if pagination_key is not None:
2222 _query_params.append(('pagination_key', pagination_key))
2224 # process the query parameters
2225 if visitor_id is not None:
2226 _query_params.append(('visitor_id', visitor_id))
2228 # process the query parameters
2229 if high_recall_id is not None:
2230 _query_params.append(('high_recall_id', high_recall_id))
2232 # process the query parameters
2233 if bot is not None:
2234 _query_params.append(('bot', bot.value))
2236 # process the query parameters
2237 if bot_info is not None:
2238 _query_params.append(('bot_info', bot_info.value))
2240 # process the query parameters
2241 if bot_info_category is not None:
2242 _query_params.append(('bot_info_category', bot_info_category))
2244 # process the query parameters
2245 if bot_info_identity is not None:
2246 _query_params.append(('bot_info_identity', bot_info_identity))
2248 # process the query parameters
2249 if bot_info_confidence is not None:
2250 _query_params.append(('bot_info_confidence', bot_info_confidence))
2252 # process the query parameters
2253 if bot_info_provider is not None:
2254 _query_params.append(('bot_info_provider', bot_info_provider))
2256 # process the query parameters
2257 if bot_info_name is not None:
2258 _query_params.append(('bot_info_name', bot_info_name))
2260 # process the query parameters
2261 if ip_address is not None:
2262 _query_params.append(('ip_address', ip_address))
2264 # process the query parameters
2265 if asn is not None:
2266 _query_params.append(('asn', asn))
2268 # process the query parameters
2269 if linked_id is not None:
2270 _query_params.append(('linked_id', linked_id))
2272 # process the query parameters
2273 if url is not None:
2274 _query_params.append(('url', url))
2276 # process the query parameters
2277 if bundle_id is not None:
2278 _query_params.append(('bundle_id', bundle_id))
2280 # process the query parameters
2281 if package_name is not None:
2282 _query_params.append(('package_name', package_name))
2284 # process the query parameters
2285 if origin is not None:
2286 _query_params.append(('origin', origin))
2288 # process the query parameters
2289 if start is not None:
2290 if isinstance(start, datetime):
2291 _query_params.append(('start', start.isoformat(timespec='microseconds')))
2292 elif isinstance(start, date):
2293 _query_params.append(('start', start.isoformat()))
2294 else:
2295 _query_params.append(('start', start))
2296 # process the query parameters
2297 if end is not None:
2298 if isinstance(end, datetime):
2299 _query_params.append(('end', end.isoformat(timespec='microseconds')))
2300 elif isinstance(end, date):
2301 _query_params.append(('end', end.isoformat()))
2302 else:
2303 _query_params.append(('end', end))
2304 # process the query parameters
2305 if reverse is not None:
2306 _query_params.append(('reverse', reverse))
2308 # process the query parameters
2309 if suspect is not None:
2310 _query_params.append(('suspect', suspect))
2312 # process the query parameters
2313 if vpn is not None:
2314 _query_params.append(('vpn', vpn))
2316 # process the query parameters
2317 if virtual_machine is not None:
2318 _query_params.append(('virtual_machine', virtual_machine))
2320 # process the query parameters
2321 if tampering is not None:
2322 _query_params.append(('tampering', tampering))
2324 # process the query parameters
2325 if anti_detect_browser is not None:
2326 _query_params.append(('anti_detect_browser', anti_detect_browser))
2328 # process the query parameters
2329 if incognito is not None:
2330 _query_params.append(('incognito', incognito))
2332 # process the query parameters
2333 if privacy_settings is not None:
2334 _query_params.append(('privacy_settings', privacy_settings))
2336 # process the query parameters
2337 if jailbroken is not None:
2338 _query_params.append(('jailbroken', jailbroken))
2340 # process the query parameters
2341 if frida is not None:
2342 _query_params.append(('frida', frida))
2344 # process the query parameters
2345 if factory_reset is not None:
2346 _query_params.append(('factory_reset', factory_reset))
2348 # process the query parameters
2349 if cloned_app is not None:
2350 _query_params.append(('cloned_app', cloned_app))
2352 # process the query parameters
2353 if emulator is not None:
2354 _query_params.append(('emulator', emulator))
2356 # process the query parameters
2357 if root_apps is not None:
2358 _query_params.append(('root_apps', root_apps))
2360 # process the query parameters
2361 if vpn_confidence is not None:
2362 _query_params.append(('vpn_confidence', vpn_confidence.value))
2364 # process the query parameters
2365 if min_suspect_score is not None:
2366 _query_params.append(('min_suspect_score', min_suspect_score))
2368 # process the query parameters
2369 if developer_tools is not None:
2370 _query_params.append(('developer_tools', developer_tools))
2372 # process the query parameters
2373 if location_spoofing is not None:
2374 _query_params.append(('location_spoofing', location_spoofing))
2376 # process the query parameters
2377 if mitm_attack is not None:
2378 _query_params.append(('mitm_attack', mitm_attack))
2380 # process the query parameters
2381 if rare_device is not None:
2382 _query_params.append(('rare_device', rare_device))
2384 # process the query parameters
2385 if rare_device_percentile_bucket is not None:
2386 _query_params.append(
2387 ('rare_device_percentile_bucket', rare_device_percentile_bucket.value)
2388 )
2390 # process the query parameters
2391 if proxy is not None:
2392 _query_params.append(('proxy', proxy))
2394 # process the query parameters
2395 if sdk_version is not None:
2396 _query_params.append(('sdk_version', sdk_version))
2398 # process the query parameters
2399 if sdk_platform is not None:
2400 _query_params.append(('sdk_platform', sdk_platform.value))
2402 # process the query parameters
2403 if environment is not None:
2404 _query_params.append(('environment', environment))
2406 # process the query parameters
2407 if proximity_id is not None:
2408 _query_params.append(('proximity_id', proximity_id))
2410 # process the query parameters
2411 if total_hits is not None:
2412 _query_params.append(('total_hits', total_hits))
2414 # process the query parameters
2415 if tor_node is not None:
2416 _query_params.append(('tor_node', tor_node))
2418 # process the query parameters
2419 if incremental_identification_status is not None:
2420 _query_params.append(
2421 ('incremental_identification_status', incremental_identification_status.value)
2422 )
2424 # process the query parameters
2425 if simulator is not None:
2426 _query_params.append(('simulator', simulator))
2428 # process the query parameters
2429 if source is not None:
2430 _query_params.append(('source', source))
2432 # process the query parameters
2433 if active_call is not None:
2434 _query_params.append(('active_call', active_call))
2436 # set the HTTP header `Accept`
2437 if 'Accept' not in _header_params:
2438 _header_params['Accept'] = self.api_client.select_header_accept(['application/json'])
2440 # authentication setting
2441 _auth_settings: list[str] = ['bearerAuth']
2443 return self.api_client.param_serialize(
2444 method='GET',
2445 resource_path='/events',
2446 path_params=_path_params,
2447 query_params=_query_params,
2448 header_params=_header_params,
2449 body=_body_params,
2450 post_params=_form_params,
2451 files=_files,
2452 auth_settings=_auth_settings,
2453 collection_formats=_collection_formats,
2454 _request_auth=_request_auth,
2455 )
2457 @validate_call
2458 def update_event(
2459 self,
2460 event_id: Annotated[
2461 StrictStr,
2462 Field(
2463 description='The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id).'
2464 ),
2465 ],
2466 event_update: EventUpdate,
2467 _request_timeout: Union[
2468 None,
2469 Annotated[StrictFloat, Field(gt=0)],
2470 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2471 ] = None,
2472 _request_auth: Optional[dict[StrictStr, Any]] = None,
2473 _content_type: Optional[StrictStr] = None,
2474 _headers: Optional[dict[StrictStr, Any]] = None,
2475 ) -> None:
2476 """Update an event
2478 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.
2480 :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required)
2481 :type event_id: str
2482 :param event_update: (required)
2483 :type event_update: EventUpdate
2484 :param _request_timeout: timeout setting for this request. If one
2485 number provided, it will be total request
2486 timeout. It can also be a pair (tuple) of
2487 (connection, read) timeouts.
2488 :type _request_timeout: int, tuple(int, int), optional
2489 :param _request_auth: set to override the auth_settings for an a single
2490 request; this effectively ignores the
2491 authentication in the spec for a single request.
2492 :type _request_auth: dict, optional
2493 :param _content_type: force content-type for the request.
2494 :type _content_type: str, Optional
2495 :param _headers: set to override the headers for a single
2496 request; this effectively ignores the headers
2497 in the spec for a single request.
2498 :type _headers: dict, optional
2499 :return: Returns the result object.
2500 """ # noqa: E501
2502 _param = self._update_event_serialize(
2503 event_id=event_id,
2504 event_update=event_update,
2505 _request_auth=_request_auth,
2506 _content_type=_content_type,
2507 _headers=_headers,
2508 )
2510 _response_types_map: dict[str, Optional[str]] = {
2511 '200': None,
2512 '400': 'ErrorResponse',
2513 '403': 'ErrorResponse',
2514 '404': 'ErrorResponse',
2515 '409': 'ErrorResponse',
2516 }
2518 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2519 response_data.read()
2520 self.api_client.response_deserialize(
2521 response_data=response_data,
2522 response_types_map=_response_types_map,
2523 )
2525 @validate_call
2526 def update_event_with_http_info(
2527 self,
2528 event_id: Annotated[
2529 StrictStr,
2530 Field(
2531 description='The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id).'
2532 ),
2533 ],
2534 event_update: EventUpdate,
2535 _request_timeout: Union[
2536 None,
2537 Annotated[StrictFloat, Field(gt=0)],
2538 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2539 ] = None,
2540 _request_auth: Optional[dict[StrictStr, Any]] = None,
2541 _content_type: Optional[StrictStr] = None,
2542 _headers: Optional[dict[StrictStr, Any]] = None,
2543 ) -> ApiResponse[None]:
2544 """Update an event
2546 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.
2548 :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required)
2549 :type event_id: str
2550 :param event_update: (required)
2551 :type event_update: EventUpdate
2552 :param _request_timeout: timeout setting for this request. If one
2553 number provided, it will be total request
2554 timeout. It can also be a pair (tuple) of
2555 (connection, read) timeouts.
2556 :type _request_timeout: int, tuple(int, int), optional
2557 :param _request_auth: set to override the auth_settings for an a single
2558 request; this effectively ignores the
2559 authentication in the spec for a single request.
2560 :type _request_auth: dict, optional
2561 :param _content_type: force content-type for the request.
2562 :type _content_type: str, Optional
2563 :param _headers: set to override the headers for a single
2564 request; this effectively ignores the headers
2565 in the spec for a single request.
2566 :type _headers: dict, optional
2567 :return: Returns the result object.
2568 """ # noqa: E501
2570 _param = self._update_event_serialize(
2571 event_id=event_id,
2572 event_update=event_update,
2573 _request_auth=_request_auth,
2574 _content_type=_content_type,
2575 _headers=_headers,
2576 )
2578 _response_types_map: dict[str, Optional[str]] = {
2579 '200': None,
2580 '400': 'ErrorResponse',
2581 '403': 'ErrorResponse',
2582 '404': 'ErrorResponse',
2583 '409': 'ErrorResponse',
2584 }
2586 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2587 response_data.read()
2588 return self.api_client.response_deserialize(
2589 response_data=response_data,
2590 response_types_map=_response_types_map,
2591 )
2593 @validate_call
2594 def update_event_without_preload_content(
2595 self,
2596 event_id: Annotated[
2597 StrictStr,
2598 Field(
2599 description='The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id).'
2600 ),
2601 ],
2602 event_update: EventUpdate,
2603 _request_timeout: Union[
2604 None,
2605 Annotated[StrictFloat, Field(gt=0)],
2606 tuple[Annotated[StrictFloat, Field(gt=0)], Annotated[StrictFloat, Field(gt=0)]],
2607 ] = None,
2608 _request_auth: Optional[dict[StrictStr, Any]] = None,
2609 _content_type: Optional[StrictStr] = None,
2610 _headers: Optional[dict[StrictStr, Any]] = None,
2611 ) -> RESTResponseType:
2612 """Update an event
2614 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.
2616 :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required)
2617 :type event_id: str
2618 :param event_update: (required)
2619 :type event_update: EventUpdate
2620 :param _request_timeout: timeout setting for this request. If one
2621 number provided, it will be total request
2622 timeout. It can also be a pair (tuple) of
2623 (connection, read) timeouts.
2624 :type _request_timeout: int, tuple(int, int), optional
2625 :param _request_auth: set to override the auth_settings for an a single
2626 request; this effectively ignores the
2627 authentication in the spec for a single request.
2628 :type _request_auth: dict, optional
2629 :param _content_type: force content-type for the request.
2630 :type _content_type: str, Optional
2631 :param _headers: set to override the headers for a single
2632 request; this effectively ignores the headers
2633 in the spec for a single request.
2634 :type _headers: dict, optional
2635 :return: Returns the result object.
2636 """ # noqa: E501
2638 _param = self._update_event_serialize(
2639 event_id=event_id,
2640 event_update=event_update,
2641 _request_auth=_request_auth,
2642 _content_type=_content_type,
2643 _headers=_headers,
2644 )
2646 _response_types_map: dict[str, Optional[str]] = {
2647 '200': None,
2648 '400': 'ErrorResponse',
2649 '403': 'ErrorResponse',
2650 '404': 'ErrorResponse',
2651 '409': 'ErrorResponse',
2652 }
2654 response_data = self.api_client.call_api(*_param, _request_timeout=_request_timeout)
2655 return response_data.response
2657 def _update_event_serialize(
2658 self,
2659 event_id: str,
2660 event_update: EventUpdate,
2661 _request_auth: Optional[dict[StrictStr, Any]],
2662 _content_type: Optional[StrictStr],
2663 _headers: Optional[dict[StrictStr, Any]],
2664 ) -> RequestSerialized:
2666 _collection_formats: dict[str, str] = {}
2668 _path_params: dict[str, str] = {}
2669 _query_params: list[tuple[str, ParamValue]] = []
2670 _header_params: dict[str, Optional[str]] = _headers or {}
2671 _form_params: list[tuple[str, ParamValue]] = []
2672 _files: dict[
2673 str,
2674 Union[str, bytes, list[str], list[bytes], tuple[str, bytes], list[tuple[str, bytes]]],
2675 ] = {}
2676 _body_params: Optional[Any] = None
2678 # process the path parameters
2679 if event_id is not None:
2680 _path_params['event_id'] = event_id
2682 # process the body parameter
2683 if event_update is not None:
2684 _body_params = event_update
2686 # set the HTTP header `Accept`
2687 if 'Accept' not in _header_params:
2688 _header_params['Accept'] = self.api_client.select_header_accept(['application/json'])
2690 # set the HTTP header `Content-Type`
2691 if _content_type:
2692 _header_params['Content-Type'] = _content_type
2693 else:
2694 _default_content_type = self.api_client.select_header_content_type(
2695 ['application/json']
2696 )
2697 if _default_content_type is not None:
2698 _header_params['Content-Type'] = _default_content_type
2700 # authentication setting
2701 _auth_settings: list[str] = ['bearerAuth']
2703 return self.api_client.param_serialize(
2704 method='PATCH',
2705 resource_path='/events/{event_id}',
2706 path_params=_path_params,
2707 query_params=_query_params,
2708 header_params=_header_params,
2709 body=_body_params,
2710 post_params=_form_params,
2711 files=_files,
2712 auth_settings=_auth_settings,
2713 collection_formats=_collection_formats,
2714 _request_auth=_request_auth,
2715 )