> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Connections

> Retrieves all connections for a specific project. Secret fields (passwords, API keys, etc.) are masked and returned as null in list operations.

## Endpoint

```
GET /apiops/projects/{projectName}/connections/
```

## Authentication

Requires a Personal API Access Token.

### Header

```
Authorization: Bearer YOUR_TOKEN
```

## Request

### Headers

| Header        | Value          | Required |
| ------------- | -------------- | -------- |
| Authorization | Bearer {token} | Yes      |

### Path Parameters

| Parameter   | Type   | Required | Description  |
| ----------- | ------ | -------- | ------------ |
| projectName | string | Yes      | Project name |

### Query Parameters

| Parameter | Type   | Required | Description                                                                                                                                                                            |
| --------- | ------ | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| type      | string | Yes      | Connection type. Valid values: `email`, `kafka`, `elasticsearch`, `rabbitMq`, `ftp`, `graylog`, `syslog`, `webhook`, `logback`, `activeMq`, `snmp`, `linux-script`, `database`, `ldap` |

## Response

### Success Response (200 OK)

```json theme={null}
{
  "success": true,
  "resultList": [
    {
      "type": "email",
      "name": "my-email-connection",
      "description": "Email connection for notifications",
      "deployToWorker": true,
      "enabled": true,
      "host": "smtp.example.com",
      "port": 587,
      "username": "user@example.com",
      "password": null,
      "enableStartTls": true,
      "auth": true,
      "defaultEncoding": "UTF-8",
      "from": "noreply@example.com"
    },
    {
      "type": "kafka",
      "name": "my-kafka-connection",
      "description": "Kafka connection for event streaming",
      "deployToWorker": true,
      "enabled": true,
      "topicName": "events",
      "keyStoreName": "my-keystore",
      "trustStoreName": "my-truststore"
    }
  ],
  "resultCount": 2
}
```

#### Response Fields

| Field       | Type    | Description                             |
| ----------- | ------- | --------------------------------------- |
| success     | boolean | Indicates if the request was successful |
| resultList  | array   | List of connection objects              |
| resultCount | integer | Total number of connections             |

#### Connection Object Fields (Common)

| Field          | Type    | Description                                                                           |
| -------------- | ------- | ------------------------------------------------------------------------------------- |
| type           | string  | Connection type discriminator field. Identifies the connection type in API responses. |
| name           | string  | Connection name                                                                       |
| description    | string  | Connection description                                                                |
| deployToWorker | boolean | Whether to deploy to worker                                                           |
| enabled        | boolean | Whether connection is enabled                                                         |

**Note:** Connection-specific fields vary by connection type. Secret fields are returned as `null` in list operations.

### Error Response (401 Unauthorized)

```json theme={null}
{
  "error": "unauthorized_client",
  "error_description": "Invalid token"
}
```

### Error Response (404 Not Found)

```json theme={null}
{
  "error": "not_found",
  "error_description": "Project 'MyProject' not found"
}
```

## cURL Examples

### List Connections by Type (Database)

```bash theme={null}
curl -X GET \
  "https://demo.apinizer.com/apiops/projects/MyProject/connections/?type=database" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### List Connections by Type (Email)

```bash theme={null}
curl -X GET \
  "https://demo.apinizer.com/apiops/projects/MyProject/connections/?type=email" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

### List Connections by Type (Kafka)

```bash theme={null}
curl -X GET \
  "https://demo.apinizer.com/apiops/projects/MyProject/connections/?type=kafka" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

## Full JSON Body Example

This endpoint does not require a request body.

## Permissions

* User must have **any permission** in the project (read access)

## Notes and Warnings

* **Secret Fields**: Secret fields (password, apiKey, etc.) are masked and returned as `null` in list operations
* **Get Single Connection**: Use [Get Connection](/api-reference/connections/crud/get-connection) to retrieve full connection details including secrets
* **Connection Types**: Each connection type has different fields. See individual connection type documentation for details
* **Type Parameter Required**: The `type` query parameter is required. Since connections are stored in separate collections by type, you must specify the connection type to query
* **Valid Type Values**: `email`, `kafka`, `elasticsearch`, `rabbitMq`, `ftp`, `graylog`, `syslog`, `webhook`, `logback`, `activeMq`, `snmp`, `linux-script`, `database`, `ldap`

## Related Documentation

* [Get Connection](/api-reference/connections/crud/get-connection) - Get detailed connection information
* [Create Connection](/api-reference/connections/crud/create-connection) - Create a new connection
* [Email Connection](/api-reference/connections/connections/connection-email) - Email connection details
