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

# Test a connection

> Use this endpoint to test the configured connection by establishing and closing a connection to the database. Returns the connection status, latency, and database name.



## OpenAPI

````yaml /en/openapi/v3-current/connections.yaml post /v1/management/connections/{id}/test
openapi: 3.1.0
info:
  title: Database Connections
  description: >-
    The database connections API provides endpoints for managing the database
    connections used by Reporter. It allows you to create, list, update, delete,
    and test database connections, as well as validate schemas against
    configured data sources.
  version: 1.0.0
servers:
  - url: https://reporter.sandbox.lerian.net
security: []
tags:
  - name: Database Connections
    description: Endpoints for managing database connections used by Reporter.
paths:
  /v1/management/connections/{id}/test:
    post:
      tags:
        - Database Connections
      summary: Test a connection
      description: >-
        Use this endpoint to test the configured connection by establishing and
        closing a connection to the database. Returns the connection status,
        latency, and database name.
      parameters:
        - $ref: '#/components/parameters/ConnectionId'
        - $ref: '#/components/parameters/Authorization'
      responses:
        '200':
          description: The result of the connection test.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TestConnectionResponse'
              examples:
                Success:
                  summary: Successful connection test
                  value:
                    status: success
                    message: Connection successful
                    latencyMs: 150
                Failure:
                  summary: Failed connection test
                  value:
                    status: failure
                    message: 'Connection refused: unable to reach host'
                    latencyMs: 0
        '400':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Error0404:
                  $ref: '#/components/examples/Error0404'
        '404':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                Error1001:
                  $ref: '#/components/examples/Error1001'
      security: []
components:
  parameters:
    ConnectionId:
      name: id
      in: path
      description: Unique identifier of the connection (UUID format).
      required: true
      schema:
        type: string
        format: uuid
        example: 019996b8-f3d1-7d2b-a192-6e91464d82fc
    Authorization:
      name: Authorization
      in: header
      description: >-
        The authorization token in the `Bearer <token>` format.


        **Important:** This header is required if your environment has Access
        Manager enabled. For more information, refer to the [Access
        Manager](/en/platform/access-manager/access-manager) documentation.
      required: false
      schema:
        type: string
        example: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
  schemas:
    TestConnectionResponse:
      type: object
      description: Response object containing the result of a connection test.
      required:
        - status
        - message
        - latencyMs
      properties:
        status:
          type: string
          description: Indicates whether the connection test was successful.
          enum:
            - success
            - failure
          example: success
        message:
          type: string
          description: A human-readable message describing the test result.
          example: Connection successful
        latencyMs:
          type: integer
          description: >-
            The time taken to establish the connection, measured in
            milliseconds.
          example: 150
    Error:
      type: object
      description: >-
        Response message error. Error codes use the `FET` prefix to identify
        issues related to the database connections API.
      required:
        - code
        - title
        - message
      properties:
        code:
          type: string
          description: A unique, stable identifier for the error (prefixed with `FET`).
          example: FET-0001
        title:
          type: string
          description: A brief summary of the issue.
          example: Missing required fields
        message:
          type: string
          description: Detailed guidance for resolving the error.
          example: >-
            One or more required fields are missing. Please ensure all required
            fields like configName, host, port, userName, and password are
            included.
  examples:
    Error0404:
      summary: Invalid Path Parameter
      value:
        code: FET-0404
        title: Invalid Path Parameter
        message: >-
          Path parameters is in an incorrect format. Please check the following
          parameter 'id' and ensure they meet the required format before trying
          again.
    Error1001:
      summary: Entity Not Found
      value:
        code: FET-1001
        title: Entity Not Found
        message: >-
          It was not possible to find the connection entity during the requested
          flow. Please review the data provided in the request.

````