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

# Test connection

> Tests the connectivity and permissions for a configured Postgres database.

Tests an existing Postgres connection. This verifies:

* network reachability
* authentication
* connect permissions
* replication slot validity

### Path parameters

<ParamField path="id_or_name" type="string" required>
  The ID or the name of the Postgres database connection to test.
</ParamField>

### Example request

```bash curl theme={null}
curl -X POST 'https://api.sequinstream.com/api/postgres_databases/production_rds/test_connection' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Content-Type: application/json'
```

## Response

<ResponseField name="success" type="boolean">
  Indicates whether all connection tests passed (`true`) or if any test failed (`false`).
</ResponseField>

<ResponseField name="reason" type="string" optional>
  If `success` is `false`, this field provides a human-readable reason for the failure.
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={null}
  {
      "success": true
  }
  ```

  ```json 422 Connection Timeout theme={null}
  {
      "success": false,
      "reason": "Connection timed out. Please verify the hostname and port are correct."
  }
  ```

  ```json 422 Auth Failure theme={null}
  {
      "success": false,
      "reason": "Error from Postgres: password authentication failed for user \"sequin_user\" (code=28P01)"
  }
  ```

  ```json 422 Permission Denied theme={null}
  {
      "success": false,
      "reason": "User does not have connect permission on database"
  }
  ```

  ```json 404 Not Found theme={null}
  {
      "errors": {
          "detail": "Postgres Database not found"
      }
  }
  ```
</ResponseExample>
