GET Tags

GET Tags


Request used to get a list of all Tags for a given account

URL

https://REGION.rest.logs.insight.rapid7.com/management/tags

REGION is the data center for your account - e.g. "us" or "eu"

Method

GET

Authentication

Owner, Read Write or Read Only key is required.

URL Params

None

Data Params

None

Success Response

Code 200Content:

json
1
{
2
"tags": [
3
{
4
"type": "Alert",
5
"id": "cfd65778-45ff-4300-9b3e-98c752ac2661",
6
"name": "Login Failure",
7
"sources": [
8
{
9
"id": "cfd65778-45ff-4300-9b3e-98c752ac2661",
10
"retention_period": "default",
11
"name": "auth.log",
12
"stored_days": []
13
}
14
],
15
"actions": [
16
{
17
"id": "cfd65778-45ff-4300-9b3e-98c752ac2661",
18
"min_matches_count": 1,
19
"min_report_count": 1,
20
"min_matches_period": "Day",
21
"min_report_period": "Day",
22
"targets": [
23
{
24
"id": null,
25
"type": "Mailto",
26
"params_set": {
27
"direct": "user@example.com",
28
"teams": "",
29
"users": "user@example.com"
30
},
31
"alert_content_set": {}
32
}
33
],
34
"enabled": true,
35
"type": "Alert"
36
}
37
],
38
"patterns": [
39
"Power Button as"
40
],
41
"labels": [
42
{
43
"id": "cfd65778-45ff-4300-9b3e-98c752ac2661",
44
"sn": 1056,
45
"name": "Login Failure",
46
"color": "007afb",
47
"reserved": false
48
}
49
]
50
},
51
52
.....
53
54
}

Error Response

None

Sample Call

python
1
import requests
2
import json
3
import time
4
5
6
API_KEY = 'YOUR API KEY GOES HERE'
7
8
9
def handle_response(resp):
10
response = resp
11
time.sleep(5)
12
if response.status_code == 200:
13
print json.dumps(resp.json(), indent=4)
14
return
15
16
17
def make_request(provided_url=None):
18
headers = {'x-api-key': API_KEY}
19
20
url = "https://us.rest.logs.insight.rapid7.com/management/tags"
21
req = requests.get(url, headers=headers)
22
return req
23
24
25
def print_query():
26
req = make_request()
27
handle_response(req)
28
29
def start():
30
print_query()
31
32
33
if __name__ == '__main__':
34
start()