# Lists databases monitored by a collector

Returns a list of databases currently being monitored by the specified collector.

[info]
For security reasons, passwords are never included in the API response.
[/info]

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

[[path_param]]
name = "id"
description = "The unique identifier of the collector."
required = true
type = "string"

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

[responses]
[[response]]
status = 200
description = "A list of databases for the collector."
body = '''
{
  "data": [
    {
      "id": "201",
      "type": "collector_database",
      "attributes": {
        "service_type": "postgresql",
        "host": "db1.example.com",
        "port": 5432,
        "username": "betterstack_user",
        "ssl_mode": "require",
        "tls": false,
        "created_at": "2023-10-26T11:00:00.000Z",
        "updated_at": "2023-10-26T11:00:00.000Z"
      }
    },
    {
      "id": "202",
      "type": "collector_database",
      "attributes": {
        "service_type": "redis",
        "host": "cache.example.com",
        "port": 6379,
        "username": null,
        "ssl_mode": null,
        "tls": true,
        "created_at": "2023-10-26T11:05:00.000Z",
        "updated_at": "2023-10-26T11:05:00.000Z"
      }
    }
  ]
}
'''

[[response]]
status = 401
description = "Invalid or missing authentication token."

[[response]]
status = 404
description = "A collector with the specified ID was not found."
[/responses]

#### Example Request

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