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