ListDetectors

Lists the detector IDs of enabled Amazon GuardDuty detectors in an AWS account.

Important

Currently, GuardDuty supports only one detector resource per AWS account per region.

Request Syntax

GET https://<endpoint>/detector

Body:

{
"maxResults": "integer",
"nextToken": "string"
}

Request Parameters

The request accepts the following data in JSON format.

maxResults

Indicates the maximum number of items that you want in the response.

Type: Integer

Required: No

Default: 50

Constraints: Minimum value is 1. Maximum value is 50.

nextToken

Paginates results. Set the value of this parameter to NULL on your first
call to the ListDetectors operation. For subsequent calls to
the operation, fill nextToken in the request with the value of
NextToken from the previous response to continue listing
data.

Type: String

Required: No

Response Syntax

Body:

{
"detectorIds": [list of detector IDs]
}

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The response is the following data in JSON format.

detectorIds

The list of all enabled detector IDs.

Type: Array of strings

nextToken

The token that is required for pagination.

Type: String

Errors

If the action is not successful, the service sends back an HTTP error response code
along with detailed error information.

InvalidInputException

The request is rejected. An invalid or out-of-range value is specified as an input
parameter.

HTTP Status Code: 400

InvalidInputException

The request is rejected. The required query or path parameters are not
specified.

HTTP Status Code: 400

InvalidInputException

The request is rejected. One or more input parameters have invalid values.

HTTP Status Code: 400

InvalidInputException

The request is rejected. The parameter maxResults has an invalid
value.