# Siemplify module

## *class* `Siemplify.Siemplify`

Bases: SiemplifyBase

Endpoints: `external/v1/sdk/CaseFullDetails`

### add_agent_connector_logs

    add_agent_connector_logs(agent_id, connector_id, logs_package)

Add logs of the remote agent's `connector_id` connector.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| agent_id | {string} | Agent's identifier | N/A | N/A |
| connector_id | {string} | Connector instance identifier | N/A | N/A |
| logs_package | {dict} | Dictionary representing a `ConnectorLogPackage` | `ConnectorIdentifier` {string} `LogItems` {list\[[ConnectorLogRecord](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#class-siemplifydatamodelconnectorlogrecord)\]} | Uses PascalCase keys (this endpoint does not use `?format=snake`). |

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
connector_id = "ad6879f1-b72d-419f-990c-011a2526b16d"
logs_package = {
    "ConnectorIdentifier": connector_id,
    "LogItems": [
        {
            "Message": "Connector cycle completed successfully",
            "RecordType": 0,  # 0=INFO, 1=ERROR, 2=KEEP_ALIVE
            "ConnectorIdentifier": connector_id,
            "ResultDataType": 0,
        }
    ],
}
siemplify.add_agent_connector_logs(
    agent_id="f47ac10b-58cc-4372-a567-0e02b2c3d479",
    connector_id=connector_id,
    logs_package=logs_package,
)
```

### add_attachment

    add_attachment(file_path, case_id, alert_identifier, description=None, is_favorite=False)

This function adds an entry to the case wall with a file attachment (that can be
then downloaded from the client into the user's local machine). The function
does essentially the same thing as adding evidence (on the bottom of the case
overview screen).

> [!NOTE]
> **Note:** To upload a file to the case wall, make sure that the file is available in the file system of the server or on a shared location accessible from the server.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| file_path | {string} | Path for the file | Any accessible path | A path can also be a remote location. You need read permissions to that file |
| case_id | {string} | Case identifier | A case ID to add the attachment to its case wall | Default is the current case |
| alert_identifier | {string} | Alert identifier | Alert identifier string of the alert you want to associate the attachment with | Default is the current running alert |
| description | {string} | Attachment description | Any string | None by default. Optional parameter. |
| is_favorite | {boolean} | Attachment favorite | True/False | `False` by default. Optional parameter. |

#### Returns

{long} attachment_id

#### Example

    from SiemplifyAction import SiemplifyAction
    siemplify = SiemplifyAction()
    siemplify.add_attachment(r'C:/temp/investigation.txt', description='Deep investigation report by TIER3 team', is_favorite=True)

#### Result behavior

In this example, we will upload the `investigation.txt` from `C:/temp` on the
local machine (the server itself) to the case wall. A comment will be added to
that entry on the case wall, with the string in the description. The
`is_favorite` flag was set to `True`, and so this new entry will also be starred
(favorite).

### add_comment

    add_comment(comment, case_id, alert_identifier)

Add a new comment to the specific case.

> [!NOTE]
> **Note:** Related concepts: [Case manipulation](https://docs.cloud.google.com/chronicle/docs/soar/reference/case-manipulation.md.txt)

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| comment | {string} | Comment to be added to a case wall | "This events in this alert seems suspicious" | Comments related to the case |
| case_id | {string} | Case identifier | 234 | N/A |
| alert_identifier | {string} | Alert identifier | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |

#### Returns

`NoneType`

#### Example

    from SiemplifyAction import SiemplifyAction
    siemplify = SiemplifyAction()
    add_comment = "This alert is important"
    alert_identifier = "ad6879f1-b72d-419f-990c-011a2526b16d"
    case_id = "234"
    siemplify.add_comment(comment, case_id, alert_identifier)

#### Result behavior

The provided comment gets added to the case 234.

#### Result value

None

### add_entities_to_custom_list

    add_entities_to_custom_list(custom_list_items)

Add the custom list provided with the added entities to the custom list.

> [!NOTE]
> **Note:** Related concepts: [Custom lists](https://docs.cloud.google.com/chronicle/docs/soar/reference/custom-lists.md.txt)

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| custom_list_items | {\[CustomList\]} | A list of `CustomList` objects | N/A | See [SiemplifyDataModel.CustomList](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#class-siemplifydatamodelcustomlist) |

#### Returns

{\[CustomList\]} List of added `CustomList` objects.

#### Example

```python
from Siemplify import Siemplify
from SiemplifyDataModel import CustomList

siemplify = Siemplify()
items = [
    CustomList(identifier="192.0.2.50", category="BlockedIPs", environment="Default Environment")
]
added = siemplify.add_entities_to_custom_list(items)
```

#### Result behavior

Entity is added to a custom list category.

> [!NOTE]
> **Note:** You can add multiple values from the *CustomList* or manipulate multiple lists with the same call.

### add_entity_insight

    add_entity_insight(domain_entity_info, message, case_id, alert_id)

Add an entity insight.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| domain_entity_info | {string} | Entity identifier | "192.0.2.1" | {DomainEntityInfo} |
| message | {string} | Insight message | This is Example DNS | N/A |
| case_id | {string} | Case identifier to add to an entity insight | 234 | N/A |
| alert_id | {string} | Alert identifier to add to an entity insight | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |

#### Returns

{boolean} `True` if success

#### Example

    from SiemplifyAction import SiemplifyAction
    siemplify = SiemplifyAction()
    entity = "192.0.2.1"
    alert_identifier = "ad6879f1-b72d-419f-990c-011a2526b16d"
    case_id = "234"
    siemplify.add_entity_insight(domain_entity_info=entity, message=message, case_id=case_id, alert_id=alert_identifier)

#### Result behavior

The given message gets added as insight to the entity 192.0.2.1 of the given
alert identifier in the case 234.

#### Result value

True.

False if the insight is not added.

### add_entity_to_case

    add_entity_to_case(case_id, alert_identifier, entity_identifier, entity_type, is_internal, is_suspicous, is_enriched, is_vulnerable, properties, environment)

Add entity to case.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id | {string} | Case identifier | 234 | N/A |
| alert_identifier | {string} | Alert identifier | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |
| entity_identifier | {string} | Entity identifier | 192.0.2.1, example.com | N/A |
| entity_type | {string} | Entity type of the entity identifier | "ADDRESS" | N/A |
| is_internal | {boolean} | N/A | True/False | N/A |
| is_suspicous | {boolean} | N/A | True/False | Note: Spelled incorrectly as `is_suspicous` in `Siemplify.py`. |
| is_enriched | {boolean} | N/A | True/False | False by default |
| is_vulnerable | {boolean} | N/A | True/False | False by default |
| properties | {dict\[string, string\]} | Entity property key-value pairs | `{"property": "value"}` | N/A |
| environment | {string} | Environment name | Default Environment | N/A |

#### Returns

`NoneType`

#### Example

    from SiemplifyAction import SiemplifyAction
    siemplify = SiemplifyAction()
    case_id = "234"
    alert_identifier = "ad6879f1-b72d-419f-990c-011a2526b16d"
    entity = "192.0.2.1"
    entity_type = "ADDRESS"
    properties = {"property": "value"}
    siemplify.add_entity_to_case(case_id=case_id,
                                              alert_identifier = alert_identifier,
                                              entity_identifier = entity,
                                              entity_type = entity_type,
                                              is_internal = True,
                                              is_suspicous = False,
                                              is_enriched = False,
                                              is_vulnerable = False,
                                              properties = properties,
                                              environment=None)

#### Result behavior

The entity with the provided information will be added to the given alert within
the case 234.

#### Result value

None

### add_or_update_case_task

    add_or_update_case_task(task)

Add or update a task case: update if there's a task ID, add (create) otherwise.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| task | {Task} | The task object which should be added to the case or updated | N/A | See [SiemplifyDataModel.Task](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#DataModelTask) |

#### Returns

{int} the ID of the new or updated task.

#### Example

```python
from Siemplify import Siemplify
from SiemplifyDataModel import Task

siemplify = Siemplify()
task = Task(
    case_id=234,
    content="Verify host isolation with endpoint team",
    creator_user_id="Admin",
    title="Isolate Endpoint",
)
task_id = siemplify.add_or_update_case_task(task)
```

### add_tag

    add_tag(tag, case_id, alert_identifier)

Add new tag to a specific case.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| tag | {string} | Tag to be added | N/A | N/A |
| case_id | {string} | Case identifier | 234 | N/A |
| alert_identifier | {string} | Alert identifier | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.add_tag(
    tag="Phishing",
    case_id="234",
    alert_identifier="ad6879f1-b72d-419f-990c-011a2526b16d",
)
```

### any_entity_in_custom_list

    any_entity_in_custom_list(custom_list_items)

Check if there's any entity from the given list, which has a custom list record
with the given category.

> [!NOTE]
> **Note:** Related concepts: [Custom lists](https://docs.cloud.google.com/chronicle/docs/soar/reference/custom-lists.md.txt)

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| custom_list_items | {\[CustomList\]} | A list of custom list items to check for entities | N/A | N/A |

#### Returns

{boolean} `True` if there's an entity found, `False` otherwise.

#### Example

```python
from Siemplify import Siemplify
from SiemplifyDataModel import CustomList

siemplify = Siemplify()
items = [
    CustomList(identifier="192.0.2.50", category="BlockedIPs", environment="Default Environment")
]
exists = siemplify.any_entity_in_custom_list(items)
```

#### Result value

True or False

### assign_case

    assign_case(user, case_id, alert_identifier)

This function assigns the current case to the user.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| user | {string} | User/role | Admin, @Tier1 | N/A |
| case_id | {string} | Case identifier to assign user | 234 | N/A |
| alert_identifier | {string} | Alert identifier to assign user | ad6879f1-b72d-419f-990c-011a2526b16d | This value is fetched during the run time of the action |

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.assign_case(
    user="@Tier1",
    case_id="234",
    alert_identifier="ad6879f1-b72d-419f-990c-011a2526b16d",
)
```

#### Result behavior

The case gets assigned to the specified user.

#### Result value

None

### attach_workflow_to_case

    attach_workflow_to_case(workflow_name, cyber_case_id, indicator_identifier)

Attach a playbook to the case.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| workflow_name | {string} | Workflow name | N/A | N/A |
| cyber_case_id | {string} | Case identifier | 234 | N/A |
| indicator_identifier | {string} | Alert identifier | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |

#### Returns

{string} status code of the server operation

#### Example

    from SiemplifyAction import SiemplifyAction
    siemplify = SiemplifyAction()
    alert_identifier = "ad6879f1-b72d-419f-990c-011a2526b16d"
    case_id = "234"
    workflow_name = "Workflow 234"
    siemplify.attach_workflow_to_case(workflow_name=workflow_name, cyber_case_id=case_id, indicator_identifier=alert_identifier)

#### Result behavior

Workflow 234 will be attached to case 234.

#### Result value

None

### batch_update_case_id_matches

    batch_update_case_id_matches(case_id_matches)

Batch update of cases with the suitable external case IDs.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id_matches | {\[SyncCaseIdMatch\]} | List of `SyncCaseIdMatch` objects | N/A | See [SiemplifyDataModel.SyncCaseIdMatch](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#SyncCaseIdMatch) |

#### Returns

{\[int\]} List of case IDs that were updated successfully.

#### Example

```python
from Siemplify import Siemplify
from SiemplifyDataModel import SyncCaseIdMatch

siemplify = Siemplify()
matches = [SyncCaseIdMatch(case_id=234, external_case_id="INC-90421")]
updated_ids = siemplify.batch_update_case_id_matches(matches)
```

### change_case_priority

    change_case_priority(priority, case_id, alert_identifier)

Change case priority.

> [!NOTE]
> **Note:** Related concepts: [Case manipulation](https://docs.cloud.google.com/chronicle/docs/soar/reference/case-manipulation.md.txt)

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| priority | {int} | Case priority to change | 40/60/80/100 | See [ApiSyncCasePriorityEnum](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#ApiSyncCasePriorityEnum). The priority mapping: {"Low": 40, "Medium": 60, "High": 80, "Critical": 100} |
| case_id | {string} | Case identifier | 234 | N/A |
| alert_identifier | {string} | Alert identifier | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |

#### Returns

`NoneType`

#### Example

    from SiemplifyAction import SiemplifyAction
    siemplify = SiemplifyAction()
    priority = 40
    alert_identifier = "ad6879f1-b72d-419f-990c-011a2526b16d"
    case_id = "234"
    siemplify.change_case_priority(priority=priority, case_id=case_id, alert_identifier=alert_identifier)

#### Result behavior

The priority of the case 234 gets changed to 40, which is mapped to low.

#### Result value

None

### change_case_stage

    change_case_stage(stage, case_id, alert_identifier)

Change case stage.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| stage | {string} | The current stage of the case. | Incident | N/A |
| case_id | {string} | Case identifier | N/A | N/A |
| alert_identifier | {string} | Alert identifier | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.change_case_stage(
    stage="Investigation",
    case_id="234",
    alert_identifier="ad6879f1-b72d-419f-990c-011a2526b16d",
)
```

### check_marketplace_status

    check_marketplace_status()

Check marketplace status.   

If there is no error, the function returns `none`. Otherwise, an exception is
returned.

#### Parameters

N/A

#### Returns

None

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
# Note: Deliberately spelled as `check_marketpalce_status` in `Siemplify.py`.
siemplify.check_marketpalce_status()
```

### close_alert

    close_alert(root_cause, comment, reason, case_id, alert_id)

This function closes the current alert. It is the same as manually closing the
alert from the case overview. Function requires the reason for closure, a root
cause and a comment, just like the close case alert.  

Closing an alert closes the new case with only one alert.

> [!NOTE]
> **Note:** Related concepts: [Case manipulation](https://docs.cloud.google.com/chronicle/docs/soar/reference/case-manipulation.md.txt)

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| root_cause | {string} | Close case root cause | N/A | N/A |
| comment | {string} | A comment | N/A | N/A |
| reason | {string} | Alert close reason | `"Malicious"`, `"NotMalicious"`, `"Maintenance"`, `"Inconclusive"` | Case-sensitive string (not defined as a Python SDK enum; do not use `ApiSyncAlertCloseReasonEnum`, which defines integer values for sync APIs). |
| case_id | {string} | Case identifier that alert is in | 234 | N/A |
| alert_id | {string} | Alert identifier to close | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |

#### Returns

{dict} Result of the server operation with the following keys:

- `is_request_valid` (`bool`): Whether the request was valid.
- `errors` (`list[str] | None`): List of error messages, if any.
- `new_case_id` (`int | None`): ID of the new case created for the closed alert.

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
result = siemplify.close_alert(
    root_cause="False positive from scheduled scanner",
    comment="Verified authorized vulnerability scan",
    reason="NotMalicious",
    case_id="234",
    alert_id="ad6879f1-b72d-419f-990c-011a2526b16d",
)
```

### close_case

    close_case(root_cause, comment, reason, case_id, alert_identifier)

Close a case.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| root_cause | {string} | The root cause for closing a case | N/A | N/A |
| comment | {string} | A comment | N/A | N/A |
| reason | {string} | Close case reason | `"Malicious"`, `"NotMalicious"`, `"Maintenance"`, `"Inconclusive"` | Case-sensitive string (not defined as a Python SDK enum; do not use `ApiSyncAlertCloseReasonEnum`, which defines integer values for sync APIs). |
| case_id | {string} | Case identifier | 234 | N/A |
| alert_identifier | {string} | Alert identifier | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.close_case(
    root_cause="Phishing email quarantined",
    comment="Removed malicious email from all mailboxes",
    reason="Malicious",
    case_id="234",
    alert_identifier="ad6879f1-b72d-419f-990c-011a2526b16d",
)
```

### create_case

    create_case(case_info)

Creates a case in the platform using the alert and event data in the
`case_info` dictionary.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_info | {dict} | Dictionary containing the case, alert, and event fields to ingest. | Required keys: `source_system_name` {string} `ticket_id` {string} `name` {string} `device_vendor` {string} `rule_generator` {string} Common optional keys: `display_id` {string} `description` {string} `device_product` {string} `environment` {string} (defaults to `Default Environment`) `start_time` {long} (Unix epoch in milliseconds) `end_time` {long} (Unix epoch in milliseconds) `priority` {int} (`-1` Informative, `40` Low, `60` Medium, `80` High, `100` Critical) `events` {list\[dict\]} (list of event dicts; nest flattened event key-value pairs under `raw_data_fields` or `fields`) | Must be a JSON-serializable `dict`. |

#### Returns

`NoneType`

#### Example

```python
import uuid
from Siemplify import Siemplify
from SiemplifyUtils import dict_to_flat, unix_now

siemplify = Siemplify()

alert_id = str(uuid.uuid4())
now_ms = unix_now()

raw_event = {
    "name": "Suspicious Login",
    "SourceAddress": "192.0.2.10",
    "SourceUserName": "jdoe",
    "device_product": "CustomAuth",
}

case_info = {
    "source_system_name": "CustomSIEM",
    "ticket_id": alert_id,
    "display_id": alert_id,
    "name": "Suspicious Login Detected",
    "description": "Multiple failed login attempts followed by a success.",
    "device_vendor": "CustomVendor",
    "device_product": "CustomAuth",
    "rule_generator": "Custom_Login_Rule",
    "environment": "Default Environment",
    "start_time": now_ms,
    "end_time": now_ms,
    "priority": 60,
    "events": [{"raw_data_fields": dict_to_flat(raw_event)}],
}

siemplify.create_case(case_info)
```

#### Result behavior

The server validates the `case_info` payload and enqueues it into the ingestion
queue for asynchronous processing into a case, alert, and entities.

#### Result value

None

### create_case_insight_internal

    create_case_insight_internal(case_id, alert_identifier, triggered_by, title, content, entity_identifier, severity, insight_type, additional_data=None, additional_data_type=None, additional_data_title=None, original_requesting_user=None, entity_type=None)

Add insight.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id | {string} | Case identifier | 234 | N/A |
| alert_identifier | {string} | Alert identifier | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |
| triggered_by | {string} | Integration name | N/A | N/A |
| title | {string} | Insight title | N/A | N/A |
| content | {string} | Insight message | N/A | N/A |
| entity_identifier | {string} | Entity identifier | N/A | N/A |
| severity | {int} | Severity identifier | 0 = info, 1 = warning, 2 = error | N/A |
| insight_type | {int} | Insight type | 0 = general, 1 = entity | N/A |
| additional_data | N/A | N/A | N/A | N/A |
| additional_data_type | N/A | N/A | N/A | N/A |
| additional_data_title | N/A | N/A | N/A | N/A |
| original_requesting_user | N/A | N/A | N/A | N/A |
| entity_type | {string} | Entity type | "ADDRESS" | N/A |

#### Returns

{boolean} `True` if success.

#### Example

```python
from Siemplify import Siemplify
from SiemplifyDataModel import InsightSeverity, InsightType

siemplify = Siemplify()
siemplify.create_case_insight_internal(
    case_id="234",
    alert_identifier="ad6879f1-b72d-419f-990c-011a2526b16d",
    triggered_by="VirusTotal",
    title="Malicious IP Detected",
    content="IP 192.0.2.50 flagged by 12 vendors.",
    entity_identifier="192.0.2.50",
    severity=InsightSeverity.WARN,
    insight_type=InsightType.Entity,
    entity_type="ADDRESS",
)
```

### create_connector_package

    create_connector_package(connector_package)

Create a connector package in the system to ingest a batch of cases (used by remote connectors).

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| connector_package | {dict} | Dictionary representing a package of cases to ingest. | `Cases` {list\[dict\]} (required list of case dictionaries; each dict uses the PascalCase equivalents of the `case_info` fields in [`create_case`](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-module.md.txt#create_case)) `Type` {int} (optional case classification: `0` External, `1` Test, `2` Request) `ConnectorIdentifier` {string} (optional connector instance identifier) | Uses PascalCase keys (this endpoint does not use `?format=snake`). |

#### Returns

`NoneType`

#### Example

```python
import uuid
from Siemplify import Siemplify
from SiemplifyUtils import unix_now

siemplify = Siemplify()
now_ms = unix_now()
connector_package = {
    "Cases": [
        {
            "SourceSystemName": "CustomSIEM",
            "TicketId": str(uuid.uuid4()),
            "Name": "Suspicious Activity",
            "DeviceVendor": "CustomVendor",
            "DeviceProduct": "CustomProduct",
            "RuleGenerator": "Custom_Rule",
            "StartTime": now_ms,
            "EndTime": now_ms,
            "Priority": 60,
            "Events": [{"RawDataFields": {"Name": "Login", "SourceAddress": "192.0.2.10"}}],
        }
    ],
    "Type": 0,
}
siemplify.create_connector_package(connector_package)
```

### dismiss_alert

    dismiss_alert(alert_group_identifier, should_close_case_if_all_alerts_were_dismissed, case_id)

> [!WARNING]
> **Deprecated:** This function is deprecated. Use `close_alert` instead.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| alert_group_identifier | {string} | Alert group identifier | N/A | N/A |
| should_close_case_if_all_alerts_were_dismissed | {boolean} | Whether to close the case if all alerts in it are dismissed | `True` / `False` | N/A |
| case_id | {string/int} | Case identifier | 234 | N/A |

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.dismiss_alert(
    alert_group_identifier="ad6879f1-b72d-419f-990c-011a2526b16d",
    should_close_case_if_all_alerts_were_dismissed=True,
    case_id="234",
)
```

### end

    end(message, result_value, execution_state=0)

End the script.  

No other code after the `end()` function is executed.  

The end result value is written in the stdout.  

The end function is not mandatory for scheduled jobs.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| message | {string} | Output message to be displayed to the client | Action completed | N/A |
| result_value | {int/string/dict} | Return value | N/A | N/A |
| execution_state | {int} | Indicator for the current action's state. Mainly used in async actions for marking whether the action has completed or not. | 0 (EXECUTION_STATE_COMPLETED), 1 (EXECUTION_STATE_INPROGRESS), 2 (EXECUTION_STATE_FAILED), 3 (EXECUTION_STATE_TIMEDOUT) | Default is 0 |

#### Returns

Returning the result data to the host process.

> [!IMPORTANT]
> **Important:** If the end function is not called, the script shows the following error: `Script did not return expected data. Did you call
> build_result/end_script? Check DebugOutput for details.`

#### Example

```python
from SiemplifyAction import SiemplifyAction

siemplify = SiemplifyAction()
siemplify.end(
    message="Successfully enriched 3 entities.",
    result_value=True,
    execution_state=0,
)
```

### end_script

    end_script()

> [!WARNING]
> **Deprecated:** Do not use. Kept for backward compatibility with legacy scripts. Use `end()` instead.

#### Parameters

None

#### Returns

`NoneType` (terminates the script process via `sys.exit(0)`)

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.end_script()
```

### escalate_case

    escalate_case(comment, case_id, alert_identifier)

Escalate a case.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| comment | {string} | Escalate comment | N/A | N/A |
| case_id | {string} | Case identifier | 234 | N/A |
| alert_identifier | {string} | Alert identifier | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |

#### Returns

{dict} Parsed JSON response from the server (note: the `Escalate` endpoint is not mapped on the server in current versions).

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.escalate_case(
    comment="Escalating to Tier 2 for lateral movement investigation.",
    case_id="234",
    alert_identifier="ad6879f1-b72d-419f-990c-011a2526b16d",
)
```

### extract_configuration_param

    extract_configuration_param(provider_name, param_name, default_value=None, input_type=<class 'str'>, is_mandatory=False, print_value=False)

Get a configuration parameter from the integration instance.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| provider_name | {string} | Name of the integration | N/A | N/A |
| param_name | {string} | Name of the parameter | N/A | N/A |
| default_value | {any} | If the parameter is not passed, use this value by default | N/A | None by default (optional) |
| input_type | {obj} | Cast the parameter to a different type | N/A | For example, int. str by default (optional) |
| is_mandatory | {bool} | Raise an exception if the parameter is empty | N/A | `False` by default (optional) |
| print_value | {bool} | Print the value to the log | N/A | `False` by default (optional) |

#### Returns

The parameter value (string by default), unless `input_type` is specified.

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
api_key = siemplify.extract_configuration_param(
    provider_name="VirusTotal",
    param_name="API Key",
    is_mandatory=True,
    print_value=False,
)
```

### *static* generate_serialized_object

    generate_serialized_object(object_filter)

Serializes a `CasesFilter` object into a JSON-compatible dictionary, converting filter list attributes into `CaseFilterValue` objects.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| object_filter | {CasesFilter} | Filter object containing case filter criteria | N/A | See `SiemplifyDataModel.CasesFilter` |

#### Returns

{dict} Serialized filter dictionary

#### Example

```python
from Siemplify import Siemplify
from SiemplifyDataModel import CasesFilter

filter_obj = CasesFilter(statuses=[1], environments=["Default Environment"])
serialized = Siemplify.generate_serialized_object(filter_obj)
```

### get_agent_by_id

    get_agent_by_id(agent_id)

Gets the agent details by ID.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| agent_id | {str} | The ID of the agent | N/A | N/A |

#### Returns

{dict} The agent details with the following keys:

- `id` (`int`): Internal agent ID.
- `identifier` (`str`): Agent UUID identifier.
- `name` (`str`): Agent display name.
- `environments` (`list[str]`): List of assigned environment names.
- `publisher_id` (`int`): Associated publisher ID.
- `publisher_name` (`str`): Associated publisher name.
- `publisher_slave_name` (`str | None`): Associated secondary publisher name, if any.
- `access_link` (`str`): Agent access link.
- `status` (`int`): Agent status enum value.
- `certificate` (`str`): Agent certificate.
- `logging_level` (`int`): Agent logging level enum value.
- `primary_agent_identifier` (`str | None`): Primary agent identifier for secondary agents.

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
agent = siemplify.get_agent_by_id("f47ac10b-58cc-4372-a567-0e02b2c3d479")
```

### get_alerts_ticket_ids_from_cases_closed_since_timestamp

    get_alerts_ticket_ids_from_cases_closed_since_timestamp(timestamp_unix_ms, rule_generator)

Get alerts from cases that were closed since timestamp.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| timestamp_unix_ms | {long} | Timestamp | 1550409785000L | N/A |
| rule_generator | {string} | N/A | 'Phishing email detector' | N/A |

#### Returns

{list} alerts

#### Example

```python
from Siemplify import Siemplify
from SiemplifyUtils import unix_now

siemplify = Siemplify()
since_ms = unix_now() - 86400 * 1000
ticket_ids = siemplify.get_alerts_ticket_ids_from_cases_closed_since_timestamp(
    timestamp_unix_ms=since_ms,
    rule_generator="Phishing_Rule",
)
```

### get_attachment

    get_attachment(attachment_id)

Get attachment data by identifier.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| attachment_id | {string} | Attachment identifier | N/A | N/A |

#### Returns

{BytesIO} attachment data

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
attachment_bytes = siemplify.get_attachment(attachment_id="105")
```

### get_attachments

    get_attachments(case_id)

Get attachments from the case.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id | {string} | Case identifier | 234 | N/A |

#### Returns

{\[dict\]} List of attachment metadata dictionaries, each with the following keys:

- `id` (`int`): Attachment ID.
- `name` (`str`): Attachment filename.
- `type` (`str`): File extension/type (for example, `".txt"`).
- `description` (`str | None`): Attachment description.
- `is_favorite` (`bool`): Whether the attachment is marked as a favorite.

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
attachments = siemplify.get_attachments(case_id="234")
```

#### Result value

`[{"is_favorite": False, "description": "", "type": ".txt", "id": 1, "name":
"test.py"}]`

### _get_case_by_id

    _get_case_by_id(case_id, get_source_file=False)

Get a case using its case ID.

This function interacts with the following endpoint:
`external/v1/sdk/CaseFullDetails`

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id | {\[string\]} | Case ID | N/A | N/A |
| get_source_file | {boolean} | Whether to include the source file data | `True` / `False` | Optional (default is `False`) |

#### Returns

{dict} case data.

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
case_data = siemplify._get_case_by_id(case_id="234")
```

### get_case_closure_details

    get_case_closure_details(case_id_list)

Get case closure details.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id_list | {\[string\]} | List of case IDs | N/A | N/A |

#### Returns

{\[dict\]} list of dict containing case closure details.

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
closure_details = siemplify.get_case_closure_details(case_id_list=["234", "235"])
```

#### Result value

`[{'case_closed_action_type': 1, 'reason': NotMalicious', 'root_cause':
'Other'}]`

For the `case_closed_action_type` parameter, the possible values are as follows:

- 0 = Automatic
- 1 = Manual

### get_case_comments

    get_case_comments(case_id, fetch_updates=False)

This function gets the comments from the provided case.

> [!NOTE]
> **Note:** Related concepts: [Case manipulation](https://docs.cloud.google.com/chronicle/docs/soar/reference/case-manipulation.md.txt)

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id | {string} | Case identifier | 234 | N/A |
| fetch_updates | {boolean} | Whether to fetch comment updates | `True` / `False` | Optional (default is `False`) |

#### Returns

List

#### Example

    from SiemplifyAction import SiemplifyAction
    siemplify = SiemplifyAction()
    siemplify.get_case_comments(case_id)

#### Result behavior

All comments belonging to the case will be fetched.

#### Result value

    [
        {
                 u 'comment': u 'Test',
                 u 'case_id': 10085,
                 u 'is_favorite': False,
                 u 'alert_identifier': None,
                 u 'creator_user_id': u 'Admin',
                 u 'type': 5,
                 u 'id': 1,
                 u 'modification_time_unix_time_in_ms': 1563272078332L
          }, {
                 u 'comment': u 'jhfksdh',
                 u 'case_id': 10085,
                 u 'is_favorite': False,
                 u 'alert_identifier': None,
                 u 'creator_user_id': u 'Admin',
                 u 'type': 5,
                 u 'id': 2,
                 u 'modification_time_unix_time_in_ms': 1563272079941L

           }, {
                  u 'comment': u 'kjfhsdm',
                  u 'case_id': 10085,
                  u 'is_favorite': False,
                  u 'alert_identifier': None,
                  u 'creator_user_id': u 'Admin',
                  u 'type': 5,
                  u 'id': 3,
                   u 'modification_time_unix_time_in_ms': 1563272080598L
           }
     ]

### get_case_tasks

    get_case_tasks(case_id)

Retrieve all tasks by the Case ID.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id | {int/str} | Case ID | 234 | The function can receive either int or str |

#### Returns

{\[Task\]} the list of tasks objects belonging to the case.   

See [SiemplifyDataModel.Task](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#DataModelTask).

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
tasks = siemplify.get_case_tasks(case_id=234)
```

### get_cases_by_filter

    get_cases_by_filter(environments=None, analysts=None, statuses=None, case_names=None, tags=None, priorities=None, stages=None, case_types=None, products=None, networks=None, ticked_ids_free_search='', case_ids_free_search='', wall_data_free_search='', entities_free_search='', start_time_unix_time_in_ms=-1, end_time_unix_time_in_ms=-1)

Get cases by requested filters.

    *caseFilterValue* object - { 'Title':'Merged Case', 'Value': 'Merged', 'Title':'Involved Suspicious Entity', 'Value': 'InvolvedSuspiciousEntity', 'Title':'Manual', 'Value': 'Manual', 'Title':'Simulated Alerts', 'Value': 'Simulated',}

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| environments | {\[string\]} | List of environment names (environment) | N/A | If no environments are provided, `None` is used (optional) |
| analysts | {\[string\]} | List of analysts names (case assigned user/role), | N/A | If no analyst is provided, `None` is used (optional) |
| statuses | {\[int\]} | List of statuses to filter by | N/A | Valid `statuses` values are: `1 = Open` `2 = Closed` If no statuses are provided, `None` is used, which returns both open and closed cases (optional) |
| case_names | {\[string\]} | List of case names | N/A | If no `case_names` are provided, `None` is used (optional) |
| tags | {\[string\]} | List of case tags | N/A | If no tags are provided, `None` is used (optional) |
| priorities | {\[int\]} | List of priorities |   | See [ApiSyncAlertPriorityEnum](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#ApiSyncAlertPriorityEnum). If no priorities is provided, `None` is used (optional) |
| stages | {\[string\]} | List of stages ([caseFilterValue object](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#CaseFilterValue)) | N/A | If no stages are provided, `None` is used (optional) |
| case_types | {\[int\]} | List of object types ([caseFilterValue object](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#CaseFilterValue)) | N/A | Valid `case_types` values are: `0 = Merged` `1 = Important` `2 = InvolvedSuspiciousEntity` `3 = Manual` `4 = Simulated` If no `case_types` are provided, `None` is used (optional) |
| products | {\[string\]} | List of products ([caseFilterValue object](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#CaseFilterValue)) | N/A | If no products are provided, `None` is used (optional) |
| networks | {\[string\]} | List of network ([caseFilterValue object](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#CaseFilterValue)) | N/A | If no networks are provided, `None` is used (optional) |
| ticked_ids_free_search | {string} | Ticket identifier | N/A | If not provided, default is '' (optional) |
| case_ids_free_search | {string} | Case identifier | N/A | If not provided, default is '' (optional) |
| wall_data_free_search | {string} | String to search | N/A | If not provided, default is '' (optional) |
| entities_free_search | {string} | Entity identifier | N/A | If not provided, default is '' (optional) |
| start_time_unix_time_in_ms | {long} | N/A | N/A | Default -1 (optional) |
| end_time_unix_time_in_ms | {long} | N/A | N/A | Default -1 (optional) |

#### Returns

Case_ids ''

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
case_ids = siemplify.get_cases_by_filter(
    environments=["Default Environment"],
    statuses=[1],
    priorities=[80, 100],
    stages=["Triage"],
)
```

### get_cases_by_ticket_id

    get_cases_by_ticket_id(ticket_id)

Get a case by ticket identifier.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| ticket_id | {string} | Ticket identifier | N/A | N/A |

#### Returns

{\[int\]} list of case IDs.

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
cases = siemplify.get_cases_by_ticket_id(ticket_id="INC-90421")
```

### get_cases_ids_by_filter

    get_cases_ids_by_filter(status, start_time_from_unix_time_in_ms=None, start_time_to_unix_time_in_ms=None, close_time_from_unix_time_in_ms=None, close_time_to_unix_time_in_ms=None, update_time_from_unix_time_in_ms=None, update_time_to_unix_time_in_ms=None, operator=None, sort_by='START_TIME', sort_order='DESC', max_results=1000, environments=None, tags=None)

Get case IDs by filter.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| status | {str} | Case status to retrieve | 'OPEN', 'CLOSE', 'BOTH' | N/A |
| start_time_from_unix_time_in_ms | {int} | Case start time start range inclusive | N/A | Default is 30 days prior (optional) |
| start_time_to_unix_time_in_ms | {int} | Case start time end range inclusive | N/A | Default is time now (optional) |
| close_time_from_unix_time_in_ms | {int} | Case close time start range inclusive | N/A | Default is 30 days prior (optional) |
| close_time_to_unix_time_in_ms | {int} | Case close time end range inclusive. | N/A | Default is time now (optional) |
| update_time_from_unix_time_in_ms | {int} | Case modification time start range inclusive | N/A | Default is start time (optional) |
| update_time_to_unix_time_in_ms | {int} | Case modification time end range inclusive | N/A | Default is time now (optional) |
| operator | {str} | Operator for time filters | OR, AND | Optional |
| sort_by | {str} | Sort results by time | START_TIME, UPDATE_TIME, CLOSE_TIME | Optional |
| sort_order | {str} | Sort order | ASC, DESC | Default is descending order (optional) |
| max_results | {int} | Max results to return | N/A | Default value is 1000, maximum value is 10000 (optional) |
| environments | {list\[str\]} | One or more environment names to filter by | `["Environment A", "Environment B"]` | Optional (default is `None`) |
| tags | {list\[str\]} | One or more tags to filter by | `["Tag A", "Tag B"]` | Optional (default is `None`) |

> [!NOTE]
> **Note:**
>
> - Sort order of type CLOSE_TIME must be provided with 'CLOSE' status only
> - Close time range filter is disregarded with 'BOTH' and 'OPEN' statuses

#### Returns

{\[int\]} List of matching case IDs.

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
case_ids = siemplify.get_cases_ids_by_filter(
    status="OPEN",
    environments=["Default Environment"],
    tags=["Phishing"],
)
```

### get_configuration

    get_configuration(provider, environment, integration_instance)

Get integration configuration.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| provider | {string} | Integration name | "VirusTotal" | N/A |
| environment | {string} | Configuration for specific environment or 'all' | N/A | N/A |
| integration_instance | {string} | Identifier of the integration instance | N/A | N/A |

#### Returns

{dict} Integration configuration parameter names (string) mapped to their values (string).

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
config = siemplify.get_configuration(provider="VirusTotal")
```

### get_configuration_by_provider

    get_configuration_by_provider(identifier)

Get integration configuration.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| identifier | {string} | Integration name | "VirusTotal" | N/A |

#### Returns

{dict} Integration configuration parameter names (string) mapped to their values (string).

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
config = siemplify.get_configuration_by_provider(identifier="VirusTotal")
```

### get_existing_custom_list_categories

    get_existing_custom_list_categories()

Get all existing custom list categories.  

This function returns a list object of all the categories in the *CustomList*
settings irrespective of environments.

#### Parameters

N/A

#### Returns

{\[unicode\]} list of unicode type with existing categories.

#### Example

    from SiemplifyAction import SiemplifyAction siemplify = SiemplifyAction() result = siemplify.get_existing_custom_list_categories()

#### Result behavior

A list of all existing custom lists is returned.

#### Result value

\["DenyListed IPs", "AllowListed HOSTs"\]

### get_external_configuration

    get_external_configuration(config_provider, config_name)

Get external integration configuration.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| config_provider | {string} | N/A | N/A | N/A |
| config_name | {string} | N/A | N/A | N/A |

#### Returns

{dict} Configuration key-value pairs

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
ext_config = siemplify.get_external_configuration(
    config_provider="CustomProvider",
    config_name="DefaultConfig",
)
```

### get_integration_version

    get_integration_version(integration_identifier)

Get an integration version.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| integration_identifier | {string} | Integration identifier | N/A | N/A |

#### Returns

{float} integration version

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
version = siemplify.get_integration_version(integration_identifier="VirusTotal")
```

### get_publisher_by_id

    get_publisher_by_id(publisher_id)

Get publisher details by ID.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| publisher_id | {string} | The id of the publisher | N/A | N/A |

#### Returns

{dict} The publisher details with the following keys:

- `id` (`int`): Internal publisher ID.
- `name` (`str`): Publisher name.
- `server_api_root` (`str`): Server API root URL.
- `agent_communication_time_in_seconds` (`int`): Agent communication interval in seconds.
- `api_token` (`str`): Publisher API token.
- `publisher_logs_link` (`str`): Link to publisher logs.
- `slave_publisher_id` (`int | None`): Secondary publisher ID, if any.
- `certificate` (`str`): Publisher certificate.

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
publisher = siemplify.get_publisher_by_id(publisher_id="1")
```

### get_remote_connector_keys_map

    get_remote_connector_keys_map(publisher_id)

Get remote connectors encryption keys by publisher ID.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| publisher_id | {string} | The id of the publisher | N/A | N/A |

#### Returns

{dict} Dictionary mapping remote connector identifiers (string) to their encryption keys (string).

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
keys_map = siemplify.get_remote_connector_keys_map(publisher_id="1")
```

### get_similar_cases

    get_similar_cases(case_id, ports_filter, category_outcome_filter, rule_generator_filter, entity_identifiers_filter, start_time_unix_ms, end_time_unix_ms)

Get similar cases.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id | {string} | Case identifier | 234 | N/A |
| ports_filter | {\\\[string\\\]} | Port values to filter by (pass `[]` when unused) | `["443"]` | Must be a list of strings (do not pass `None`) |
| category_outcome_filter | {\\\[string\\\]} | Category outcome values to filter by (pass `[]` when unused) | `["Malware"]` | Must be a list of strings (do not pass `None`) |
| rule_generator_filter | {\\\[string\\\]} | Rule generator names to filter by (pass `[]` when unused) | `[]` | Must be a list of strings (do not pass `None`) |
| entity_identifiers_filter | {\\\[string\\\]} | Entity identifiers to filter by (pass `[]` when unused) | `["192.0.2.1"]` | Must be a list of strings (do not pass `None`) |
| start_time_unix_ms | N/A | N/A | N/A | N/A |
| end_time_unix_ms | N/A | N/A | N/A | N/A |

#### Returns

{list\[int\]} List of similar case IDs.

#### Example

```python
from Siemplify import Siemplify
from SiemplifyUtils import unix_now

siemplify = Siemplify()
end_ms = unix_now()
start_ms = end_ms - 7 * 86400 * 1000
similar_case_ids = siemplify.get_similar_cases(
    case_id="234",
    ports_filter=["443"],
    category_outcome_filter=["Malware"],
    rule_generator_filter=[],
    entity_identifiers_filter=["192.0.2.1"],
    start_time_unix_ms=start_ms,
    end_time_unix_ms=end_ms,
)
```

### get_sync_alerts

    get_sync_alerts(alert_group_ids)

Retrieve alerts information needed for systems synchronization.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| alert_group_ids | {\[string\]} | List of alert group ID strings to retrieve (up to 1,000 items) | `["ad6879f1-b72d-419f-990c-011a2526b16d"]` | N/A |

#### Returns

{\[[SyncAlert](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#class-siemplifydatamodelsyncalert)\]} List of `SyncAlert` objects.

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
sync_alerts = siemplify.get_sync_alerts(
    alert_group_ids=["ad6879f1-b72d-419f-990c-011a2526b16d"]
)
```

### get_sync_cases

    get_sync_cases(case_ids)

Retrieve the case information needed for systems synchronization.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_ids | {\[int\]} | A list of case IDs to retrieve (up to 1,000 items) | `[234, 235]` | N/A |

#### Returns

{\[[SyncCase](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#class-siemplifydatamodelsynccase)\]} List of `SyncCase` objects.

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
sync_cases = siemplify.get_sync_cases(case_ids=[234, 235])
```

### get_system_info

    get_system_info(start_time_unixtime_ms)

Retrieve system information since the specified timestamp.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| start_time_unixtime_ms | {long} | Start timestamp in Unix epoch milliseconds | 1550409785000 | N/A |

#### Returns

{dict} System information and usage metrics dictionary since `start_time_unixtime_ms`.

#### Example

```python
from Siemplify import Siemplify
from SiemplifyUtils import unix_now

siemplify = Siemplify()
one_hour_ago = unix_now() - 3600 * 1000
system_info = siemplify.get_system_info(one_hour_ago)
```

#### Result value

```json
{
  "version_number": "6.3.10",
  "last_upgrade_date": "2026-11-01T12:00:00",
  "users_created": 2,
  "unique_users_last_day": 14,
  "unique_users_last_month": 42,
  "average_users_per_day": 11.5,
  "playbooks_executed": 128,
  "playbooks_created": 3,
  "playbooks_edited": 7,
  "workbooks_with_close_action": 12,
  "average_closed_cases_per_day": 18.2,
  "average_cases_per_day": 21.4,
  "average_alerts_per_day": 34.0,
  "average_opened_cases_per_user": 3.5,
  "incidents_invoked_count": 4,
  "important_cases_count": 2,
  "case_reports_generated": 5,
  "case_comments_added": 29,
  "average_tasks_per_case": 1.8,
  "average_insights_per_case": 4.2,
  "searches_executed": 65,
  "sla_count": 6,
  "new_integrations": ["VirusTotal"],
  "new_connectors": ["Mail"],
  "custom_actions_created": 1,
  "custom_actions_edited": 2,
  "manual_actions_used": 9,
  "action_playbook_appearances": [{"action_name": "Enrich IP", "playbook_appearances": 5}],
  "reports_generated": 3,
  "report_templates_edited": 1,
  "widgets_created": 4,
  "widgets_edited": 2,
  "dashboard_shows": 50
}
```

### get_system_version

    get_system_version()

Get the current Google Security Operations SOAR version.

#### Parameters

N/A

#### Returns

{string} current Google Security Operations SOAR version

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
version = siemplify.get_system_version()
```

### get_temp_folder_path

    get_temp_folder_path()

Gets the path to the temp folder.

#### Parameters

N/A

#### Returns

{string} path to temp folder

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
temp_dir = siemplify.get_temp_folder_path()
```

### get_ticket_ids_for_alerts_dismissed_since_timestamp

    get_ticket_ids_for_alerts_dismissed_since_timestamp(timestamp_unix_ms)

> [!WARNING]
> **Deprecated:** This function is deprecated.

Get ticket IDs for alerts dismissed since the given timestamp.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| timestamp_unix_ms | {long} | Start timestamp in Unix epoch milliseconds | 1550409785000 | N/A |

#### Returns

{\[string\]} List of dismissed alert ticket IDs.

#### Example

```python
from Siemplify import Siemplify
from SiemplifyUtils import unix_now

siemplify = Siemplify()
since_ms = unix_now() - 86400 * 1000
ticket_ids = siemplify.get_ticket_ids_for_alerts_dismissed_since_timestamp(since_ms)
```

### get_updated_sync_alerts_metadata

    get_updated_sync_alerts_metadata(start_timestamp_unix_ms, count, allowed_environments=None, vendor=None, include_non_synced_alerts=True)

Retrieve updated tracked alerts metadata.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| start_timestamp_unix_ms | {long} | Search for updated alerts starting at `start_timestamp_unix_ms` or later | N/A | If `end_timestamp_unix_ms` is `None`, the end time is the time of the request. |
| count | {int} | Maximum alerts group IDs to fetch | N/A | N/A |
| allowed_environments | {\[string\]} | Environments to search in | N/A | If `allowed_environments` is None, search in all environments |
| vendor | {string} | Filter alerts by vendor | N/A | N/A |
| include_non_synced_alerts | {boolean} | If `True`, include alerts not yet synced with Chronicle SIEM | `True` / `False` | Optional (default is `True`) |

#### Returns

{\[SyncAlertMetadata\]} List of `SyncAlertMetadata` objects, sorted by
`SyncAlertMetadata.tracking_time`.

#### Example

```python
from Siemplify import Siemplify
from SiemplifyUtils import unix_now

siemplify = Siemplify()
since_ms = unix_now() - 3600 * 1000
metadata = siemplify.get_updated_sync_alerts_metadata(
    start_timestamp_unix_ms=since_ms,
    count=50,
    allowed_environments=["Default Environment"],
)
```

### get_updated_sync_cases_metadata

    get_updated_sync_cases_metadata(start_timestamp_unix_ms, count, allowed_environments=None, vendor=None)

Retrieve updated tracked cases metadata.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| start_timestamp_unix_ms | {long} | Search for updated cases starting at `start_timestamp_unix_ms` or later | N/A | If `end_timestamp_unix_ms` is None, end time will be the time of the request |
| count | {int} | Maximum cases ids to fetch | N/A | N/A |
| allowed_environments | {\[string\]} | Environments to search in | N/A | If `allowed_environments` is None, search in all environments |
| vendor | {string} | Return only cases with alerts originated in `vendor` | N/A | N/A |

#### Returns

`{[SyncCaseMetadata]}` List of `SyncCaseMetadata` objects, sorted by
`SyncCaseMetadata.tracking_time`.

#### Example

```python
from Siemplify import Siemplify
from SiemplifyUtils import unix_now

siemplify = Siemplify()
since_ms = unix_now() - 3600 * 1000
metadata = siemplify.get_updated_sync_cases_metadata(
    start_timestamp_unix_ms=since_ms,
    count=50,
    allowed_environments=["Default Environment"],
)
```

### init_proxy_settings

    init_proxy_settings()

#### Parameters

N/A

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.init_proxy_settings()
```

### is_existing_category

    is_existing_category(category)

Checks if the given category exists.  

Given a category name, this function returns `True` (Boolean) if the exact
*category name* string is defined as a category in the *CustomList* settings.  

This function ignores the environment and returns `True` if the item exists;
otherwise, it returns `False`.

> [!NOTE]
> **Note:** Related concepts: [Custom lists](https://docs.cloud.google.com/chronicle/docs/soar/reference/custom-lists.md.txt)

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| category | {string} | The category to check if exists | "DenyListed IPs" | N/A |

#### Returns

{bool} True if the category exists, False otherwise.

#### Example 1

    from SiemplifyAction import SiemplifyAction
    siemplify = SiemplifyAction()
    result = siemplify.is_existing_category("WhiteListed HOSTs")

#### Example 2

    from SiemplifyAction import SiemplifyAction
    siemplify = SiemplifyAction()
    result = siemplify.is_existing_category("SpecialHosts")

#### Result behavior

The result in Sample Code 1 returns `True`, and the result in the Sample Code 2
returns `False`.

#### Result value

True or False

### mark_case_as_important

    mark_case_as_important(case_id, alert_identifier)

This function marks the current case with the given alert identifier as
important.

> [!NOTE]
> **Note:** Related concepts: [Case manipulation](https://docs.cloud.google.com/chronicle/docs/soar/reference/case-manipulation.md.txt)

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id | {string} | Case identifier | 234 | N/A |
| alert_identifier | {string} | Alert identifier | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |

#### Returns

`NoneType`

#### Example

    from SiemplifyAction import SiemplifyAction
    siemplify = SiemplifyAction()
    alert_identifier = "ad6879f1-b72d-419f-990c-011a2526b16d"
    case_id = "234"
    siemplify.mark_case_as_important(case_id=case_id, alert_identifier=alert_identifier)

#### Result behavior

The case with the provided alert identifier is marked as important.

#### Result value

None

### raise_incident

    raise_incident(case_id, alert_identifier)

This function raises the current case with the alert identifier as incident.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id | {string} | Case identifier | 234 | N/A |
| alert_identifier | {string} | Alert identifier | ad6879f1-b72d-419f-990c-011a2526b16d | N/A |

#### Returns

`NoneType`

#### Example

    from SiemplifyAction import SiemplifyAction
    siemplify = SiemplifyAction()
    alert_identifier = "ad6879f1-b72d-419f-990c-011a2526b16d"
    case_id = "234"
    siemplify.raise_incident(case_id=case_id, alert_identifier=alert_identifier)

#### Result behavior

The case 234 will be raised as an incident.

#### Result value

None

### remove_entities_from_custom_list

    remove_entities_from_custom_list(custom_list_items)

Remove the entities from the custom list with the given category.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| custom_list_items | {\[CustomList\]} | A list of custom list items | N/A | N/A |

#### Returns

{\[CustomList\]} list of removed `CustomList` objects.

#### Example

```python
from Siemplify import Siemplify
from SiemplifyDataModel import CustomList

siemplify = Siemplify()
items = [
    CustomList(identifier="192.0.2.50", category="BlockedIPs", environment="Default Environment")
]
siemplify.remove_entities_from_custom_list(items)
```

### remove_temp_folder

    remove_temp_folder()

Deletes the temp folder and its subfolders.

#### Parameters

N/A

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.remove_temp_folder()
```

### *property* result

    siemplify.result

Returns the `ScriptResult` instance used to attach outputs, JSON results, links, and tables to the script execution.

#### Parameters

None

#### Returns

`ScriptResult` object (see [ScriptResult module](https://docs.cloud.google.com/chronicle/docs/soar/reference/script-result-module.md.txt))

#### Example

```python
from SiemplifyAction import SiemplifyAction

siemplify = SiemplifyAction()
siemplify.result.add_result_json({"status": "ok", "findings": 3})
```

### send_system_notification

    send_system_notification(message, message_id='SDK_CUSTOM_NOTIFICATION')

Send system notification with an optional message ID.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| message | {string} | Notification message | N/A | N/A |
| message_id | {string} | Notification message identifier | N/A | N/A |

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.send_system_notification(
    message="Integration API rate limit reached.",
    message_id="RATE_LIMIT_WARNING",
)
```

### send_system_notification_message

    send_system_notification_message(message, message_id)

Send a system notification message with an explicit notification identifier. Delegates to `send_system_notification`.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| message | {string} | Notification message text | N/A | N/A |
| message_id | {string} | Notification message identifier | CUSTOM_ALERT_NOTIFICATION | N/A |

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.send_system_notification_message(
    message="Custom integration threshold exceeded.",
    message_id="CUSTOM_THRESHOLD_ALERT",
)
```

### set_alert_sla

    set_alert_sla(period_time, period_type, critical_period_time, critical_period_type, case_id, alert_identifier)

Sets the SLA of the given `alert_identifier` of `case_id`. SLA being set using
this API should surpass all other alert SLA types.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| period_time | {int/str} | Represents the total SLA period | N/A | period_time \> 0 |
| period_type | {str} | Time units of period_time, represented by [ApiPeriodTypeEnum](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#ApiPeriodTypeEnum) | N/A | N/A |
| critical_period_time | {int/str} | Represents the critical SLA period | N/A | critical_period_time \>= 0 Critical period (after scaling with its time units) should be smaller than the total period |
| critical_period_type | {str} | Time units of critical_period_time, represented by [ApiPeriodTypeEnum](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#ApiPeriodTypeEnum) | N/A | N/A |
| case_id | {long} | Case identifier | N/A | N/A |
| alert_identifier | {str} | Alert identifier | N/A | N/A |

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify
from SiemplifyDataModel import ApiPeriodTypeEnum

siemplify = Siemplify()
siemplify.set_alert_sla(
    period_time=24,
    period_type=ApiPeriodTypeEnum.HOURS,
    critical_period_time=4,
    critical_period_type=ApiPeriodTypeEnum.HOURS,
    case_id=234,
    alert_identifier="ad6879f1-b72d-419f-990c-011a2526b16d",
)
```

### set_case_sla

    set_case_sla(period_time, period_type, critical_period_time, critical_period_type, case_id)

Sets the SLA of the given `case_id`. SLA being set using this API should surpass
all other case SLA types.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| period_time | {int/string} | Represents the total SLA period | N/A | period_time \> 0 |
| period_type | {string} | Time units of period_time, represented by [ApiPeriodTypeEnum](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#ApiPeriodTypeEnum) | N/A | N/a |
| critical_period_time | {int/string} | Represents the critical SLA period | N/A | critical_period_time \>= 0 Critical period (after scaling with its time units) should be smaller than the total period |
| critical_period_type | {string} | Time units of critical_period_time, represented by [ApiPeriodTypeEnum](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#ApiPeriodTypeEnum) | N/A | N/A |
| case_id | {long} | Case identifier | 234 | N/A |

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify
from SiemplifyDataModel import ApiPeriodTypeEnum

siemplify = Siemplify()
siemplify.set_case_sla(
    period_time=48,
    period_type=ApiPeriodTypeEnum.HOURS,
    critical_period_time=8,
    critical_period_type=ApiPeriodTypeEnum.HOURS,
    case_id=234,
)
```

### update_alerts_additional_data

    update_alerts_additional_data(case_id, alerts_additional_data)

Update alerts additional data.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| case_id | {string} | Case identifier | Any valid case ID (e.g., `"234"`) | N/A |
| alerts_additional_data | {dict\[string, string\]} | Dictionary mapping alert identifier (each must belong to `case_id`) to additional data (e.g., serialized JSON: `{"<alert_id>": "{\"key\": \"value\"}"}`) | `{"ad6879f1-b72d-419f-990c-011a2526b16d": "{\"severity_score\": 85}"}` | N/A |

#### Returns

`NoneType`

#### Example

```python
from Siemplify import Siemplify

siemplify = Siemplify()
siemplify.update_alerts_additional_data(
    case_id="234",
    alerts_additional_data={
        "ad6879f1-b72d-419f-990c-011a2526b16d": '{"severity_score": 85}'
    },
)
```

### update_entities

    update_entities(updated_entities)

This function updates entities.

#### Parameters

| Param name | Param type | Definition | Possible values | Comments |
|---|---|---|---|---|
| updated_entities | {\[[DomainEntityInfo](https://docs.cloud.google.com/chronicle/docs/soar/reference/siemplify-data-model-module.md.txt#class-siemplifydatamodeldomainentityinfo)\]} | List of `DomainEntityInfo` entity objects to update | N/A | N/A |

#### Returns

`NoneType`

#### Example

```python
from SiemplifyAction import SiemplifyAction

siemplify = SiemplifyAction()
for entity in siemplify.target_entities:
    entity.is_suspicious = True
siemplify.update_entities(siemplify.target_entities)
```

#### Result behavior

Using the scope, the selected alert adds new entities if they're not already
present.

#### Result value

None