# Event

## Get a list of events.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/event/list.json`

Returns a paginated list of events.

<https://app.halosecurity.com/user/security/events/list>

#### Query Parameters

| Name       | Type    | Description                                                              |
| ---------- | ------- | ------------------------------------------------------------------------ |
| sort       | Integer | <p><code>0</code></p><p>= name (default)</p>                             |
| sort\_desc | Integer | <p><code>0</code> = No <em>(default)</em></p><p><code>1</code> = Yes</p> |
| key        | String  | Filter by key                                                            |
| subject    | String  | Filter by subject                                                        |
| detail     | String  | Filter by detail                                                         |
| target\_id | Integer | Filter by target id                                                      |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "list": [
        {
            "event": {
                "event_id": "id1",
                "subject": "Scan Started",
                "date_created": "0000-00-00 00:00",
                "key": "target-scan-start",
                "url": "https://www.halosecurity.com/link?q=user-event&id=id1",
                "target": {
                    "target_name": "",
                    "target_id": 1,
                    "target": "www.example.com"
                }
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get the details of an event.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/event/get.json`

Returns the details of an event.

<https://app.halosecurity.com/user/security/events/list>

#### Query Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| event\_id<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "success": 1,
    "event": {
        "event_id": "id1",
        "subject": "Scan Started",
        "date_created": "0000-00-00 00:00",
        "key": "target-scan-start",
        "url": "https://www.halosecurity.com/link?q=user-event&id=id1",
        "target": {
            "target_name": "",
            "target_id": 1,
            "target": "www.example.com"
        }
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": 0,
    "message": "event_id required"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "code": 404,
    "message": "event not found"
}
```

{% endtab %}
{% endtabs %}

## Delete an event.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/event/delete.json`

Returns the event deletion status.

<https://app.halosecurity.com/user/security/events/list>

#### Query Parameters

| Name                                        | Type   | Description |
| ------------------------------------------- | ------ | ----------- |
| event\_id<mark style="color:red;">\*</mark> | String |             |

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "success": 1
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "code": 0,
    "message": "event_id required"
}
```

{% endtab %}

{% tab title="404: Not Found " %}

```javascript
{
    "code": 404,
    "message": "event not found"
}
```

{% endtab %}
{% endtabs %}

## Get a list of event types.

<mark style="color:blue;">`GET`</mark> `https://api.halosecurity.com/api/v1/event/types.json`

Returns a paginated list of event types.

<https://app.halosecurity.com/user/security/events/alert-rules>

{% tabs %}
{% tab title="200: OK " %}

```javascript
{
    "list": [
        {
            "subject": "API Key Added",
            "key": "account-apikey-add"
        }
    ]
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.halosecurity.com/api/endpoints/event.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
