# List collector metrics targets

Returns a paginated list of all targets belonging to a collector.

[endpoint]
base_url = "https://telemetry.betterstack.com"
path = "/api/v1/collectors/{collector_id}/targets"
method = "GET"

[[url_param]]
name = "collector_id"
description = "The ID of the collector."
required = true
type = "string"

[[query_param]]
name = "page"
description = "Page number for pagination."
required = false
type = "integer"

[[query_param]]
name = "per_page"
description = "Number of items per page (default 25, maximum 100)."
required = false
type = "integer"

[[header]]
name = "Authorization"
description = "Bearer `$TOKEN`"
required = true
type = "string"
[/endpoint]

[responses]
[[response]]
status = 200
description = "Targets returned successfully."
body = '''
{
  "data": [
    {
      "id": "1",
      "type": "collector_target",
      "attributes": {
        "kind": "postgres",
        "host": "db.example.com",
        "port": 5432,
        "service": null,
        "listen_ip": null,
        "endpoint": null,
        "scheme": null,
        "username": "monitor",
        "ssl_mode": "require",
        "tls": null,
        "status": "up",
        "enabled": true,
        "container": null,
        "detected_host": null,
        "autogenerated": false,
        "paused_until": null,
        "consecutive_failure_count": 0,
        "last_ping_at": "2025-06-15T14:32:00.000Z",
        "created_at": "2025-06-01T12:00:00.000Z",
        "updated_at": "2025-06-15T14:32:00.000Z"
      }
    },
    {
      "id": "2",
      "type": "collector_target",
      "attributes": {
        "kind": "nginx",
        "host": "collector-host-1",
        "port": 80,
        "service": "edge-nginx",
        "listen_ip": "10.0.0.1",
        "endpoint": null,
        "scheme": null,
        "username": null,
        "ssl_mode": null,
        "tls": null,
        "status": "up",
        "enabled": true,
        "container": null,
        "detected_host": null,
        "autogenerated": false,
        "paused_until": null,
        "consecutive_failure_count": 0,
        "last_ping_at": "2025-06-15T14:30:00.000Z",
        "created_at": "2025-06-01T12:00:00.000Z",
        "updated_at": "2025-06-15T14:30:00.000Z"
      }
    }
  ],
  "pagination": {
    "first": "https://telemetry.betterstack.com/api/v1/collectors/1/targets?page=1",
    "last": "https://telemetry.betterstack.com/api/v1/collectors/1/targets?page=1",
    "prev": null,
    "next": null
  }
}
'''
[/responses]

```shell
[label cURL]
curl "https://telemetry.betterstack.com/api/v1/collectors/1/targets" \
     -H "Authorization: Bearer $TOKEN"
```
