Operations (sample payloads)

Main operations
Copy

Add user to role
Copy

Adds a user to a role.

Sample Input

1
{
2
"role_id": "abcd1234-efgh-5678-ijkl-mnopqrstuvwx",
3
"user_id": "user9876-wxyz-5432-lmno-pqrstuvwxyz"
4
}

Sample Output

1
{
2
"meta": {
3
"page": {
4
"total_count": 1
5
}
6
},
7
"data": [
8
{
9
"type": "users",
10
"id": "user9876-wxyz-5432-lmno-pqrstuvwxyz",
11
"attributes": {
12
"name": "John Doe",
13
"handle": "john.doe",
14
"created_at": "2023-05-15T10:30:00Z",
15
"email": "john.doe@example.com",
16
"icon": "https://example.com/avatars/john_doe.png",
17
"title": "Software Engineer",
18
"verified": true,
19
"disabled": false,
20
"allowed_login_methods": [
21
"password",
22
"google_auth"
23
],
24
"status": "Active"
25
},
26
"relationships": {
27
"roles": {
28
"data": [
29
{
30
"type": "roles",
31
"id": "abcd1234-efgh-5678-ijkl-mnopqrstuvwx"
32
}
33
]
34
},
35
"org": {
36
"data": {
37
"type": "organizations",
38
"id": "org5678-abcd-9012-efgh-ijklmnopqrst"
39
}
40
}
41
}
42
}
43
]
44
}

Check if monitor can be deleted
Copy

Checks if a monitor can be deleted.

Sample Input

1
{
2
"monitor_ids": [
3
12345,
4
67890,
5
54321
6
]
7
}

Sample Output

1
{
2
"data": {
3
"ok": [
4
12345,
5
67890
6
]
7
},
8
"errors": "Monitor 54321 cannot be deleted due to dependencies."
9
}

Create event
Copy

Posts events to the stream. Tag them, set priority and event aggregate them with other events.

Sample Input

1
{
2
"title": "High CPU Usage Alert",
3
"text": "The server 'web-01' is experiencing high CPU usage (95%) for the last 15 minutes. Please investigate and take necessary actions.",
4
"date_happened": "1623456789",
5
"priority": "normal",
6
"host": "web-01",
7
"tags": [
8
"production",
9
"web-server",
10
"high-cpu"
11
],
12
"alert_type": "warning",
13
"aggregation_key": "high-cpu-web-01",
14
"source_type_name": "nagios",
15
"device_name": "web-01"
16
}

Sample Output

1
{
2
"event": {
3
"id": "1234567890",
4
"title": "High CPU Usage Alert",
5
"text": "The server 'web-01' is experiencing high CPU usage (95%) for the last 15 minutes. Please investigate and take necessary actions.",
6
"date_happened": 1623456789,
7
"handle": "1234567890123456789",
8
"priority": "normal",
9
"tags": [
10
"production",
11
"web-server",
12
"high-cpu"
13
],
14
"url": "https://app.datadoghq.com/event/event?id=1234567890"
15
}
16
}

Create monitor raw
Copy

Creates a monitor using the specified options.

Sample Input

1
{
2
"query": "avg(last_5m):avg:system.cpu.user{*} > 80",
3
"monitor_type": "metric alert",
4
"name": "High CPU Usage Alert",
5
"message": "CPU usage is above 80% for the last 5 minutes. @ops-team",
6
"tags": [
7
"env:production",
8
"service:web"
9
],
10
"options": {
11
"notify_no_data": true,
12
"no_data_timeframe": 10,
13
"timeout_h": 0,
14
"renotify_interval": 60,
15
"escalation_message": "CPU usage is still high! Please investigate ASAP.",
16
"include_tags": true,
17
"monitor_specific_options": {
18
"metric_alert_options": {
19
"thresholds": {
20
"critical": 80,
21
"warning": 70,
22
"critical_recovery": 75,
23
"warning_recovery": 65
24
},
25
"evaluation_delay": 300
26
}
27
}
28
},
29
"priority": 2
30
}

Sample Output

1
{
2
"id": 12345678,
3
"org_id": 987654,
4
"type": "metric alert",
5
"name": "High CPU Usage Alert",
6
"message": "CPU usage is above 80% for the last 5 minutes. @ops-team",
7
"tags": [
8
"env:production",
9
"service:web"
10
],
11
"query": "avg(last_5m):avg:system.cpu.user{*} > 80",
12
"options": {
13
"notify_no_data": true,
14
"no_data_timeframe": 10,
15
"timeout_h": 0,
16
"renotify_interval": 60,
17
"escalation_message": "CPU usage is still high! Please investigate ASAP.",
18
"include_tags": true,
19
"thresholds": {
20
"critical": 80,
21
"warning": 70,
22
"critical_recovery": 75,
23
"warning_recovery": 65
24
},
25
"evaluation_delay": 300
26
},
27
"multi": false,
28
"created_at": 1623456789,
29
"created": "2023-06-12T10:30:00Z",
30
"modified": "2023-06-12T10:30:00Z",
31
"deleted": null,
32
"restricted_roles": null,
33
"priority": 2,
34
"overall_state_modified": "2023-06-12T10:30:00Z",
35
"overall_state": "OK",
36
"creator": {
37
"name": "John Doe",
38
"handle": "john.doe@example.com",
39
"email": "john.doe@example.com",
40
"id": 123456
41
}
42
}

Create timeseries points
Copy

Posts time-series data that can be graphed on Datadog’s dashboards. The Maximum Limit of the payload is 5 megabytes (5242880 bytes).

Sample Input

1
{
2
"series": [
3
{
4
"metric": "system.cpu.usage",
5
"points": [
6
{
7
"POSIX_timestamp": "2023-05-15T10:30:00Z",
8
"numeric_value": 75.5
9
},
10
{
11
"POSIX_timestamp": "2023-05-15T10:31:00Z",
12
"numeric_value": 80.2
13
}
14
],
15
"type": 3,
16
"interval": 60,
17
"tags": [
18
"environment:production",
19
"server:web01"
20
],
21
"metadata": {
22
"origin": {
23
"metric_type": 1,
24
"product": 2,
25
"service": 3
26
}
27
},
28
"source_type_name": "system",
29
"resources": [
30
{
31
"name": "web-server-01",
32
"type": "instance"
33
}
34
],
35
"unit": "percent"
36
}
37
]
38
}

Sample Output

1
{
2
"message": "Timeseries points created successfully",
3
"errors": []
4
}

Create user
Copy

Creates a new user.

Sample Input

1
{
2
"email": "john.doe@example.com",
3
"name": "John Doe",
4
"title": "Software Engineer",
5
"roles": [
6
"role1",
7
"role2"
8
]
9
}

Sample Output

1
{
2
"included": [
3
{
4
"type": "roles",
5
"id": "role1",
6
"attributes": {
7
"name": "Developer",
8
"display_name": "Developer",
9
"description": "Role for software developers",
10
"created": "2023-05-15T10:30:00Z",
11
"group_name": "Engineering",
12
"display_type": "custom",
13
"restricted": false,
14
"created_at": "2023-05-15T10:30:00Z",
15
"modified_at": "2023-05-15T10:30:00Z"
16
},
17
"relationships": {
18
"permissions": {
19
"data": [
20
{
21
"type": "permissions",
22
"id": "perm1"
23
}
24
]
25
}
26
}
27
},
28
{
29
"type": "roles",
30
"id": "role2",
31
"attributes": {
32
"name": "Tester",
33
"display_name": "Tester",
34
"description": "Role for QA testers",
35
"created": "2023-05-15T11:00:00Z",
36
"group_name": "Quality Assurance",
37
"display_type": "custom",
38
"restricted": false,
39
"created_at": "2023-05-15T11:00:00Z",
40
"modified_at": "2023-05-15T11:00:00Z"
41
},
42
"relationships": {
43
"permissions": {
44
"data": [
45
{
46
"type": "permissions",
47
"id": "perm2"
48
}
49
]
50
}
51
}
52
}
53
],
54
"data": {
55
"type": "users",
56
"id": "user123",
57
"attributes": {
58
"name": "John Doe",
59
"handle": "john.doe",
60
"created_at": "2023-05-15T12:00:00Z",
61
"email": "john.doe@example.com",
62
"icon": "https://example.com/avatar.jpg",
63
"title": "Software Engineer",
64
"verified": true,
65
"disabled": false,
66
"allowed_login_methods": [
67
"password",
68
"sso"
69
],
70
"status": "active"
71
},
72
"relationships": {
73
"roles": {
74
"data": [
75
{
76
"type": "roles",
77
"id": "role1"
78
},
79
{
80
"type": "roles",
81
"id": "role2"
82
}
83
]
84
},
85
"org": {
86
"data": {
87
"type": "organizations",
88
"id": "org123"
89
}
90
}
91
}
92
}
93
}

Delete monitor
Copy

Deletes a monitor.

Sample Input

1
{
2
"monitor_id": 12345678,
3
"force": true
4
}

Sample Output

1
{
2
"deleted_monitor_id": 12345678
3
}

Disable user
Copy

Disables a user by their ID.

Sample Input

1
{
2
"user_id": "1a2b3c4d5e6f7g8h9i0j"
3
}

Sample Output

1
{
2
"success": true
3
}

Get event
Copy

Retrieves the event details. Note: if the event you’re querying contains markdown formatting of any kind, you may see characters such as %,\,n in your output

Sample Input

1
{
2
"event_id": "1234567890"
3
}

Sample Output

1
{
2
"event": {
3
"date_happened": 1623456789,
4
"alert_type": "error",
5
"resource": "web-server-01",
6
"title": "High CPU Usage Alert",
7
"url": "https://app.datadoghq.com/event/event?id=1234567890",
8
"text": "CPU usage on web-server-01 has exceeded 90% for the last 15 minutes.",
9
"tags": [
10
"env:production",
11
"service:web",
12
"team:backend"
13
],
14
"device_name": [
15
"web-server-01"
16
],
17
"priority": "high",
18
"host": "web-server-01.example.com",
19
"id": 1234567890
20
}
21
}

Get metric metadata
Copy

Retrieves the metadata about a specific metric.

Sample Input

1
{
2
"metric_name": "system.cpu.idle"
3
}

Sample Output

1
{
2
"description": "The percentage of time the CPU is idle.",
3
"short_name": "CPU Idle",
4
"integration": "system",
5
"statsd_interval": 20,
6
"per_unit": null,
7
"type": "gauge",
8
"unit": "percent"
9
}

Get monitor
Copy

Retrieves a monitor's details.

Sample Input

1
{
2
"monitor_id": 12345,
3
"group_states": [
4
"alert",
5
"warn"
6
],
7
"with_downtimes": true
8
}

Sample Output

1
{
2
"restricted_roles": "admin",
3
"tags": [
4
"app:web",
5
"env:production"
6
],
7
"deleted": null,
8
"query": "avg(last_5m):avg:system.cpu.user{*} > 75",
9
"message": "CPU usage is high",
10
"id": 12345,
11
"multi": false,
12
"name": "High CPU Usage Monitor",
13
"created": "2023-05-15T10:30:00Z",
14
"created_at": 1684146600,
15
"creator": {
16
"id": 67890,
17
"handle": "john.doe@example.com",
18
"name": "John Doe",
19
"email": "john.doe@example.com"
20
},
21
"org_id": 98765,
22
"modified": "2023-05-16T14:45:00Z",
23
"overall_state_modified": "2023-05-16T15:00:00Z",
24
"overall_state": "Alert",
25
"type": "metric alert",
26
"options": {
27
"thresholds": {
28
"warning": 60,
29
"ok": 50,
30
"critical": 75
31
},
32
"silenced": {
33
"*": 1684238400
34
}
35
}
36
}

Get role
Copy

Retrieves a role by its ID.

Sample Input

1
{
2
"role_id": "abc123def456"
3
}

Sample Output

1
{
2
"data": {
3
"type": "roles",
4
"id": "abc123def456",
5
"attributes": {
6
"name": "Admin Role",
7
"created_at": "2023-05-15T10:30:00Z",
8
"modified_at": "2023-05-16T14:45:00Z",
9
"user_count": 5
10
},
11
"relationships": {
12
"permissions": {
13
"data": [
14
{
15
"type": "permissions",
16
"id": "perm1"
17
},
18
{
19
"type": "permissions",
20
"id": "perm2"
21
},
22
{
23
"type": "permissions",
24
"id": "perm3"
25
}
26
]
27
}
28
}
29
}
30
}

Get user
Copy

Retrieves a user by their ID.

Sample Input

1
{
2
"user_id": "123e4567-e89b-12d3-a456-426614174000"
3
}

Sample Output

1
{
2
"included": [
3
{
4
"type": "roles",
5
"id": "role-123",
6
"attributes": {
7
"name": "Admin",
8
"display_name": "Administrator",
9
"description": "Full access to all features",
10
"created": "2023-05-15T10:30:00Z",
11
"group_name": "Administrators",
12
"display_type": "admin",
13
"restricted": false,
14
"created_at": "2023-05-15T10:30:00Z",
15
"modified_at": "2023-05-15T10:30:00Z"
16
},
17
"relationships": {
18
"permissions": {
19
"data": [
20
{
21
"type": "permissions",
22
"id": "perm-456"
23
}
24
]
25
}
26
}
27
}
28
],
29
"data": {
30
"type": "users",
31
"id": "123e4567-e89b-12d3-a456-426614174000",
32
"attributes": {
33
"name": "John Doe",
34
"handle": "john.doe",
35
"created_at": "2023-05-01T09:00:00Z",
36
"email": "john.doe@example.com",
37
"icon": "https://example.com/avatars/john_doe.png",
38
"title": "Senior Developer",
39
"verified": true,
40
"disabled": false,
41
"allowed_login_methods": [
42
"password",
43
"sso"
44
],
45
"status": "active"
46
},
47
"relationships": {
48
"roles": {
49
"data": [
50
{
51
"type": "roles",
52
"id": "role-123"
53
}
54
]
55
},
56
"org": {
57
"data": {
58
"type": "organizations",
59
"id": "org-789"
60
}
61
}
62
}
63
}
64
}

Get user invitation
Copy

Retrieves a user invitation by its ID.

Sample Input

1
{
2
"user_invitation_id": "abc123def456"
3
}

Sample Output

1
{
2
"data": {
3
"type": "user_invitations",
4
"id": "abc123def456",
5
"attributes": {
6
"uuid": "f1e2d3c4b5a6",
7
"login_method": "email",
8
"invite_type": "standard",
9
"created_at": "2023-05-15T10:30:00Z",
10
"expires_at": "2023-05-22T10:30:00Z"
11
},
12
"relationships": {
13
"user": {
14
"data": {
15
"type": "users",
16
"id": "u789ghi012"
17
}
18
}
19
}
20
}
21
}

Get user organization
Copy

Retrieves the organization the user is a member of. Only works with the ID of the authenticated user.

Sample Input

1
{
2
"user_id": "123e4567-e89b-12d3-a456-426614174000"
3
}

Sample Output

1
{
2
"included": [
3
{
4
"type": "orgs",
5
"id": "abc12345-6789-def0-1234-567890abcdef",
6
"attributes": {
7
"public_id": "acme-corp",
8
"name": "Acme Corporation",
9
"description": "Global leader in innovative solutions",
10
"sharing": "read_only",
11
"url": "https://app.datadoghq.com/account/settings#api",
12
"disabled": false,
13
"created_at": "2023-01-15T08:30:00Z",
14
"modified_at": "2023-05-20T14:45:00Z"
15
}
16
}
17
],
18
"data": {
19
"type": "users",
20
"id": "123e4567-e89b-12d3-a456-426614174000",
21
"attributes": {
22
"name": "John Doe",
23
"created": "2022-11-01T10:00:00Z",
24
"modified": "2023-05-25T09:15:00Z",
25
"email": "john.doe@acmecorp.com",
26
"icon": "https://secure.gravatar.com/avatar/123456789abcdef?s=80&d=retro",
27
"title": "Senior DevOps Engineer",
28
"verified": true,
29
"disabled": false
30
},
31
"relationships": {
32
"org": {
33
"data": {
34
"type": "orgs",
35
"id": "abc12345-6789-def0-1234-567890abcdef"
36
}
37
},
38
"other_users": {
39
"data": [
40
{
41
"type": "users",
42
"id": "98765432-dcba-4321-abcd-987654321000"
43
},
44
{
45
"type": "users",
46
"id": "56789012-3456-7890-abcd-123456789000"
47
}
48
]
49
},
50
"other_orgs": {
51
"data": []
52
}
53
}
54
}
55
}

Get user permissions
Copy

Retrieves the permissions set for a user by their ID.

Sample Input

1
{
2
"user_id": "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p"
3
}

Sample Output

1
{
2
"data": [
3
{
4
"type": "permissions",
5
"id": "logs_read",
6
"attributes": {
7
"name": "logs_read",
8
"display_name": "Logs Read Access",
9
"description": "Can view log data",
10
"created": "2023-06-15T10:30:00Z",
11
"group_name": "Logs",
12
"display_type": "read",
13
"restricted": false
14
}
15
},
16
{
17
"type": "permissions",
18
"id": "dashboards_write",
19
"attributes": {
20
"name": "dashboards_write",
21
"display_name": "Dashboards Write Access",
22
"description": "Can create and edit dashboards",
23
"created": "2023-06-15T10:30:00Z",
24
"group_name": "Dashboards",
25
"display_type": "write",
26
"restricted": false
27
}
28
}
29
]
30
}

List active metrics
Copy

Retrieves the list of actively reporting metrics from a given time until now.

Sample Input

1
{
2
"from": "1623456789",
3
"host": "web-server-01"
4
}

Sample Output

1
{
2
"metrics": [
3
"system.cpu.idle",
4
"system.cpu.user",
5
"system.mem.used",
6
"system.disk.in_use",
7
"nginx.net.request_per_s",
8
"postgres.queries.count"
9
],
10
"from": "1623456789"
11
}

List monitors
Copy

Retrieves all monitor details.

Sample Input

1
{
2
"group_states": [
3
"alert",
4
"warn"
5
],
6
"name": "CPU Usage",
7
"tags": [
8
"env:production",
9
"service:web"
10
],
11
"monitor_tags": [
12
"team:backend"
13
],
14
"with_downtimes": true,
15
"page": 0,
16
"page_size": 10
17
}

Sample Output

1
{
2
"results": [
3
{
4
"restricted_roles": null,
5
"tags": [
6
"env:production",
7
"service:web",
8
"team:backend"
9
],
10
"deleted": null,
11
"query": "avg(last_5m):avg:system.cpu.user{env:production,service:web} > 80",
12
"message": "CPU usage is high on {{host.name}}",
13
"matching_downtimes": [],
14
"id": 12345678,
15
"multi": true,
16
"name": "High CPU Usage Alert",
17
"created": "2023-04-15T10:30:00.000Z",
18
"created_at": 1681555800,
19
"creator": {
20
"id": 123456,
21
"handle": "john.doe@example.com",
22
"name": "John Doe",
23
"email": "john.doe@example.com"
24
},
25
"org_id": 987654,
26
"modified": "2023-04-15T11:00:00.000Z",
27
"overall_state_modified": "2023-04-15T12:00:00.000Z",
28
"overall_state": "OK",
29
"type": "metric alert",
30
"options": {
31
"thresholds": {
32
"warning": 70,
33
"ok": 50,
34
"critical": 80
35
},
36
"silenced": {}
37
}
38
}
39
]
40
}

List permissions
Copy

Retrieves a list of permissions.

Sample Input

1
{}

Sample Output

1
{
2
"data": [
3
{
4
"type": "permissions",
5
"id": "logs_read",
6
"attributes": {
7
"name": "logs_read",
8
"display_name": "Read Logs",
9
"description": "Ability to read log data",
10
"created": "2023-05-15T10:30:00Z",
11
"group_name": "Logs",
12
"display_type": "read",
13
"restricted": false
14
}
15
},
16
{
17
"type": "permissions",
18
"id": "dashboards_write",
19
"attributes": {
20
"name": "dashboards_write",
21
"display_name": "Write Dashboards",
22
"description": "Ability to create and modify dashboards",
23
"created": "2023-05-15T10:31:00Z",
24
"group_name": "Dashboards",
25
"display_type": "write",
26
"restricted": true
27
}
28
}
29
]
30
}

List role permissions
Copy

Retrieves permissions associated with a particular role.

Sample Input

1
{
2
"role_id": "abcd1234-efgh-5678-ijkl-mnopqrstuvwx"
3
}

Sample Output

1
{
2
"data": [
3
{
4
"type": "permissions",
5
"id": "perm1234-abcd-5678-efgh-ijklmnopqrst",
6
"attributes": {
7
"name": "logs_read",
8
"display_name": "Logs Read Access",
9
"description": "Ability to view log data",
10
"created": "2023-06-15T10:30:00Z",
11
"group_name": "Logs",
12
"display_type": "read",
13
"restricted": false
14
}
15
},
16
{
17
"type": "permissions",
18
"id": "perm5678-ijkl-9012-mnop-qrstuvwxyzab",
19
"attributes": {
20
"name": "dashboards_write",
21
"display_name": "Dashboards Write Access",
22
"description": "Ability to create and modify dashboards",
23
"created": "2023-06-15T10:30:00Z",
24
"group_name": "Dashboards",
25
"display_type": "write",
26
"restricted": true
27
}
28
}
29
]
30
}

List role users
Copy

Retrieves a list of users associated with a particular role.

Sample Input

1
{
2
"role_id": "abc123def456",
3
"filter": "admin",
4
"sort_by": "email",
5
"sort_order": "Ascending",
6
"limit": 5,
7
"offset": 0
8
}

Sample Output

1
{
2
"included": [
3
{
4
"type": "roles",
5
"id": "abc123def456",
6
"attributes": {
7
"name": "Administrator",
8
"display_name": "Administrator",
9
"description": "Full access to all resources",
10
"created": "2023-05-01T10:00:00Z",
11
"group_name": "Admins",
12
"display_type": "custom",
13
"restricted": false,
14
"created_at": "2023-05-01T10:00:00Z",
15
"modified_at": "2023-05-01T10:00:00Z"
16
},
17
"relationships": {
18
"permissions": {
19
"data": [
20
{
21
"type": "permissions",
22
"id": "perm1"
23
},
24
{
25
"type": "permissions",
26
"id": "perm2"
27
}
28
]
29
}
30
}
31
}
32
],
33
"meta": {
34
"page": {
35
"total_filtered_count": 3,
36
"total_count": 10
37
}
38
},
39
"data": [
40
{
41
"type": "users",
42
"id": "user1",
43
"attributes": {
44
"name": "Alice Admin",
45
"handle": "alice.admin",
46
"created_at": "2023-01-15T09:30:00Z",
47
"email": "alice.admin@example.com",
48
"icon": "https://example.com/avatars/alice.jpg",
49
"title": "Senior Administrator",
50
"verified": true,
51
"disabled": false,
52
"allowed_login_methods": [
53
"sso",
54
"password"
55
],
56
"status": "active"
57
},
58
"relationships": {
59
"roles": {
60
"data": [
61
{
62
"type": "roles",
63
"id": "abc123def456"
64
}
65
]
66
},
67
"org": {
68
"data": {
69
"type": "organizations",
70
"id": "org1"
71
}
72
}
73
}
74
},
75
{
76
"type": "users",
77
"id": "user2",
78
"attributes": {
79
"name": "Bob Admin",
80
"handle": "bob.admin",
81
"created_at": "2023-02-20T14:45:00Z",
82
"email": "bob.admin@example.com",
83
"icon": "https://example.com/avatars/bob.jpg",
84
"title": "Administrator",
85
"verified": true,
86
"disabled": false,
87
"allowed_login_methods": [
88
"sso"
89
],
90
"status": "active"
91
},
92
"relationships": {
93
"roles": {
94
"data": [
95
{
96
"type": "roles",
97
"id": "abc123def456"
98
}
99
]
100
},
101
"org": {
102
"data": {
103
"type": "organizations",
104
"id": "org1"
105
}
106
}
107
}
108
},
109
{
110
"type": "users",
111
"id": "user3",
112
"attributes": {
113
"name": "Charlie Admin",
114
"handle": "charlie.admin",
115
"created_at": "2023-03-10T11:15:00Z",
116
"email": "charlie.admin@example.com",
117
"icon": "https://example.com/avatars/charlie.jpg",
118
"title": "Junior Administrator",
119
"verified": true,
120
"disabled": false,
121
"allowed_login_methods": [
122
"password"
123
],
124
"status": "active"
125
},
126
"relationships": {
127
"roles": {
128
"data": [
129
{
130
"type": "roles",
131
"id": "abc123def456"
132
}
133
]
134
},
135
"org": {
136
"data": {
137
"type": "organizations",
138
"id": "org1"
139
}
140
}
141
}
142
}
143
]
144
}

List roles
Copy

Retrieves a list of user roles.

Sample Input

1
{
2
"filter": "admin",
3
"sort_by": "name",
4
"sort_order": "Ascending",
5
"limit": 5,
6
"offset": 0
7
}

Sample Output

1
{
2
"meta": {
3
"page": {
4
"total_filtered_count": 3,
5
"total_count": 10
6
}
7
},
8
"data": [
9
{
10
"type": "roles",
11
"id": "abc123",
12
"attributes": {
13
"name": "Admin",
14
"created_at": "2023-05-01T10:00:00Z",
15
"modified_at": "2023-05-15T14:30:00Z",
16
"user_count": 5
17
},
18
"relationships": {
19
"permissions": {
20
"data": [
21
{
22
"type": "permissions",
23
"id": "perm1"
24
},
25
{
26
"type": "permissions",
27
"id": "perm2"
28
}
29
]
30
}
31
}
32
},
33
{
34
"type": "roles",
35
"id": "def456",
36
"attributes": {
37
"name": "Super Admin",
38
"created_at": "2023-04-15T09:00:00Z",
39
"modified_at": "2023-05-10T11:45:00Z",
40
"user_count": 2
41
},
42
"relationships": {
43
"permissions": {
44
"data": [
45
{
46
"type": "permissions",
47
"id": "perm1"
48
},
49
{
50
"type": "permissions",
51
"id": "perm2"
52
},
53
{
54
"type": "permissions",
55
"id": "perm3"
56
}
57
]
58
}
59
}
60
},
61
{
62
"type": "roles",
63
"id": "ghi789",
64
"attributes": {
65
"name": "System Admin",
66
"created_at": "2023-05-05T13:20:00Z",
67
"modified_at": "2023-05-20T16:15:00Z",
68
"user_count": 3
69
},
70
"relationships": {
71
"permissions": {
72
"data": [
73
{
74
"type": "permissions",
75
"id": "perm1"
76
},
77
{
78
"type": "permissions",
79
"id": "perm2"
80
},
81
{
82
"type": "permissions",
83
"id": "perm4"
84
}
85
]
86
}
87
}
88
}
89
]
90
}

List users
Copy

Retrieves a list of users.

Sample Input

1
{
2
"filter_by_status": "Active",
3
"filter": "support",
4
"sort_by": "email",
5
"sort_order": "Ascending",
6
"limit": 5,
7
"offset": 0
8
}

Sample Output

1
{
2
"included": [
3
{
4
"type": "roles",
5
"id": "123456",
6
"attributes": {
7
"name": "Support Team",
8
"display_name": "Support Team",
9
"description": "Role for support team members",
10
"created": "2023-05-01T10:00:00Z",
11
"group_name": "Support",
12
"display_type": "custom",
13
"restricted": false,
14
"created_at": "2023-05-01T10:00:00Z",
15
"modified_at": "2023-05-01T10:00:00Z"
16
},
17
"relationships": {
18
"permissions": {
19
"data": [
20
{
21
"type": "permissions",
22
"id": "789012"
23
}
24
]
25
}
26
}
27
}
28
],
29
"meta": {
30
"page": {
31
"total_filtered_count": 5,
32
"total_count": 20
33
}
34
},
35
"data": [
36
{
37
"type": "users",
38
"id": "user1",
39
"attributes": {
40
"name": "Alice Smith",
41
"handle": "alice.smith",
42
"created_at": "2023-01-15T09:30:00Z",
43
"email": "alice.smith@example.com",
44
"icon": "https://example.com/avatars/alice.jpg",
45
"title": "Support Specialist",
46
"verified": true,
47
"disabled": false,
48
"allowed_login_methods": [
49
"password",
50
"google_auth"
51
],
52
"status": "Active"
53
},
54
"relationships": {
55
"roles": {
56
"data": [
57
{
58
"type": "roles",
59
"id": "123456"
60
}
61
]
62
},
63
"org": {
64
"data": {
65
"type": "organizations",
66
"id": "org1"
67
}
68
}
69
}
70
},
71
{
72
"type": "users",
73
"id": "user2",
74
"attributes": {
75
"name": "Bob Johnson",
76
"handle": "bob.johnson",
77
"created_at": "2023-02-20T14:45:00Z",
78
"email": "bob.johnson@example.com",
79
"icon": "https://example.com/avatars/bob.jpg",
80
"title": "Support Engineer",
81
"verified": true,
82
"disabled": false,
83
"allowed_login_methods": [
84
"password",
85
"sso"
86
],
87
"status": "Active"
88
},
89
"relationships": {
90
"roles": {
91
"data": [
92
{
93
"type": "roles",
94
"id": "123456"
95
}
96
]
97
},
98
"org": {
99
"data": {
100
"type": "organizations",
101
"id": "org1"
102
}
103
}
104
}
105
}
106
]
107
}

Mute monitor
Copy

Mutes a monitor.

Sample Input

1
{
2
"monitor_id": 12345,
3
"scope": "role:db",
4
"end": "2023-06-30T23:59:59Z"
5
}

Sample Output

1
{
2
"restricted_roles": null,
3
"tags": [
4
"app:database",
5
"env:production"
6
],
7
"deleted": null,
8
"query": "avg(last_5m):avg:system.cpu.user{*} > 80",
9
"message": "CPU usage is too high",
10
"id": 12345,
11
"multi": false,
12
"name": "High CPU Usage Alert",
13
"created": "2023-01-15T10:00:00Z",
14
"created_at": 1673776800,
15
"org_id": 123456,
16
"modified": "2023-06-15T14:30:00Z",
17
"overall_state_modified": "2023-06-15T14:30:00Z",
18
"overall_state": "OK",
19
"type": "metric alert",
20
"options": {
21
"notify_audit": true,
22
"locked": false,
23
"silenced": {
24
"*": 1688169599
25
},
26
"include_tags": true,
27
"no_data_timeframe": 10,
28
"new_host_delay": 300,
29
"notify_no_data": false
30
}
31
}

Query events
Copy

Retrieves a list of events that match an events search query.

Sample Input

1
{
2
"query": "status:error service:web-app",
3
"from": "2023-06-01T00:00:00Z",
4
"to": "2023-06-02T23:59:59Z",
5
"sort": "-timestamp",
6
"limit": 50
7
}

Sample Output

1
{
2
"data": [
3
{
4
"id": "12345678901234567890",
5
"type": "event",
6
"attributes": {
7
"attributes": {
8
"evt": {
9
"id": "12345678901234567890",
10
"source_id": 123456,
11
"type": "error"
12
},
13
"service": "web-app",
14
"priority": "normal",
15
"title": "Application Error",
16
"timestamp": 1685750400,
17
"status": "error"
18
},
19
"message": "Error: Connection timeout in web-app",
20
"timestamp": "2023-06-02T22:13:20Z",
21
"tags": [
22
"env:production",
23
"service:web-app",
24
"error:timeout"
25
]
26
}
27
}
28
],
29
"meta": {
30
"elapsed": 0.05,
31
"request_id": "abcdef1234567890",
32
"status": "done"
33
}
34
}

Query timeseries points
Copy

Queries for metrics from any time period. Use the query syntax described in From the query to the graph.

Sample Input

1
{
2
"from": "2023-05-01T00:00:00Z",
3
"to": "2023-05-02T00:00:00Z",
4
"query": "avg:system.cpu.user{host:web-server-01}"
5
}

Sample Output

1
{
2
"status": "ok",
3
"res_type": "time_series",
4
"from_date": 1682899200,
5
"to_date": 1682985600,
6
"series": [
7
{
8
"metric": "system.cpu.user",
9
"attributes": {
10
"customAttribute": 0.75,
11
"duration": 86400
12
},
13
"display_name": "system.cpu.user",
14
"unit": "percent",
15
"pointlist": [
16
[
17
1682899200000,
18
12.5
19
],
20
[
21
1682902800000,
22
15.2
23
],
24
[
25
1682906400000,
26
18.7
27
],
28
[
29
1682910000000,
30
22.1
31
]
32
],
33
"tag_set": [
34
"host:web-server-01"
35
],
36
"end": 1682985600,
37
"interval": 3600,
38
"start": 1682899200,
39
"length": 24,
40
"aggr": "avg",
41
"scope": "host:web-server-01",
42
"expression": "avg:system.cpu.user{host:web-server-01}"
43
}
44
],
45
"resp_version": 1,
46
"query": "avg:system.cpu.user{host:web-server-01}",
47
"message": "Query executed successfully",
48
"group_by": [
49
"host"
50
]
51
}

Raw HTTP request (advanced)
Copy

Perform a raw HTTP request with some pre-configuration and processing by the connector, such as authentication.

Sample Input

1
{
2
"method": "POST",
3
"url": {
4
"endpoint": "/api/v1/events"
5
},
6
"headers": [
7
{
8
"key": "Content-Type",
9
"value": "application/json"
10
}
11
],
12
"query_parameters": [
13
{
14
"key": "api_key",
15
"value": "your_api_key_here"
16
}
17
],
18
"body": {
19
"raw": {
20
"title": "Deployment Event",
21
"text": "Successfully deployed version 1.2.3 to production",
22
"priority": "normal",
23
"tags": [
24
"deployment",
25
"production"
26
],
27
"alert_type": "info"
28
}
29
},
30
"include_raw_body": true,
31
"parse_response": "true"
32
}

Sample Output

1
{
2
"response": {
3
"status_code": 202,
4
"headers": {
5
"Content-Type": "application/json",
6
"X-RateLimit-Limit": "3000",
7
"X-RateLimit-Period": "3600",
8
"X-RateLimit-Remaining": "2999"
9
},
10
"body": {
11
"status": "ok",
12
"event": {
13
"id": 4321098765,
14
"title": "Deployment Event",
15
"text": "Successfully deployed version 1.2.3 to production",
16
"priority": "normal",
17
"tags": [
18
"deployment",
19
"production"
20
],
21
"alert_type": "info",
22
"date_happened": 1623456789
23
}
24
}
25
}
26
}

Remove user from role
Copy

Removes a user from a role.

Sample Input

1
{
2
"role_id": "abcd1234-efgh-5678-ijkl-mnopqrstuvwx",
3
"user_id": "user9876-5432-zyxw-vuts-rqponmlkjihg"
4
}

Sample Output

1
{
2
"meta": {
3
"page": {
4
"total_count": 1
5
}
6
},
7
"data": [
8
{
9
"type": "users",
10
"id": "user9876-5432-zyxw-vuts-rqponmlkjihg",
11
"attributes": {
12
"name": "John Doe",
13
"handle": "john.doe",
14
"created_at": "2023-05-15T10:30:00Z",
15
"email": "john.doe@example.com",
16
"icon": "https://secure.gravatar.com/avatar/abcdef1234567890",
17
"title": "Software Engineer",
18
"verified": true,
19
"disabled": false,
20
"allowed_login_methods": [
21
"password",
22
"google_auth"
23
],
24
"status": "Active"
25
},
26
"relationships": {
27
"roles": {
28
"data": [
29
{
30
"type": "roles",
31
"id": "role5678-9012-abcd-efgh-ijklmnopqrst"
32
}
33
]
34
},
35
"org": {
36
"data": {
37
"type": "orgs",
38
"id": "org1234-5678-abcd-efgh-ijklmnopqrst"
39
}
40
}
41
}
42
}
43
]
44
}

Resolve monitor
Copy

Resolves a monitor.

Sample Input

1
{
2
"resolve": [
3
{
4
"monitor_id": 12345678,
5
"group_to_resolve": "ALL_GROUPS"
6
},
7
{
8
"monitor_id": 87654321,
9
"group_to_resolve": "host:web-server-01"
10
}
11
]
12
}

Sample Output

1
{
2
"results": [
3
{
4
"restricted_roles": null,
5
"tags": [
6
"env:production",
7
"service:web"
8
],
9
"deleted": null,
10
"query": "avg(last_5m):avg:system.cpu.user{*} > 80",
11
"message": "CPU usage is too high on {{host.name}}",
12
"id": 12345678,
13
"multi": true,
14
"name": "High CPU Usage Alert",
15
"created": "2023-05-15T10:00:00.000Z",
16
"created_at": 1684144800,
17
"org_id": 123456,
18
"modified": "2023-05-15T14:30:00.000Z",
19
"overall_state_modified": "2023-05-15T14:30:00.000Z",
20
"overall_state": "OK",
21
"type": "metric alert",
22
"options": {
23
"notify_audit": true,
24
"locked": false,
25
"timeout_h": 0,
26
"silenced": {},
27
"include_tags": true,
28
"no_data_timeframe": null,
29
"require_full_window": true,
30
"new_host_delay": 300,
31
"notify_no_data": false,
32
"renotify_interval": 0,
33
"escalation_message": "",
34
"thresholds": {
35
"critical": 80,
36
"warning": 70
37
}
38
}
39
},
40
{
41
"restricted_roles": null,
42
"tags": [
43
"env:production",
44
"service:database"
45
],
46
"deleted": null,
47
"query": "avg(last_5m):avg:system.disk.in_use{*} > 90",
48
"message": "Disk usage is critical on {{host.name}}",
49
"id": 87654321,
50
"multi": true,
51
"name": "High Disk Usage Alert",
52
"created": "2023-05-14T09:00:00.000Z",
53
"created_at": 1684054800,
54
"org_id": 123456,
55
"modified": "2023-05-15T14:30:00.000Z",
56
"overall_state_modified": "2023-05-15T14:30:00.000Z",
57
"overall_state": "OK",
58
"type": "metric alert",
59
"options": {
60
"notify_audit": true,
61
"locked": false,
62
"timeout_h": 0,
63
"silenced": {},
64
"include_tags": true,
65
"no_data_timeframe": null,
66
"require_full_window": true,
67
"new_host_delay": 300,
68
"notify_no_data": false,
69
"renotify_interval": 0,
70
"escalation_message": "",
71
"thresholds": {
72
"critical": 90,
73
"warning": 80
74
}
75
}
76
}
77
]
78
}

Search group monitors
Copy

Searches and filters your monitor groups details.

Sample Input

1
{
2
"query": "type:metric status:alert title:CPU Usage",
3
"sort_by": "status",
4
"sort_direction": "desc",
5
"page": 0,
6
"page_size": 10
7
}

Sample Output

1
{
2
"counts": {
3
"status": [
4
{
5
"count": 3,
6
"name": "Alert"
7
},
8
{
9
"count": 5,
10
"name": "OK"
11
},
12
{
13
"count": 2,
14
"name": "Warning"
15
}
16
],
17
"type": [
18
{
19
"count": 8,
20
"name": "metric"
21
},
22
{
23
"count": 2,
24
"name": "log"
25
}
26
]
27
},
28
"groups": [
29
{
30
"status": "Alert",
31
"last_triggered_ts": 1623456789,
32
"group": "Production",
33
"monitor_id": 12345678,
34
"group_tags": [
35
"env:production",
36
"service:web"
37
],
38
"last_nodata_ts": 1623400000,
39
"monitor_name": "High CPU Usage Alert"
40
},
41
{
42
"status": "Alert",
43
"last_triggered_ts": 1623456790,
44
"group": "Staging",
45
"monitor_id": 12345679,
46
"group_tags": [
47
"env:staging",
48
"service:api"
49
],
50
"last_nodata_ts": 1623400001,
51
"monitor_name": "Memory Usage Alert"
52
},
53
{
54
"status": "Warning",
55
"last_triggered_ts": 1623456791,
56
"group": "Development",
57
"monitor_id": 12345680,
58
"group_tags": [
59
"env:development",
60
"service:database"
61
],
62
"last_nodata_ts": 1623400002,
63
"monitor_name": "Disk Space Warning"
64
}
65
],
66
"metadata": {
67
"total_count": 10,
68
"page_count": 1,
69
"page": 0,
70
"per_page": 10
71
}
72
}

Search logs
Copy

Retrieves logs that match a log search query.

Sample Input

1
{
2
"from": "2023-06-01T00:00:00Z",
3
"to": "2023-06-02T00:00:00Z",
4
"query": "status:error service:web-app",
5
"indexes": [
6
"main",
7
"prod"
8
],
9
"time_offset": 0,
10
"timezone": "UTC",
11
"sort": "-timestamp",
12
"limit": 50,
13
"cursor": null
14
}

Sample Output

1
{
2
"meta": {
3
"page": {
4
"after": "eyJzdGFydEF0IjoiQVlEX2NuSUJBQUFBQUFBQSJ9"
5
}
6
},
7
"data": [
8
{
9
"attributes": {
10
"status": "error",
11
"service": "web-app",
12
"tags": [
13
"env:production",
14
"version:1.2.3"
15
],
16
"timestamp": "2023-06-01T23:59:59.123456Z",
17
"host": "web-server-001",
18
"attributes": {
19
"hostname": "web-server-001.example.com",
20
"service": "web-app"
21
},
22
"message": "ConnectionError: Unable to connect to database"
23
},
24
"type": "log",
25
"id": "AYD_cnIBAAAAAAAAABZ"
26
},
27
{
28
"attributes": {
29
"status": "error",
30
"service": "web-app",
31
"tags": [
32
"env:production",
33
"version:1.2.3"
34
],
35
"timestamp": "2023-06-01T23:58:30.987654Z",
36
"host": "web-server-002",
37
"attributes": {
38
"hostname": "web-server-002.example.com",
39
"service": "web-app"
40
},
41
"message": "MemoryError: Out of memory"
42
},
43
"type": "log",
44
"id": "AYD_cnIBAAAAAAAAABY"
45
}
46
],
47
"links": {
48
"next": "https://api.datadoghq.com/api/v2/logs/events?cursor=eyJzdGFydEF0IjoiQVlEX2NuSUJBQUFBQUFBQSJ9"
49
}
50
}

Search metrics
Copy

Searches for metrics from the last 24 hours in Datadog.

Sample Input

1
{
2
"q": "avg:system.cpu.user{*}"
3
}

Sample Output

1
{
2
"results": {
3
"metrics": [
4
"system.cpu.user",
5
"system.cpu.user.percentage",
6
"system.cpu.user.normalized"
7
]
8
}
9
}

Search monitors
Copy

Searches and filters your monitors details.

Sample Input

1
{
2
"query": "type:metric status:alert",
3
"sort_by": "status",
4
"sort_direction": "asc",
5
"page": 0,
6
"page_size": 2
7
}

Sample Output

1
{
2
"counts": {
3
"status": [
4
{
5
"count": 3,
6
"name": "Alert"
7
},
8
{
9
"count": 5,
10
"name": "OK"
11
}
12
],
13
"muted": [
14
{
15
"count": 1,
16
"name": true
17
},
18
{
19
"count": 7,
20
"name": false
21
}
22
],
23
"tag": [
24
{
25
"count": 2,
26
"name": "production"
27
},
28
{
29
"count": 3,
30
"name": "database"
31
}
32
],
33
"type": [
34
{
35
"count": 5,
36
"name": "metric alert"
37
},
38
{
39
"count": 3,
40
"name": "service check"
41
}
42
]
43
},
44
"monitors": [
45
{
46
"status": "Alert",
47
"scopes": [
48
"host:web-server-1"
49
],
50
"classification": "metric",
51
"creator": {
52
"handle": "john.doe@example.com",
53
"id": 123456,
54
"name": "John Doe"
55
},
56
"overall_state_modified": 1623456789,
57
"metrics": [
58
"system.cpu.user"
59
],
60
"notifications": [
61
{
62
"handle": "@slack-devops-alerts",
63
"name": "DevOps Alerts"
64
}
65
],
66
"last_triggered_ts": 1623456700,
67
"query": "avg(last_5m):avg:system.cpu.user{host:web-server-1} > 80",
68
"id": 987654,
69
"name": "High CPU Usage Alert",
70
"tags": [
71
"env:production",
72
"service:web"
73
],
74
"org_id": 234567,
75
"restricted_roles": [
76
"DevOps"
77
],
78
"type": "metric alert"
79
},
80
{
81
"status": "OK",
82
"scopes": [
83
"host:db-server-1"
84
],
85
"classification": "metric",
86
"creator": {
87
"handle": "jane.smith@example.com",
88
"id": 789012,
89
"name": "Jane Smith"
90
},
91
"overall_state_modified": 1623456000,
92
"metrics": [
93
"postgresql.connections"
94
],
95
"notifications": [
96
{
97
"handle": "@pagerduty-database-team",
98
"name": "Database Team"
99
}
100
],
101
"last_triggered_ts": 1623455000,
102
"query": "avg(last_15m):avg:postgresql.connections{host:db-server-1} > 500",
103
"id": 876543,
104
"name": "Database Connections Alert",
105
"tags": [
106
"env:production",
107
"service:database"
108
],
109
"org_id": 234567,
110
"restricted_roles": [
111
"DBAs"
112
],
113
"type": "metric alert"
114
}
115
],
116
"metadata": {
117
"total_count": 8,
118
"page_count": 4,
119
"page": 0,
120
"per_page": 2
121
}
122
}

Send user invitations
Copy

Sends invitation emails to users.

Sample Input

1
{
2
"invitations": [
3
{
4
"user_id": "user-123",
5
"login_method": "standard"
6
},
7
{
8
"user_id": "user-456",
9
"login_method": "oauth2"
10
},
11
{
12
"user_id": "user-789",
13
"login_method": "SAML"
14
}
15
]
16
}

Sample Output

1
{
2
"data": [
3
{
4
"type": "user_invitation",
5
"id": "inv-123",
6
"attributes": {
7
"uuid": "inv-uuid-123",
8
"login_method": "standard",
9
"invite_type": "user",
10
"created_at": "2023-05-15T10:30:00Z",
11
"expires_at": "2023-05-22T10:30:00Z"
12
},
13
"relationships": {
14
"user": {
15
"data": {
16
"type": "user",
17
"id": "user-123"
18
}
19
}
20
}
21
},
22
{
23
"type": "user_invitation",
24
"id": "inv-456",
25
"attributes": {
26
"uuid": "inv-uuid-456",
27
"login_method": "oauth2",
28
"invite_type": "user",
29
"created_at": "2023-05-15T10:30:01Z",
30
"expires_at": "2023-05-22T10:30:01Z"
31
},
32
"relationships": {
33
"user": {
34
"data": {
35
"type": "user",
36
"id": "user-456"
37
}
38
}
39
}
40
},
41
{
42
"type": "user_invitation",
43
"id": "inv-789",
44
"attributes": {
45
"uuid": "inv-uuid-789",
46
"login_method": "SAML",
47
"invite_type": "user",
48
"created_at": "2023-05-15T10:30:02Z",
49
"expires_at": "2023-05-22T10:30:02Z"
50
},
51
"relationships": {
52
"user": {
53
"data": {
54
"type": "user",
55
"id": "user-789"
56
}
57
}
58
}
59
}
60
]
61
}

Unmute monitor
Copy

Unmutes a monitor.

Sample Input

1
{
2
"monitor_id": 12345,
3
"scope": "role:db",
4
"all_scopes": false
5
}

Sample Output

1
{
2
"restricted_roles": null,
3
"tags": [
4
"env:production",
5
"service:database"
6
],
7
"deleted": null,
8
"query": "avg(last_5m):avg:system.cpu.user{*} > 80",
9
"message": "CPU usage is high",
10
"id": 12345,
11
"multi": false,
12
"name": "High CPU Usage Alert",
13
"created": "2023-06-15T10:30:00.000Z",
14
"created_at": 1686826200,
15
"org_id": 987654,
16
"modified": "2023-06-15T14:45:00.000Z",
17
"overall_state_modified": "2023-06-15T14:45:00.000Z",
18
"overall_state": "OK",
19
"type": "metric alert",
20
"options": {
21
"notify_audit": true,
22
"locked": false,
23
"silenced": {},
24
"include_tags": true,
25
"no_data_timeframe": 10,
26
"new_host_delay": 300,
27
"notify_no_data": false
28
}
29
}

Update metric metadata
Copy

Edits a metric’s metadata.

Sample Input

1
{
2
"metric_name": "system.cpu.usage",
3
"metric_type": "gauge",
4
"short_name": "CPU Usage",
5
"metric_description": "Percentage of CPU utilization across all cores",
6
"metric_unit": "percent",
7
"per_unit": "core",
8
"statsd_interval": 15
9
}

Sample Output

1
{
2
"description": "Percentage of CPU utilization across all cores",
3
"short_name": "CPU Usage",
4
"integration": "system",
5
"statsd_interval": 15,
6
"per_unit": "core",
7
"type": "gauge",
8
"unit": "percent"
9
}

Update monitor raw
Copy

Edits a specified monitor.

Sample Input

1
{
2
"monitor_id": 12345,
3
"query": "avg(last_5m):sum:system.cpu.user{*} > 80",
4
"name": "High CPU Usage Alert",
5
"message": "@slack-ops-team CPU usage is high, please investigate.",
6
"options": {
7
"new_group_delay": 300,
8
"notify_no_data": true,
9
"no_data_timeframe": 10,
10
"timeout_h": 24,
11
"require_full_window": false,
12
"renotify_interval": 60,
13
"escalation_message": "CPU usage is still high after an hour, please escalate!",
14
"notify_audit": true,
15
"include_tags": true,
16
"monitor_specific_options": {
17
"metric_alert_options": {
18
"thresholds": {
19
"critical": 80,
20
"warning": 70,
21
"critical_recovery": 75,
22
"warning_recovery": 65
23
},
24
"evaluation_delay": 300
25
}
26
}
27
},
28
"tags": [
29
"env:production",
30
"service:web"
31
],
32
"restricted_roles": [
33
"12345abcde",
34
"67890fghij"
35
],
36
"type": "metric alert",
37
"priority": 2
38
}

Sample Output

1
{
2
"id": 12345,
3
"org_id": 67890,
4
"type": "metric alert",
5
"name": "High CPU Usage Alert",
6
"message": "@slack-ops-team CPU usage is high, please investigate.",
7
"tags": [
8
"env:production",
9
"service:web"
10
],
11
"query": "avg(last_5m):sum:system.cpu.user{*} > 80",
12
"options": {
13
"new_host_delay": 300,
14
"notify_no_data": true,
15
"timeout_h": 24,
16
"require_full_window": false,
17
"renotify_interval": 60,
18
"escalation_message": "CPU usage is still high after an hour, please escalate!",
19
"notify_audit": true,
20
"locked": false,
21
"include_tags": true,
22
"thresholds": {
23
"critical": 80,
24
"warning": 70,
25
"critical_recovery": 75,
26
"warning_recovery": 65
27
},
28
"evaluation_delay": 300,
29
"silenced": {}
30
},
31
"multi": false,
32
"created_at": 1623456789,
33
"created": "2023-06-12T10:30:00Z",
34
"modified": "2023-06-12T10:30:00Z",
35
"deleted": null,
36
"restricted_roles": "12345abcde,67890fghij",
37
"priority": 2,
38
"restriction_policy": null,
39
"overall_state_modified": "2023-06-12T10:30:00Z",
40
"overall_state": "OK"
41
}

Update user
Copy

Updates a user by their ID.

Sample Input

1
{
2
"user_id": "abc123",
3
"email": "john.doe@example.com",
4
"name": "John Doe",
5
"disabled": false
6
}

Sample Output

1
{
2
"success": true
3
}

Validate monitor raw
Copy

Validates a monitor definition.

Sample Input

1
{
2
"query": "avg(last_5m):sum:system.cpu.system{host:web-server} > 80",
3
"monitor_type": "metric alert",
4
"name": "High CPU Usage Alert",
5
"message": "CPU usage on {{host.name}} is above 80%. Please investigate.",
6
"tags": [
7
"env:production",
8
"team:ops"
9
],
10
"options": {
11
"notify_no_data": true,
12
"no_data_timeframe": 10,
13
"renotify_interval": 30,
14
"include_tags": true,
15
"monitor_specific_options": {
16
"metric_alert_options": {
17
"thresholds": {
18
"critical": 80,
19
"warning": 70,
20
"critical_recovery": 75,
21
"warning_recovery": 65
22
},
23
"evaluation_delay": 5
24
}
25
}
26
},
27
"priority": 2
28
}

Sample Output

1
{
2
"success": true
3
}

DDL operations
Copy

List monitors (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"monitors": [
3
{
4
"id": 12345,
5
"name": "High CPU Usage Alert",
6
"type": "metric alert",
7
"query": "avg(last_5m):avg:system.cpu.user{*} > 80",
8
"message": "CPU usage is above 80% for the last 5 minutes",
9
"tags": [
10
"env:production",
11
"service:web"
12
],
13
"options": {
14
"thresholds": {
15
"critical": 80,
16
"warning": 70
17
},
18
"notify_no_data": true,
19
"notify_audit": false,
20
"renotify_interval": 60
21
},
22
"overall_state": "OK",
23
"created": "2023-04-15T10:00:00.000Z",
24
"modified": "2023-04-15T10:00:00.000Z"
25
},
26
{
27
"id": 67890,
28
"name": "API Response Time Alert",
29
"type": "query alert",
30
"query": "avg(last_15m):avg:api.response.time{*} > 2",
31
"message": "API response time is above 2 seconds for the last 15 minutes",
32
"tags": [
33
"env:production",
34
"service:api"
35
],
36
"options": {
37
"thresholds": {
38
"critical": 2,
39
"warning": 1.5
40
},
41
"notify_no_data": true,
42
"notify_audit": true,
43
"renotify_interval": 30
44
},
45
"overall_state": "Alert",
46
"created": "2023-04-10T14:30:00.000Z",
47
"modified": "2023-04-14T09:15:00.000Z"
48
}
49
]
50
}

List permissions (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"data": [
3
{
4
"attributes": {
5
"created_at": "2023-05-15T10:30:00Z",
6
"description": "Allows read access to all dashboards",
7
"display_name": "Read Dashboards",
8
"name": "dashboards_read",
9
"restricted": false,
10
"updated_at": "2023-05-15T10:30:00Z"
11
},
12
"id": "abc123def456",
13
"type": "permissions"
14
},
15
{
16
"attributes": {
17
"created_at": "2023-05-15T10:31:00Z",
18
"description": "Allows write access to all monitors",
19
"display_name": "Write Monitors",
20
"name": "monitors_write",
21
"restricted": true,
22
"updated_at": "2023-05-15T10:31:00Z"
23
},
24
"id": "ghi789jkl012",
25
"type": "permissions"
26
}
27
],
28
"meta": {
29
"page": {
30
"total_count": 2,
31
"total_filtered_count": 2
32
}
33
}
34
}

List roles (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"data": [
3
{
4
"attributes": {
5
"created_at": "2023-05-15T10:30:00Z",
6
"modified_at": "2023-05-15T10:30:00Z",
7
"name": "Admin",
8
"uuid": "a1b2c3d4-e5f6-7890-1234-567890abcdef"
9
},
10
"id": "a1b2c3d4-e5f6-7890-1234-567890abcdef",
11
"relationships": {
12
"permissions": {
13
"data": [
14
{
15
"id": "logs_read",
16
"type": "permissions"
17
},
18
{
19
"id": "logs_write",
20
"type": "permissions"
21
}
22
]
23
}
24
},
25
"type": "roles"
26
},
27
{
28
"attributes": {
29
"created_at": "2023-05-15T11:00:00Z",
30
"modified_at": "2023-05-15T11:00:00Z",
31
"name": "ReadOnly",
32
"uuid": "b2c3d4e5-f6g7-8901-2345-678901abcdef"
33
},
34
"id": "b2c3d4e5-f6g7-8901-2345-678901abcdef",
35
"relationships": {
36
"permissions": {
37
"data": [
38
{
39
"id": "logs_read",
40
"type": "permissions"
41
}
42
]
43
}
44
},
45
"type": "roles"
46
}
47
],
48
"meta": {
49
"page": {
50
"total_count": 2,
51
"total_filtered_count": 2
52
}
53
}
54
}

List users (DDL)
Copy

Note that DDL operations can only be called directly by Connectors API, or when using CustomJS in the Embedded solution editor for e.g. DDL-dependent data mapping

Sample Input

1
{}

Sample Output

1
{
2
"users": [
3
{
4
"id": "1234567890abcdef",
5
"name": "John Doe",
6
"email": "john.doe@example.com",
7
"handle": "john.doe",
8
"status": "Active",
9
"role": "Admin",
10
"verified": true,
11
"disabled": false,
12
"created_at": "2023-01-15T10:30:00Z",
13
"modified_at": "2023-05-20T14:45:00Z"
14
},
15
{
16
"id": "0987654321fedcba",
17
"name": "Jane Smith",
18
"email": "jane.smith@example.com",
19
"handle": "jane.smith",
20
"status": "Active",
21
"role": "Standard",
22
"verified": true,
23
"disabled": false,
24
"created_at": "2023-02-01T09:15:00Z",
25
"modified_at": "2023-05-18T11:20:00Z"
26
},
27
{
28
"id": "abcdef1234567890",
29
"name": "Bob Johnson",
30
"email": "bob.johnson@example.com",
31
"handle": "bob.johnson",
32
"status": "Pending",
33
"role": "Read-Only",
34
"verified": false,
35
"disabled": false,
36
"created_at": "2023-05-10T16:00:00Z",
37
"modified_at": "2023-05-10T16:00:00Z"
38
}
39
]
40
}