Skip to main content

ArgusClient.create()

This class method is the designated constructor for creating an ArgusClient instance. It authenticates the API key and configures the client’s default state. Signature:
@classmethod
def create(
    cls,
    api_key: str,
    asset_id: Optional[str] = None,
    session_id: Optional[str] = None,
    policy: Optional[Policy] = None,
    save: bool = False,
    strict: bool = True,
    url: Optional[str] = None
) -> "ArgusClient"
Parameters:
ParameterTypeDefaultDescription
api_keystr(none)Required. Your Argus API key. The key’s prefix determines the available feature set.
asset_idOptional[str]NonePlatform Tier Only. The default Asset ID to associate with all scans. An Asset is a logical container for policies and analytics in the Argus Platform. This parameter is ignored for non-platform keys.
session_idOptional[str]NonePlatform Tier Only. The default Session ID to associate with all scans. A Session groups related interactions for contextual analysis. This parameter is ignored for non-platform keys.
policyOptional[Policy]NoneThe default Policy object configuration to apply to all scans. This is the primary method for defining rules for non-platform users.
saveboolFalsePlatform Tier Only. If True, all scan results are persisted in the Argus platform for analytics and log review. An asset_id must be provided to enable saving. This parameter is ignored for non-platform keys.
strictboolTrueIf True, invalid client-side policy configurations (e.g., an empty list for a required parameter) will raise an ArgusValueError. If False, a UserWarning will be issued instead, and the scan may proceed.
urlOptional[str]NonePlatform Tier Only. The Base URL that can be used to perform scan in a self hosted argus environment.
Returns: An initialized ArgusClient instance. Exceptions:
  • ArgusValueError: If the api_key has an invalid format.
  • ArgusAuthenticationError: If the api_key is invalid or expired.
  • ArgusNotFoundError: If a provided asset_id does not exist.