# Target

## Get a list of targets.

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

Returns a paginated list of targets.

[https://app.halosecurity.com/user/security/targets/list](https://app.halosecurity.com/user/security/targets/list?)

#### Query Parameters

| Name       | Type    | Description                                                              |
| ---------- | ------- | ------------------------------------------------------------------------ |
| sort       | Integer | `0` = Name *(default)*                                                   |
| sort\_desc | Integer | <p><code>0</code> = No <em>(default)</em></p><p><code>1</code> = Yes</p> |

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

```javascript
{
    "list": [
        {
            "target": {
                "target_name": "example",
                "target_id": 1,
                "target": "www.example.com"
            }
        }
    ]
}
```

{% endtab %}
{% endtabs %}

## Get the details of a target.

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

Returns the details of a target.

[https://app.halosecurity.com/user/security/targets/list](https://app.halosecurity.com/user/security/targets/list?)

#### Query Parameters

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

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

```javascript
{
    "target": {
        "recent_scan_ids": [
            "id1",
            "id2",
            "id3",
            "id4",
            "id5"
        ],
        "target_name": "example",
        "date_created": "0000-00-00 00:00",
        "ip": "0.0.0.0",
        "target_id": 1,
        "target": "www.example.com",
        "geo": "US-CA",
        "scan_id": "id0",
        "scan_frequency": 1,
        "scan_hour": 1,
        "next_scan_date": "0000-00-00 00:00",
        "scan_pci": 0,
        "scan_network": 0,
        "scan_website": 0
    }
}
```

{% endtab %}

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

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

{% endtab %}
{% endtabs %}

## Update details of a target.

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

Update details of a target. Requires the `security_target_update` permission.

Learn about permissions: [Permissions](/api/readme/permissions.md)

[https://app.halosecurity.com/user/security/targets/list](https://app.halosecurity.com/user/security/targets/list?)

#### Query Parameters

| Name                                         | Type     | Description                                |
| -------------------------------------------- | -------- | ------------------------------------------ |
| target\_id<mark style="color:red;">\*</mark> | Integer  |                                            |
| name                                         | String   |                                            |
| tag                                          | String   | Multiple. Sets only these tags.            |
| tag\_add                                     | String   | Multiple. Add tags to existing.            |
| tag\_remove                                  | String   | Multiple. Remove tags from existing.       |
| next\_scan\_date                             | DateTime | YYYY-MM-DD HH24:MI UTC                     |
| scan\_hour                                   | Integer  | Hour of day to scan (0-23). -1 for random. |

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

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

{% endtab %}

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

```javascript
{
    "code": 0,
    "message": "next_scan_date not valid"
}
```

{% endtab %}

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

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

{% 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/target.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.
