# Targets#ListTargets

List a collection of Test Targets

Endpoint: GET /sto/api/v2/targets
Version: 1.0
Security: 

## Query parameters:

  - `accountId` (string, required)
    Harness Account ID
    Example: "abcdef1234567890ghijkl"

  - `page` (integer)
    Page number to fetch (starting from 0)
    Example: 4

  - `pageSize` (integer)
    Number of results per page
    Example: 50

  - `name` (string)
    Resource name
    Example: "NodeGoat"

  - `orgId` (string, required)
    Harness Organization ID
    Example: "example_org"

  - `projectId` (string, required)
    Harness Project ID
    Example: "example_project"

## Header parameters:

  - `X-Api-Key` (string)
    Harness personal or service access token
    Example: "Voluptatem ut voluptatem aperiam dolor."

## Response 200 fields (application/json):

  - `pagination` (object, required)
    Example: {"link":"","page":4,"pageSize":20,"totalItems":230,"totalPages":12}

  - `pagination.link` (string)
    Link-based paging

  - `pagination.page` (integer, required)
    Page number (starting from 0)
    Example: 4

  - `pagination.pageSize` (integer, required)
    Requested page size
    Example: 20

  - `pagination.totalItems` (integer, required)
    Total results available
    Example: 230

  - `pagination.totalPages` (integer, required)
    Total pages available
    Example: 12

  - `results` (array, required)
    Example: [{"baselineRegEx":"release_.*","baselineVariantId":"abcdef1234567890ghijkl","created":1651578240,"directory":"app/src","id":"abcdef1234567890ghijkl","lastModified":1651578240,"name":"NodeGoat","orgId":"example_org","projectId":"example_project","type":"repository","url":"https://github.com/example/repo"},{"baselineRegEx":"release_.*","baselineVariantId":"abcdef1234567890ghijkl","created":1651578240,"directory":"app/src","id":"abcdef1234567890ghijkl","lastModified":1651578240,"name":"NodeGoat","orgId":"example_org","projectId":"example_project","type":"repository","url":"https://github.com/example/repo"},{"baselineRegEx":"release_.*","baselineVariantId":"abcdef1234567890ghijkl","created":1651578240,"directory":"app/src","id":"abcdef1234567890ghijkl","lastModified":1651578240,"name":"NodeGoat","orgId":"example_org","projectId":"example_project","type":"repository","url":"https://github.com/example/repo"}]

  - `results.baselineRegEx` (string)
    RegEx to match for dynamically selecting the Baseline for this Scan Target. Must be compatible with the RE2 standard.
    Example: "release_.*"

  - `results.baselineVariantId` (string)
    ID of baseline Target Variant for Issue comparison
    Example: "abcdef1234567890ghijkl"

  - `results.created` (integer, required)
    Unix timestamp at which the resource was created
    Example: 1651578240

  - `results.directory` (string)
    Directory within the Test Target to be scanned
    Example: "app/src"

  - `results.id` (string, required)
    Resource identifier
    Example: "abcdef1234567890ghijkl"

  - `results.lastModified` (integer, required)
    Unix timestamp at which the resource was most recently modified
    Example: 1651578240

  - `results.name` (string, required)
    Name of the Test Target
    Example: "NodeGoat"

  - `results.orgId` (string, required)
    Harness Organization ID
    Example: "example_org"

  - `results.projectId` (string, required)
    Harness Project ID
    Example: "example_project"

  - `results.type` (string, required)
    Test Target's type
    Enum: "container", "repository", "instance", "configuration"

  - `results.url` (string)
    URL used to access the Test Target
    Example: "https://github.com/example/repo"

## Response 400 fields (application/json):

  - `message` (string, required)
    Example: "Not Found"

  - `status` (integer)
    Example: 404


