# Operations (sample payloads)

## Main operations

### Add user to role

Adds a user to a role.
**Sample Input**

```json
\{
    "role_id": "abcd1234-efgh-5678-ijkl-mnopqrstuvwx",
    "user_id": "user9876-wxyz-5432-lmno-pqrstuvwxyz"
\}
```

**Sample Output**

### Check if monitor can be deleted

Checks if a monitor can be deleted.
**Sample Input**

```json
\{
    "monitor_ids": [
        12345,
        67890,
        54321
    ]
\}
```

**Sample Output**

### Create event

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

```json
{
    "event": \{
        "id": "1234567890",
        "title": "High CPU Usage Alert",
        "text": "The server 'web-01' is experiencing high CPU usage (95%) for the last 15 minutes. Please investigate and take necessary actions.",
        "date_happened": 1623456789,
        "handle": "1234567890123456789",
        "priority": "normal",
        "tags": [
            "production",
            "web-server",
            "high-cpu"
        ],
        "url": "https://app.datadoghq.com/event/event?id=1234567890"
    \}
}
```

### Create monitor raw

Creates a monitor using the specified options.
**Sample Input**

```json
{
    "query": "avg(last_5m):avg:system.cpu.user{*} > 80",
    "monitor_type": "metric alert",
    "name": "High CPU Usage Alert",
    "message": "CPU usage is above 80% for the last 5 minutes. @ops-team",
    "tags": [
        "env:production",
        "service:web"
    ],
    "options": {
        "notify_no_data": true,
        "no_data_timeframe": 10,
        "timeout_h": 0,
        "renotify_interval": 60,
        "escalation_message": "CPU usage is still high! Please investigate ASAP.",
        "include_tags": true,
        "monitor_specific_options": {
            "metric_alert_options": {
                "thresholds": \{
                    "critical": 80,
                    "warning": 70,
                    "critical_recovery": 75,
                    "warning_recovery": 65
                \},
                "evaluation_delay": 300
            }
        }
    },
    "priority": 2
}
```

**Sample Output**

### Create timeseries points

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**

```json
{
    "series": [
        {
            "metric": "system.cpu.usage",
            "points": [
                \{
                    "POSIX_timestamp": "2023-05-15T10:30:00Z",
                    "numeric_value": 75.5
                \},
                \{
                    "POSIX_timestamp": "2023-05-15T10:31:00Z",
                    "numeric_value": 80.2
                \}
            ],
            "type": 3,
            "interval": 60,
            "tags": [
                "environment:production",
                "server:web01"
            ],
            "metadata": {
                "origin": \{
                    "metric_type": 1,
                    "product": 2,
                    "service": 3
                \}
            },
            "source_type_name": "system",
            "resources": [
                \{
                    "name": "web-server-01",
                    "type": "instance"
                \}
            ],
            "unit": "percent"
        }
    ]
}
```

**Sample Output**

```json
\{
    "message": "Timeseries points created successfully",
    "errors": []
\}
```

### Create user

Creates a new user.
**Sample Input**
**Sample Output**

### Delete monitor

Deletes a monitor.
**Sample Input**
**Sample Output**

```json
{
    "deleted_monitor_id": 12345678
}
```

### Disable user

Disables a user by their ID.
**Sample Input**

```json
{
    "user_id": "1a2b3c4d5e6f7g8h9i0j"
}
```

**Sample Output**

### Get event

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**

```json
{
    "event_id": "1234567890"
}
```

**Sample Output**

```json
{
    "event": \{
        "date_happened": 1623456789,
        "alert_type": "error",
        "resource": "web-server-01",
        "title": "High CPU Usage Alert",
        "url": "https://app.datadoghq.com/event/event?id=1234567890",
        "text": "CPU usage on web-server-01 has exceeded 90% for the last 15 minutes.",
        "tags": [
            "env:production",
            "service:web",
            "team:backend"
        ],
        "device_name": [
            "web-server-01"
        ],
        "priority": "high",
        "host": "web-server-01.example.com",
        "id": 1234567890
    \}
}
```

### Get metric metadata

Retrieves the metadata about a specific metric.
**Sample Input**

```json
{
    "metric_name": "system.cpu.idle"
}
```

**Sample Output**

### Get monitor

Retrieves a monitor's details.
**Sample Input**
**Sample Output**

### Get role

Retrieves a role by its ID.
**Sample Input**

```json
{
    "role_id": "abc123def456"
}
```

**Sample Output**

```json
{
    "data": {
        "type": "roles",
        "id": "abc123def456",
        "attributes": \{
            "name": "Admin Role",
            "created_at": "2023-05-15T10:30:00Z",
            "modified_at": "2023-05-16T14:45:00Z",
            "user_count": 5
        \},
        "relationships": {
            "permissions": {
                "data": [
                    \{
                        "type": "permissions",
                        "id": "perm1"
                    \},
                    \{
                        "type": "permissions",
                        "id": "perm2"
                    \},
                    \{
                        "type": "permissions",
                        "id": "perm3"
                    \}
                ]
            }
        }
    }
}
```

### Get user

Retrieves a user by their ID.
**Sample Input**
**Sample Output**

### Get user invitation

Retrieves a user invitation by its ID.
**Sample Input**

```json
{
    "user_invitation_id": "abc123def456"
}
```

**Sample Output**

```json
{
    "data": {
        "type": "user_invitations",
        "id": "abc123def456",
        "attributes": \{
            "uuid": "f1e2d3c4b5a6",
            "login_method": "email",
            "invite_type": "standard",
            "created_at": "2023-05-15T10:30:00Z",
            "expires_at": "2023-05-22T10:30:00Z"
        \},
        "relationships": {
            "user": {
                "data": \{
                    "type": "users",
                    "id": "u789ghi012"
                \}
            }
        }
    }
}
```

### Get user organization

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

```json
{
    "user_id": "123e4567-e89b-12d3-a456-426614174000"
}
```

**Sample Output**

### Get user permissions

Retrieves the permissions set for a user by their ID.
**Sample Input**

```json
{
    "user_id": "1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p"
}
```

**Sample Output**

### List active metrics

Retrieves the list of actively reporting metrics from a given time until now.
**Sample Input**
**Sample Output**

```json
\{
    "metrics": [
        "system.cpu.idle",
        "system.cpu.user",
        "system.mem.used",
        "system.disk.in_use",
        "nginx.net.request_per_s",
        "postgres.queries.count"
    ],
    "from": "1623456789"
\}
```

### List monitors

Retrieves all monitor details.
**Sample Input**
**Sample Output**

### List permissions

Retrieves a list of permissions.
**Sample Input**

```json
{}
```

**Sample Output**

```json
{
    "data": [
        {
            "type": "permissions",
            "id": "logs_read",
            "attributes": \{
                "name": "logs_read",
                "display_name": "Read Logs",
                "description": "Ability to read log data",
                "created": "2023-05-15T10:30:00Z",
                "group_name": "Logs",
                "display_type": "read",
                "restricted": false
            \}
        },
        {
            "type": "permissions",
            "id": "dashboards_write",
            "attributes": \{
                "name": "dashboards_write",
                "display_name": "Write Dashboards",
                "description": "Ability to create and modify dashboards",
                "created": "2023-05-15T10:31:00Z",
                "group_name": "Dashboards",
                "display_type": "write",
                "restricted": true
            \}
        }
    ]
}
```

### List role permissions

Retrieves permissions associated with a particular role.
**Sample Input**

```json
{
    "role_id": "abcd1234-efgh-5678-ijkl-mnopqrstuvwx"
}
```

**Sample Output**

### List role users

Retrieves a list of users associated with a particular role.
**Sample Input**

```json
\{
    "role_id": "abc123def456",
    "filter": "admin",
    "sort_by": "email",
    "sort_order": "Ascending",
    "limit": 5,
    "offset": 0
\}
```

**Sample Output**

```json
{
    "included": [
        {
            "type": "roles",
            "id": "abc123def456",
            "attributes": \{
                "name": "Administrator",
                "display_name": "Administrator",
                "description": "Full access to all resources",
                "created": "2023-05-01T10:00:00Z",
                "group_name": "Admins",
                "display_type": "custom",
                "restricted": false,
                "created_at": "2023-05-01T10:00:00Z",
                "modified_at": "2023-05-01T10:00:00Z"
            \},
            "relationships": {
                "permissions": {
                    "data": [
                        \{
                            "type": "permissions",
                            "id": "perm1"
                        \},
                        \{
                            "type": "permissions",
                            "id": "perm2"
                        \}
                    ]
                }
            }
        }
    ],
    "meta": {
        "page": \{
            "total_filtered_count": 3,
            "total_count": 10
        \}
    },
    "data": [
        {
            "type": "users",
            "id": "user1",
            "attributes": \{
                "name": "Alice Admin",
                "handle": "alice.admin",
                "created_at": "2023-01-15T09:30:00Z",
                "email": "alice.admin@example.com",
                "icon": "https://example.com/avatars/alice.jpg",
                "title": "Senior Administrator",
                "verified": true,
                "disabled": false,
                "allowed_login_methods": [
                    "sso",
                    "password"
                ],
                "status": "active"
            \},
            "relationships": {
                "roles": {
                    "data": [
                        \{
                            "type": "roles",
                            "id": "abc123def456"
                        \}
                    ]
                },
                "org": {
                    "data": \{
                        "type": "organizations",
                        "id": "org1"
                    \}
                }
            }
        },
        {
            "type": "users",
            "id": "user2",
            "attributes": \{
                "name": "Bob Admin",
                "handle": "bob.admin",
                "created_at": "2023-02-20T14:45:00Z",
                "email": "bob.admin@example.com",
                "icon": "https://example.com/avatars/bob.jpg",
                "title": "Administrator",
                "verified": true,
                "disabled": false,
                "allowed_login_methods": [
                    "sso"
                ],
                "status": "active"
            \},
            "relationships": {
                "roles": {
                    "data": [
                        \{
                            "type": "roles",
                            "id": "abc123def456"
                        \}
                    ]
                },
                "org": {
                    "data": \{
                        "type": "organizations",
                        "id": "org1"
                    \}
                }
            }
        },
        {
            "type": "users",
            "id": "user3",
            "attributes": \{
                "name": "Charlie Admin",
                "handle": "charlie.admin",
                "created_at": "2023-03-10T11:15:00Z",
                "email": "charlie.admin@example.com",
                "icon": "https://example.com/avatars/charlie.jpg",
                "title": "Junior Administrator",
                "verified": true,
                "disabled": false,
                "allowed_login_methods": [
                    "password"
                ],
                "status": "active"
            \},
            "relationships": {
                "roles": {
                    "data": [
                        \{
                            "type": "roles",
                            "id": "abc123def456"
                        \}
                    ]
                },
                "org": {
                    "data": \{
                        "type": "organizations",
                        "id": "org1"
                    \}
                }
            }
        }
    ]
}
```

### List roles

Retrieves a list of user roles.
**Sample Input**
**Sample Output**

### List users

Retrieves a list of users.
**Sample Input**
**Sample Output**

```json
{
    "included": [
        {
            "type": "roles",
            "id": "123456",
            "attributes": \{
                "name": "Support Team",
                "display_name": "Support Team",
                "description": "Role for support team members",
                "created": "2023-05-01T10:00:00Z",
                "group_name": "Support",
                "display_type": "custom",
                "restricted": false,
                "created_at": "2023-05-01T10:00:00Z",
                "modified_at": "2023-05-01T10:00:00Z"
            \},
            "relationships": {
                "permissions": {
                    "data": [
                        \{
                            "type": "permissions",
                            "id": "789012"
                        \}
                    ]
                }
            }
        }
    ],
    "meta": {
        "page": \{
            "total_filtered_count": 5,
            "total_count": 20
        \}
    },
    "data": [
        {
            "type": "users",
            "id": "user1",
            "attributes": \{
                "name": "Alice Smith",
                "handle": "alice.smith",
                "created_at": "2023-01-15T09:30:00Z",
                "email": "alice.smith@example.com",
                "icon": "https://example.com/avatars/alice.jpg",
                "title": "Support Specialist",
                "verified": true,
                "disabled": false,
                "allowed_login_methods": [
                    "password",
                    "google_auth"
                ],
                "status": "Active"
            \},
            "relationships": {
                "roles": {
                    "data": [
                        \{
                            "type": "roles",
                            "id": "123456"
                        \}
                    ]
                },
                "org": {
                    "data": \{
                        "type": "organizations",
                        "id": "org1"
                    \}
                }
            }
        },
        {
            "type": "users",
            "id": "user2",
            "attributes": \{
                "name": "Bob Johnson",
                "handle": "bob.johnson",
                "created_at": "2023-02-20T14:45:00Z",
                "email": "bob.johnson@example.com",
                "icon": "https://example.com/avatars/bob.jpg",
                "title": "Support Engineer",
                "verified": true,
                "disabled": false,
                "allowed_login_methods": [
                    "password",
                    "sso"
                ],
                "status": "Active"
            \},
            "relationships": {
                "roles": {
                    "data": [
                        \{
                            "type": "roles",
                            "id": "123456"
                        \}
                    ]
                },
                "org": {
                    "data": \{
                        "type": "organizations",
                        "id": "org1"
                    \}
                }
            }
        }
    ]
}
```

### Mute monitor

Mutes a monitor.
**Sample Input**
**Sample Output**

```json
{
    "restricted_roles": null,
    "tags": [
        "app:database",
        "env:production"
    ],
    "deleted": null,
    "query": "avg(last_5m):avg:system.cpu.user{*} > 80",
    "message": "CPU usage is too high",
    "id": 12345,
    "multi": false,
    "name": "High CPU Usage Alert",
    "created": "2023-01-15T10:00:00Z",
    "created_at": 1673776800,
    "org_id": 123456,
    "modified": "2023-06-15T14:30:00Z",
    "overall_state_modified": "2023-06-15T14:30:00Z",
    "overall_state": "OK",
    "type": "metric alert",
    "options": {
        "notify_audit": true,
        "locked": false,
        "silenced": {
            "*": 1688169599
        },
        "include_tags": true,
        "no_data_timeframe": 10,
        "new_host_delay": 300,
        "notify_no_data": false
    }
}
```

### Query events

Retrieves a list of events that match an events search query.
**Sample Input**
**Sample Output**

### Query timeseries points

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

```json
{
    "status": "ok",
    "res_type": "time_series",
    "from_date": 1682899200,
    "to_date": 1682985600,
    "series": [
        {
            "metric": "system.cpu.user",
            "attributes": \{
                "customAttribute": 0.75,
                "duration": 86400
            \},
            "display_name": "system.cpu.user",
            "unit": "percent",
            "pointlist": [
                [
                    1682899200000,
                    12.5
                ],
                [
                    1682902800000,
                    15.2
                ],
                [
                    1682906400000,
                    18.7
                ],
                [
                    1682910000000,
                    22.1
                ]
            ],
            "tag_set": [
                "host:web-server-01"
            ],
            "end": 1682985600,
            "interval": 3600,
            "start": 1682899200,
            "length": 24,
            "aggr": "avg",
            "scope": "host:web-server-01",
            "expression": "avg:system.cpu.user{host:web-server-01}"
        }
    ],
    "resp_version": 1,
    "query": "avg:system.cpu.user{host:web-server-01}",
    "message": "Query executed successfully",
    "group_by": [
        "host"
    ]
}
```

### Raw HTTP request (advanced)

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

```json
{
    "response": {
        "status_code": 202,
        "headers": \{
            "Content-Type": "application/json",
            "X-RateLimit-Limit": "3000",
            "X-RateLimit-Period": "3600",
            "X-RateLimit-Remaining": "2999"
        \},
        "body": {
            "status": "ok",
            "event": \{
                "id": 4321098765,
                "title": "Deployment Event",
                "text": "Successfully deployed version 1.2.3 to production",
                "priority": "normal",
                "tags": [
                    "deployment",
                    "production"
                ],
                "alert_type": "info",
                "date_happened": 1623456789
            \}
        }
    }
}
```

### Remove user from role

Removes a user from a role.
**Sample Input**

```json
\{
    "role_id": "abcd1234-efgh-5678-ijkl-mnopqrstuvwx",
    "user_id": "user9876-5432-zyxw-vuts-rqponmlkjihg"
\}
```

**Sample Output**

```json
{
    "meta": {
        "page": {
            "total_count": 1
        }
    },
    "data": [
        {
            "type": "users",
            "id": "user9876-5432-zyxw-vuts-rqponmlkjihg",
            "attributes": \{
                "name": "John Doe",
                "handle": "john.doe",
                "created_at": "2023-05-15T10:30:00Z",
                "email": "john.doe@example.com",
                "icon": "https://secure.gravatar.com/avatar/abcdef1234567890",
                "title": "Software Engineer",
                "verified": true,
                "disabled": false,
                "allowed_login_methods": [
                    "password",
                    "google_auth"
                ],
                "status": "Active"
            \},
            "relationships": {
                "roles": {
                    "data": [
                        \{
                            "type": "roles",
                            "id": "role5678-9012-abcd-efgh-ijklmnopqrst"
                        \}
                    ]
                },
                "org": {
                    "data": \{
                        "type": "orgs",
                        "id": "org1234-5678-abcd-efgh-ijklmnopqrst"
                    \}
                }
            }
        }
    ]
}
```

### Resolve monitor

Resolves a monitor.
**Sample Input**

```json
{
    "resolve": [
        \{
            "monitor_id": 12345678,
            "group_to_resolve": "ALL_GROUPS"
        \},
        \{
            "monitor_id": 87654321,
            "group_to_resolve": "host:web-server-01"
        \}
    ]
}
```

**Sample Output**

### Search group monitors

Searches and filters your monitor groups details.
**Sample Input**
**Sample Output**

```json
{
    "counts": {
        "status": [
            \{
                "count": 3,
                "name": "Alert"
            \},
            \{
                "count": 5,
                "name": "OK"
            \},
            \{
                "count": 2,
                "name": "Warning"
            \}
        ],
        "type": [
            \{
                "count": 8,
                "name": "metric"
            \},
            \{
                "count": 2,
                "name": "log"
            \}
        ]
    },
    "groups": [
        \{
            "status": "Alert",
            "last_triggered_ts": 1623456789,
            "group": "Production",
            "monitor_id": 12345678,
            "group_tags": [
                "env:production",
                "service:web"
            ],
            "last_nodata_ts": 1623400000,
            "monitor_name": "High CPU Usage Alert"
        \},
        \{
            "status": "Alert",
            "last_triggered_ts": 1623456790,
            "group": "Staging",
            "monitor_id": 12345679,
            "group_tags": [
                "env:staging",
                "service:api"
            ],
            "last_nodata_ts": 1623400001,
            "monitor_name": "Memory Usage Alert"
        \},
        \{
            "status": "Warning",
            "last_triggered_ts": 1623456791,
            "group": "Development",
            "monitor_id": 12345680,
            "group_tags": [
                "env:development",
                "service:database"
            ],
            "last_nodata_ts": 1623400002,
            "monitor_name": "Disk Space Warning"
        \}
    ],
    "metadata": \{
        "total_count": 10,
        "page_count": 1,
        "page": 0,
        "per_page": 10
    \}
}
```

### Search logs

Retrieves logs that match a log search query.
**Sample Input**

```json
\{
    "from": "2023-06-01T00:00:00Z",
    "to": "2023-06-02T00:00:00Z",
    "query": "status:error service:web-app",
    "indexes": [
        "main",
        "prod"
    ],
    "time_offset": 0,
    "timezone": "UTC",
    "sort": "-timestamp",
    "limit": 50,
    "cursor": null
\}
```

**Sample Output**

```json
{
    "meta": {
        "page": {
            "after": "eyJzdGFydEF0IjoiQVlEX2NuSUJBQUFBQUFBQSJ9"
        }
    },
    "data": [
        {
            "attributes": {
                "status": "error",
                "service": "web-app",
                "tags": [
                    "env:production",
                    "version:1.2.3"
                ],
                "timestamp": "2023-06-01T23:59:59.123456Z",
                "host": "web-server-001",
                "attributes": \{
                    "hostname": "web-server-001.example.com",
                    "service": "web-app"
                \},
                "message": "ConnectionError: Unable to connect to database"
            },
            "type": "log",
            "id": "AYD_cnIBAAAAAAAAABZ"
        },
        {
            "attributes": {
                "status": "error",
                "service": "web-app",
                "tags": [
                    "env:production",
                    "version:1.2.3"
                ],
                "timestamp": "2023-06-01T23:58:30.987654Z",
                "host": "web-server-002",
                "attributes": \{
                    "hostname": "web-server-002.example.com",
                    "service": "web-app"
                \},
                "message": "MemoryError: Out of memory"
            },
            "type": "log",
            "id": "AYD_cnIBAAAAAAAAABY"
        }
    ],
    "links": {
        "next": "https://api.datadoghq.com/api/v2/logs/events?cursor=eyJzdGFydEF0IjoiQVlEX2NuSUJBQUFBQUFBQSJ9"
    }
}
```

### Search metrics

Searches for metrics from the last 24 hours in Datadog.
**Sample Input**
**Sample Output**

```json
{
    "results": \{
        "metrics": [
            "system.cpu.user",
            "system.cpu.user.percentage",
            "system.cpu.user.normalized"
        ]
    \}
}
```

### Search monitors

Searches and filters your monitors details.
**Sample Input**
**Sample Output**

```json
{
    "counts": {
        "status": [
            \{
                "count": 3,
                "name": "Alert"
            \},
            \{
                "count": 5,
                "name": "OK"
            \}
        ],
        "muted": [
            \{
                "count": 1,
                "name": true
            \},
            \{
                "count": 7,
                "name": false
            \}
        ],
        "tag": [
            \{
                "count": 2,
                "name": "production"
            \},
            \{
                "count": 3,
                "name": "database"
            \}
        ],
        "type": [
            \{
                "count": 5,
                "name": "metric alert"
            \},
            \{
                "count": 3,
                "name": "service check"
            \}
        ]
    },
    "monitors": [
        {
            "status": "Alert",
            "scopes": [
                "host:web-server-1"
            ],
            "classification": "metric",
            "creator": \{
                "handle": "john.doe@example.com",
                "id": 123456,
                "name": "John Doe"
            \},
            "overall_state_modified": 1623456789,
            "metrics": [
                "system.cpu.user"
            ],
            "notifications": [
                \{
                    "handle": "@slack-devops-alerts",
                    "name": "DevOps Alerts"
                \}
            ],
            "last_triggered_ts": 1623456700,
            "query": "avg(last_5m):avg:system.cpu.user{host:web-server-1} > 80",
            "id": 987654,
            "name": "High CPU Usage Alert",
            "tags": [
                "env:production",
                "service:web"
            ],
            "org_id": 234567,
            "restricted_roles": [
                "DevOps"
            ],
            "type": "metric alert"
        },
        {
            "status": "OK",
            "scopes": [
                "host:db-server-1"
            ],
            "classification": "metric",
            "creator": \{
                "handle": "jane.smith@example.com",
                "id": 789012,
                "name": "Jane Smith"
            \},
            "overall_state_modified": 1623456000,
            "metrics": [
                "postgresql.connections"
            ],
            "notifications": [
                \{
                    "handle": "@pagerduty-database-team",
                    "name": "Database Team"
                \}
            ],
            "last_triggered_ts": 1623455000,
            "query": "avg(last_15m):avg:postgresql.connections{host:db-server-1} > 500",
            "id": 876543,
            "name": "Database Connections Alert",
            "tags": [
                "env:production",
                "service:database"
            ],
            "org_id": 234567,
            "restricted_roles": [
                "DBAs"
            ],
            "type": "metric alert"
        }
    ],
    "metadata": \{
        "total_count": 8,
        "page_count": 4,
        "page": 0,
        "per_page": 2
    \}
}
```

### Send user invitations

Sends invitation emails to users.
**Sample Input**
**Sample Output**

### Unmute monitor

Unmutes a monitor.
**Sample Input**
**Sample Output**

### Update metric metadata

Edits a metric’s metadata.
**Sample Input**
**Sample Output**

### Update monitor raw

Edits a specified monitor.
**Sample Input**
**Sample Output**

### Update user

Updates a user by their ID.
**Sample Input**

```json
\{
    "user_id": "abc123",
    "email": "john.doe@example.com",
    "name": "John Doe",
    "disabled": false
\}
```

**Sample Output**

```json
{
    "success": true
}
```

### Validate monitor raw

Validates a monitor definition.
**Sample Input**
**Sample Output**

## DDL operations

### List monitors (DDL)

**Sample Input**
**Sample Output**

```json
{
    "monitors": [
        {
            "id": 12345,
            "name": "High CPU Usage Alert",
            "type": "metric alert",
            "query": "avg(last_5m):avg:system.cpu.user{*} > 80",
            "message": "CPU usage is above 80% for the last 5 minutes",
            "tags": [
                "env:production",
                "service:web"
            ],
            "options": {
                "thresholds": \{
                    "critical": 80,
                    "warning": 70
                \},
                "notify_no_data": true,
                "notify_audit": false,
                "renotify_interval": 60
            },
            "overall_state": "OK",
            "created": "2023-04-15T10:00:00.000Z",
            "modified": "2023-04-15T10:00:00.000Z"
        },
        {
            "id": 67890,
            "name": "API Response Time Alert",
            "type": "query alert",
            "query": "avg(last_15m):avg:api.response.time{*} > 2",
            "message": "API response time is above 2 seconds for the last 15 minutes",
            "tags": [
                "env:production",
                "service:api"
            ],
            "options": {
                "thresholds": \{
                    "critical": 2,
                    "warning": 1.5
                \},
                "notify_no_data": true,
                "notify_audit": true,
                "renotify_interval": 30
            },
            "overall_state": "Alert",
            "created": "2023-04-10T14:30:00.000Z",
            "modified": "2023-04-14T09:15:00.000Z"
        }
    ]
}
```

### List permissions (DDL)

**Sample Input**

```json
{}
```

**Sample Output**

```json
{
    "data": [
        {
            "attributes": \{
                "created_at": "2023-05-15T10:30:00Z",
                "description": "Allows read access to all dashboards",
                "display_name": "Read Dashboards",
                "name": "dashboards_read",
                "restricted": false,
                "updated_at": "2023-05-15T10:30:00Z"
            \},
            "id": "abc123def456",
            "type": "permissions"
        },
        {
            "attributes": \{
                "created_at": "2023-05-15T10:31:00Z",
                "description": "Allows write access to all monitors",
                "display_name": "Write Monitors",
                "name": "monitors_write",
                "restricted": true,
                "updated_at": "2023-05-15T10:31:00Z"
            \},
            "id": "ghi789jkl012",
            "type": "permissions"
        }
    ],
    "meta": {
        "page": \{
            "total_count": 2,
            "total_filtered_count": 2
        \}
    }
}
```

### List roles (DDL)

> **Warning:** 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**
**Sample Output**

### List users (DDL)

> **Warning:** 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**
**Sample Output**

```json
{
    "users": [
        \{
            "id": "1234567890abcdef",
            "name": "John Doe",
            "email": "john.doe@example.com",
            "handle": "john.doe",
            "status": "Active",
            "role": "Admin",
            "verified": true,
            "disabled": false,
            "created_at": "2023-01-15T10:30:00Z",
            "modified_at": "2023-05-20T14:45:00Z"
        \},
        \{
            "id": "0987654321fedcba",
            "name": "Jane Smith",
            "email": "jane.smith@example.com",
            "handle": "jane.smith",
            "status": "Active",
            "role": "Standard",
            "verified": true,
            "disabled": false,
            "created_at": "2023-02-01T09:15:00Z",
            "modified_at": "2023-05-18T11:20:00Z"
        \},
        \{
            "id": "abcdef1234567890",
            "name": "Bob Johnson",
            "email": "bob.johnson@example.com",
            "handle": "bob.johnson",
            "status": "Pending",
            "role": "Read-Only",
            "verified": false,
            "disabled": false,
            "created_at": "2023-05-10T16:00:00Z",
            "modified_at": "2023-05-10T16:00:00Z"
        \}
    ]
}
```
