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

# Configuration manager

# Configuration Manager API

The Configuration Manager Service provides a centralized way to manage configuration settings across your organization's services. It securely stores various configuration parameters in a key-value store (ETCD by default) and provides APIs to manage these configurations.

## Base URL

All endpoints are prefixed with `/api/v1/configurationManager`

## Authentication

All endpoints require authentication via Bearer token:

```http theme={null}
Authorization: Bearer YOUR_TOKEN
```

## Architecture Overview

The Configuration Manager Service is built on a Node.js backend that leverages [ETCD](https://etcd.io/) (or other compatible key-value stores) for secure configuration storage. The service:

* Securely encrypts sensitive configuration values using AES-256-GCM algorithm
* Provides a RESTful API for managing configurations
* Integrates with other services via event-driven architecture
* Controls access through authentication and authorization
* Performs health checks before saving configurations

## Key Features

* **Secure Storage**: All sensitive configurations are encrypted using AES-256-GCM algorithm
* **Health Checks**: Built-in validation of configuration parameters before storage
* **Event Notifications**: Publishes events when critical configurations change
* **Centralized Management**: Single service to control settings across the system
* **AI Model Management**: Advanced provider management for AI models with support for multiple models per provider
* **Connector Integration**: Support for various connectors including Google Workspace, Atlassian, OneDrive, and SharePoint

## Supported Configurations

The Configuration Manager handles various types of configurations:

1. **Storage Configurations** - AWS S3, Azure Blob, or Local storage settings
2. **Authentication Configurations** - Azure AD, Google, Microsoft, SSO, and OAuth settings
3. **Database Configurations** - MongoDB, ArangoDB, and Qdrant settings
4. **Key-Value Store Configurations** - Redis settings
5. **Message Broker Configurations** - Kafka settings
6. **SMTP Configurations** - Email service settings
7. **AI Models Configurations** - Settings for LLM, embedding, OCR, SLM, reasoning, and multiModal models
8. **Connector Configurations** - Google Workspace, Atlassian, OneDrive, and SharePoint integrations
9. **Public URL Configurations** - Frontend and connector URLs
10. **Metrics Collection Configurations** - Settings for metrics gathering

## API Endpoints

<AccordionGroup>
  <Accordion title="Storage Configuration">
    The Storage Configuration API enables you to configure different storage backends for your application.

    <AccordionGroup>
      <Accordion title="POST /storageConfig - Set Storage Configuration">
        Configure the storage service with specific backend details.

        <Tabs>
          <Tab title="Request">
            **Endpoint:** `POST /api/v1/configurationManager/storageConfig`

            **Request Body Parameters:**

            | Parameter   | Type   | Required | Description                                     |
            | ----------- | ------ | -------- | ----------------------------------------------- |
            | storageType | string | Yes      | Type of storage ("s3", "azureBlob", or "local") |

            **S3 Storage Config:**

            ```json theme={null}
            {
              "storageType": "s3",
              "s3AccessKeyId": "YOUR_ACCESS_KEY_ID",
              "s3SecretAccessKey": "YOUR_SECRET_ACCESS_KEY",
              "s3Region": "us-west-2",
              "s3BucketName": "your-bucket-name"
            }
            ```

            **Azure Blob Storage Config (Connection String):**

            ```json theme={null}
            {
              "storageType": "azureBlob",
              "azureBlobConnectionString": "DefaultEndpointsProtocol=https;AccountName=...",
              "containerName": "your-container-name"
            }
            ```

            **Azure Blob Storage Config (Individual Parameters):**

            ```json theme={null}
            {
              "storageType": "azureBlob",
              "accountName": "your-account-name",
              "accountKey": "your-account-key",
              "containerName": "your-container-name",
              "endpointProtocol": "https",
              "endpointSuffix": "core.windows.net"
            }
            ```

            **Local Storage Config:**

            ```json theme={null}
            {
              "storageType": "local",
              "mountName": "PipesHub",
              "baseUrl": "http://localhost:3000"
            }
            ```
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            ```json theme={null}
            {
              "message": "Storage configuration saved successfully"
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>

      <Accordion title="GET /storageConfig - Get Storage Configuration">
        Retrieve the current storage configuration.

        <Tabs>
          <Tab title="Request">
            **Endpoint:** `GET /api/v1/configurationManager/storageConfig`
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            **S3 Response:**

            ```json theme={null}
            {
              "storageType": "s3",
              "accessKeyId": "YOUR_ACCESS_KEY_ID",
              "secretAccessKey": "YOUR_SECRET_ACCESS_KEY",
              "region": "us-west-2",
              "bucketName": "your-bucket-name"
            }
            ```

            **Azure Blob Response:**

            ```json theme={null}
            {
              "storageType": "azureBlob",
              "endpointProtocol": "https",
              "accountName": "your-account-name",
              "accountKey": "your-account-key",
              "endpointSuffix": "core.windows.net",
              "containerName": "your-container-name"
            }
            ```

            **Local Storage Response:**

            ```json theme={null}
            {
              "mountName": "PipesHub",
              "baseUrl": "http://localhost:3000"
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="SMTP Configuration">
    Configure email service settings for your application.

    <AccordionGroup>
      <Accordion title="POST /smtpConfig - Set SMTP Configuration">
        Configure SMTP settings for email services.

        <Tabs>
          <Tab title="Request">
            **Endpoint:** `POST /api/v1/configurationManager/smtpConfig`

            **Request Body Parameters:**

            | Parameter | Type   | Required | Description          |
            | --------- | ------ | -------- | -------------------- |
            | host      | string | Yes      | SMTP server host     |
            | port      | number | Yes      | SMTP server port     |
            | username  | string | No       | SMTP username        |
            | password  | string | No       | SMTP password        |
            | fromEmail | string | Yes      | Default sender email |

            ```json theme={null}
            {
              "host": "smtp.example.com",
              "port": 587,
              "username": "your-username",
              "password": "your-password",
              "fromEmail": "no-reply@example.com"
            }
            ```
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            ```json theme={null}
            {
              "message": "SMTP config created successfully"
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>

      <Accordion title="GET /smtpConfig - Get SMTP Configuration">
        Retrieve the current SMTP configuration.

        <Tabs>
          <Tab title="Request">
            **Endpoint:** `GET /api/v1/configurationManager/smtpConfig`
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            ```json theme={null}
            {
              "host": "smtp.example.com",
              "port": 587,
              "username": "your-username",
              "password": "your-password",
              "fromEmail": "no-reply@example.com"
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="Authentication Configuration">
    The Authentication Configuration API allows you to manage various authentication providers.

    <AccordionGroup>
      <Accordion title="Azure AD Authentication">
        Configure Azure Active Directory authentication.

        <AccordionGroup>
          <Accordion title="POST /authConfig/azureAd - Set Azure AD Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/authConfig/azureAd`

                **Request Body Parameters:**

                | Parameter | Type   | Required | Description                               |
                | --------- | ------ | -------- | ----------------------------------------- |
                | clientId  | string | Yes      | Azure AD client ID                        |
                | tenantId  | string | No       | Azure AD tenant ID (defaults to "common") |

                ```json theme={null}
                {
                  "clientId": "your-client-id",
                  "tenantId": "your-tenant-id"
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "Azure AD config created successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /authConfig/azureAd - Get Azure AD Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/authConfig/azureAd`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "clientId": "your-client-id",
                  "tenantId": "your-tenant-id",
                  "authority": "https://login.microsoftonline.com/your-tenant-id"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="Microsoft Authentication">
        Configure Microsoft authentication.

        <AccordionGroup>
          <Accordion title="POST /authConfig/microsoft - Set Microsoft Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/authConfig/microsoft`

                **Request Body Parameters:**

                | Parameter | Type   | Required | Description                                |
                | --------- | ------ | -------- | ------------------------------------------ |
                | clientId  | string | Yes      | Microsoft client ID                        |
                | tenantId  | string | No       | Microsoft tenant ID (defaults to "common") |

                ```json theme={null}
                {
                  "clientId": "your-client-id",
                  "tenantId": "your-tenant-id"
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "Microsoft Auth config created successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /authConfig/microsoft - Get Microsoft Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/authConfig/microsoft`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "clientId": "your-client-id",
                  "tenantId": "your-tenant-id",
                  "authority": "https://login.microsoftonline.com/your-tenant-id"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="Google Authentication">
        Configure Google authentication.

        <AccordionGroup>
          <Accordion title="POST /authConfig/google - Set Google Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/authConfig/google`

                **Request Body Parameters:**

                | Parameter | Type   | Required | Description      |
                | --------- | ------ | -------- | ---------------- |
                | clientId  | string | Yes      | Google client ID |

                ```json theme={null}
                {
                  "clientId": "your-client-id"
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "Google Auth config created successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /authConfig/google - Get Google Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/authConfig/google`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "clientId": "your-client-id"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="SSO Authentication">
        Configure SAML-based Single Sign-On.

        <AccordionGroup>
          <Accordion title="POST /authConfig/sso - Set SSO Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/authConfig/sso`

                **Request Body Parameters:**

                | Parameter   | Type   | Required | Description                   |
                | ----------- | ------ | -------- | ----------------------------- |
                | entryPoint  | string | Yes      | SSO entry point URL           |
                | certificate | string | Yes      | SSO certificate               |
                | emailKey    | string | Yes      | Key for email in SSO response |

                ```json theme={null}
                {
                  "entryPoint": "https://sso.example.com/saml",
                  "certificate": "-----BEGIN CERTIFICATE-----\nMIIC...\n-----END CERTIFICATE-----",
                  "emailKey": "email"
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "Sso config created successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /authConfig/sso - Get SSO Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/authConfig/sso`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "entryPoint": "https://sso.example.com/saml",
                  "certificate": "MIICertificateContent...",
                  "emailKey": "email"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="OAuth Authentication">
        Configure custom OAuth authentication.

        <AccordionGroup>
          <Accordion title="POST /authConfig/oauth - Set OAuth Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/authConfig/oauth`

                **Request Body Parameters:**

                | Parameter        | Type   | Required | Description            |
                | ---------------- | ------ | -------- | ---------------------- |
                | providerName     | string | Yes      | OAuth provider name    |
                | clientId         | string | Yes      | OAuth client ID        |
                | clientSecret     | string | No       | OAuth client secret    |
                | authorizationUrl | string | No       | Authorization URL      |
                | tokenEndpoint    | string | No       | Token endpoint URL     |
                | userInfoEndpoint | string | No       | User info endpoint URL |
                | scope            | string | No       | OAuth scope            |
                | redirectUri      | string | No       | Redirect URI           |

                ```json theme={null}
                {
                  "providerName": "Custom OAuth Provider",
                  "clientId": "your-client-id",
                  "clientSecret": "your-client-secret",
                  "authorizationUrl": "https://provider.com/oauth/authorize",
                  "tokenEndpoint": "https://provider.com/oauth/token",
                  "userInfoEndpoint": "https://provider.com/oauth/userinfo",
                  "scope": "read:user",
                  "redirectUri": "https://yourapp.com/callback"
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "OAuth config created successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /authConfig/oauth - Get OAuth Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/authConfig/oauth`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "providerName": "Custom OAuth Provider",
                  "clientId": "your-client-id",
                  "clientSecret": "your-client-secret",
                  "authorizationUrl": "https://provider.com/oauth/authorize",
                  "tokenEndpoint": "https://provider.com/oauth/token",
                  "userInfoEndpoint": "https://provider.com/oauth/userinfo",
                  "scope": "read:user",
                  "redirectUri": "https://yourapp.com/callback"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="Database Configuration">
    Configure database connections for your application. All database configurations include automatic health checks before saving.

    <AccordionGroup>
      <Accordion title="MongoDB Configuration">
        Configure MongoDB database connection.

        <AccordionGroup>
          <Accordion title="POST /mongoDBConfig - Set MongoDB Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/mongoDBConfig`

                **Request Body Parameters:**

                | Parameter | Type   | Required | Description            |
                | --------- | ------ | -------- | ---------------------- |
                | uri       | string | Yes      | MongoDB connection URI |

                ```json theme={null}
                {
                  "uri": "mongodb://username:password@hostname:port/database"
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "Mongo DB config created successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /mongoDBConfig - Get MongoDB Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/mongoDBConfig`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "uri": "mongodb://username:password@hostname:port/database",
                  "db": "pipesHub"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="ArangoDB Configuration">
        Configure ArangoDB database connection.

        <AccordionGroup>
          <Accordion title="POST /arangoDBConfig - Set ArangoDB Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/arangoDBConfig`

                **Request Body Parameters:**

                | Parameter | Type   | Required | Description             |
                | --------- | ------ | -------- | ----------------------- |
                | url       | string | Yes      | ArangoDB connection URL |
                | username  | string | No       | ArangoDB username       |
                | password  | string | No       | ArangoDB password       |

                ```json theme={null}
                {
                  "url": "http://localhost:8529",
                  "username": "root",
                  "password": "password"
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "Arango DB config created successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /arangoDBConfig - Get ArangoDB Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/arangoDBConfig`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "url": "http://localhost:8529",
                  "username": "root",
                  "password": "password",
                  "db": "pipesHub"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="Qdrant Configuration">
        Configure Qdrant vector database connection.

        <AccordionGroup>
          <Accordion title="POST /qdrantConfig - Set Qdrant Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/qdrantConfig`

                **Request Body Parameters:**

                | Parameter | Type   | Required | Description                                 |
                | --------- | ------ | -------- | ------------------------------------------- |
                | host      | string | Yes      | Qdrant server host                          |
                | port      | number | Yes      | Qdrant HTTP port                            |
                | grpcPort  | number | No       | Qdrant gRPC port                            |
                | apiKey    | string | No       | Qdrant API key (not required for localhost) |

                ```json theme={null}
                {
                  "host": "localhost",
                  "port": 6333,
                  "grpcPort": 6334,
                  "apiKey": "your-api-key"
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "Qdrant config created successfully",
                  "warningMessage": "localhost does not require an API key"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /qdrantConfig - Get Qdrant Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/qdrantConfig`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "host": "localhost",
                  "port": 6333,
                  "grpcPort": 6334,
                  "apiKey": "your-api-key"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="Key-Value Store Configuration">
    Configure Redis as a key-value store with automatic health checks.

    <AccordionGroup>
      <Accordion title="POST /redisConfig - Set Redis Config">
        <Tabs>
          <Tab title="Request">
            **Endpoint:** `POST /api/v1/configurationManager/redisConfig`

            **Request Body Parameters:**

            | Parameter | Type    | Required | Description                     |
            | --------- | ------- | -------- | ------------------------------- |
            | host      | string  | Yes      | Redis server host               |
            | port      | number  | Yes      | Redis server port               |
            | password  | string  | No       | Redis password                  |
            | tls       | boolean | No       | Enable TLS for Redis connection |

            ```json theme={null}
            {
              "host": "redis.example.com",
              "port": 6379,
              "password": "your-password",
              "tls": true
            }
            ```
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            ```json theme={null}
            {
              "message": "Redis config created successfully"
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>

      <Accordion title="GET /redisConfig - Get Redis Config">
        <Tabs>
          <Tab title="Request">
            **Endpoint:** `GET /api/v1/configurationManager/redisConfig`
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            ```json theme={null}
            {
              "host": "redis.example.com",
              "port": 6379,
              "password": "your-password",
              "tls": true
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="Message Broker Configuration">
    Configure Kafka message broker with automatic health checks and broker validation.

    <AccordionGroup>
      <Accordion title="POST /kafkaConfig - Set Kafka Config">
        <Tabs>
          <Tab title="Request">
            **Endpoint:** `POST /api/v1/configurationManager/kafkaConfig`

            **Request Body Parameters:**

            | Parameter | Type      | Required | Description                 |
            | --------- | --------- | -------- | --------------------------- |
            | brokers   | string\[] | Yes      | Array of Kafka broker URLs  |
            | sasl      | object    | No       | SASL authentication details |

            ```json theme={null}
            {
              "brokers": ["kafka-1:9092", "kafka-2:9092"],
              "sasl": {
                "mechanism": "plain",
                "username": "your-username",
                "password": "your-password"
              }
            }
            ```
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            ```json theme={null}
            {
              "message": "Kafka config created successfully",
              "warningMessage": "Unreachable-Brokers detected : \"kafka-3:9092\""
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>

      <Accordion title="GET /kafkaConfig - Get Kafka Config">
        <Tabs>
          <Tab title="Request">
            **Endpoint:** `GET /api/v1/configurationManager/kafkaConfig`
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            ```json theme={null}
            {
              "brokers": ["kafka-1:9092", "kafka-2:9092"],
              "sasl": {
                "mechanism": "plain",
                "username": "your-username",
                "password": "your-password"
              }
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="AI Models Configuration">
    Configure AI models for various tasks with advanced provider management.

    <AccordionGroup>
      <Accordion title="Complete AI Models Configuration">
        Manage the complete AI models configuration for all model types.

        <AccordionGroup>
          <Accordion title="POST /aiModelsConfig - Set AI Models Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/aiModelsConfig`

                **Request Body Parameters:**
                At least one AI model type must be configured.

                ```json theme={null}
                {
                  "llm": [
                    {
                      "provider": "openAI",
                      "configuration": {
                        "model": "gpt-4o,gpt-4o-mini",
                        "apiKey": "your-openai-key",
                        "organizationId": "your-org-id"
                      },
                      "isMultimodal": false,
                      "isDefault": true
                    }
                  ],
                  "embedding": [
                    {
                      "provider": "openAI",
                      "configuration": {
                        "model": "text-embedding-ada-002",
                        "apiKey": "your-openai-key"
                      },
                      "isMultimodal": false,
                      "isDefault": true
                    }
                  ]
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "AI config created successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /aiModelsConfig - Get AI Models Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/aiModelsConfig`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "llm": [
                    {
                      "provider": "openAI",
                      "configuration": {
                        "model": "gpt-4o,gpt-4o-mini",
                        "apiKey": "your-openai-key",
                        "organizationId": "your-org-id"
                      },
                      "modelKey": "uuid-generated-key",
                      "isMultimodal": false,
                      "isDefault": true
                    }
                  ],
                  "embedding": [
                    {
                      "provider": "openAI",
                      "configuration": {
                        "model": "text-embedding-ada-002",
                        "apiKey": "your-openai-key"
                      },
                      "modelKey": "uuid-generated-key",
                      "isMultimodal": false,
                      "isDefault": true
                    }
                  ],
                  "ocr": [],
                  "slm": [],
                  "reasoning": [],
                  "multiModal": []
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="AI Models Management">
        Advanced management endpoints for AI model providers.

        <AccordionGroup>
          <Accordion title="GET /ai-models - Get All AI Models">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/ai-models`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "status": "success",
                  "models": {
                    "ocr": [],
                    "embedding": [
                      {
                        "provider": "openAI",
                        "configuration": {
                          "model": "text-embedding-ada-002",
                          "apiKey": "your-openai-key"
                        },
                        "modelKey": "uuid-generated-key",
                        "isMultimodal": false,
                        "isDefault": true
                      }
                    ],
                    "slm": [],
                    "llm": [
                      {
                        "provider": "openAI",
                        "configuration": {
                          "model": "gpt-4o,gpt-4o-mini",
                          "apiKey": "your-openai-key"
                        },
                        "modelKey": "uuid-generated-key",
                        "isMultimodal": false,
                        "isDefault": true
                      }
                    ],
                    "reasoning": [],
                    "multiModal": []
                  },
                  "message": "AI models retrieved successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /ai-models/{modelType} - Get Models by Type">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/ai-models/{modelType}`

                **Path Parameters:**

                | Parameter | Type   | Required | Description                                             |
                | --------- | ------ | -------- | ------------------------------------------------------- |
                | modelType | string | Yes      | One of: llm, embedding, ocr, slm, reasoning, multiModal |
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "status": "success",
                  "models": [
                    {
                      "provider": "openAI",
                      "configuration": {
                        "model": "gpt-4o,gpt-4o-mini",
                        "apiKey": "your-openai-key"
                      },
                      "modelKey": "uuid-generated-key",
                      "isMultimodal": false,
                      "isDefault": true
                    }
                  ],
                  "message": "Found 1 llm models"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /ai-models/available/{modelType} - Get Available Models">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/ai-models/available/{modelType}`

                **Path Parameters:**

                | Parameter | Type   | Required | Description                                             |
                | --------- | ------ | -------- | ------------------------------------------------------- |
                | modelType | string | Yes      | One of: llm, embedding, ocr, slm, reasoning, multiModal |
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "status": "success",
                  "models": [
                    {
                      "modelType": "llm",
                      "provider": "openAI",
                      "modelName": "gpt-4o",
                      "modelKey": "uuid-generated-key",
                      "isMultimodal": false,
                      "isDefault": true
                    },
                    {
                      "modelType": "llm",
                      "provider": "openAI",
                      "modelName": "gpt-4o-mini",
                      "modelKey": "uuid-generated-key",
                      "isMultimodal": false,
                      "isDefault": false
                    }
                  ],
                  "message": "Found 2 llm models"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="AI Model Provider Management">
        CRUD operations for individual AI model providers.

        <AccordionGroup>
          <Accordion title="POST /ai-models/providers - Add AI Model Provider">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/ai-models/providers`

                **Request Body Parameters:**

                | Parameter     | Type    | Required | Description                                               |
                | ------------- | ------- | -------- | --------------------------------------------------------- |
                | modelType     | string  | Yes      | One of: llm, embedding, ocr, slm, reasoning, multiModal   |
                | provider      | string  | Yes      | Provider name (e.g., openAI, anthropic, cohere)           |
                | configuration | object  | Yes      | Provider-specific configuration                           |
                | isMultimodal  | boolean | No       | Whether model supports multimodal input (default: false)  |
                | isDefault     | boolean | No       | Whether this should be the default model (default: false) |

                ```json theme={null}
                {
                  "modelType": "llm",
                  "provider": "anthropic",
                  "configuration": {
                    "model": "claude-3-opus",
                    "apiKey": "your-anthropic-key"
                  },
                  "isMultimodal": true,
                  "isDefault": false
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "status": "success",
                  "message": "LLM provider added successfully",
                  "details": {
                    "modelKey": "uuid-generated-key",
                    "modelType": "llm",
                    "provider": "anthropic",
                    "model": "claude-3-opus",
                    "isDefault": false
                  }
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="PUT /ai-models/providers/{modelType}/{modelKey} - Update AI Model Provider">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `PUT /api/v1/configurationManager/ai-models/providers/{modelType}/{modelKey}`

                **Path Parameters:**

                | Parameter | Type   | Required | Description                                             |
                | --------- | ------ | -------- | ------------------------------------------------------- |
                | modelType | string | Yes      | One of: llm, embedding, ocr, slm, reasoning, multiModal |
                | modelKey  | string | Yes      | Unique key for the model configuration                  |

                **Request Body Parameters:**

                | Parameter     | Type    | Required | Description                                               |
                | ------------- | ------- | -------- | --------------------------------------------------------- |
                | provider      | string  | Yes      | Provider name                                             |
                | configuration | object  | Yes      | Provider-specific configuration                           |
                | isMultimodal  | boolean | No       | Whether model supports multimodal input (default: false)  |
                | isDefault     | boolean | No       | Whether this should be the default model (default: false) |

                ```json theme={null}
                {
                  "provider": "anthropic",
                  "configuration": {
                    "model": "claude-3-sonnet",
                    "apiKey": "your-updated-anthropic-key"
                  },
                  "isMultimodal": true,
                  "isDefault": true
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "status": "success",
                  "message": "LLM provider updated successfully",
                  "details": {
                    "modelKey": "uuid-generated-key",
                    "modelType": "llm",
                    "provider": "anthropic",
                    "model": "claude-3-sonnet"
                  }
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="DELETE /ai-models/providers/{modelType}/{modelKey} - Delete AI Model Provider">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `DELETE /api/v1/configurationManager/ai-models/providers/{modelType}/{modelKey}`

                **Path Parameters:**

                | Parameter | Type   | Required | Description                                             |
                | --------- | ------ | -------- | ------------------------------------------------------- |
                | modelType | string | Yes      | One of: llm, embedding, ocr, slm, reasoning, multiModal |
                | modelKey  | string | Yes      | Unique key for the model configuration                  |
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "status": "success",
                  "message": "LLM provider deleted successfully",
                  "details": {
                    "modelKey": "uuid-generated-key",
                    "modelType": "llm",
                    "provider": "anthropic",
                    "model": "claude-3-opus",
                    "wasDefault": false
                  }
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="PUT /ai-models/default/{modelType}/{modelKey} - Update Default AI Model">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `PUT /api/v1/configurationManager/ai-models/default/{modelType}/{modelKey}`

                **Path Parameters:**

                | Parameter | Type   | Required | Description                                             |
                | --------- | ------ | -------- | ------------------------------------------------------- |
                | modelType | string | Yes      | One of: llm, embedding, ocr, slm, reasoning, multiModal |
                | modelKey  | string | Yes      | Unique key for the model configuration                  |
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "status": "success",
                  "message": "Default llm model updated successfully",
                  "details": {
                    "modelKey": "uuid-generated-key",
                    "modelType": "llm",
                    "provider": "anthropic",
                    "model": "claude-3-opus"
                  }
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="Connector Configuration">
    Configure connectors for integrating with external services.

    <AccordionGroup>
      <Accordion title="Google Workspace Configuration">
        Configure Google Workspace integration settings.

        <AccordionGroup>
          <Accordion title="Google Workspace OAuth Configuration">
            <AccordionGroup>
              <Accordion title="POST /connectors/googleWorkspaceOauthConfig - Set Google Workspace OAuth Config">
                <Tabs>
                  <Tab title="Request">
                    **Endpoint:** `POST /api/v1/configurationManager/connectors/googleWorkspaceOauthConfig`

                    **Request Body Parameters:**

                    | Parameter             | Type           | Required | Description                                                    |
                    | --------------------- | -------------- | -------- | -------------------------------------------------------------- |
                    | clientId              | string         | Yes      | Google client ID                                               |
                    | clientSecret          | string         | Yes      | Google client secret                                           |
                    | enableRealTimeUpdates | boolean/string | No       | Enable real-time updates                                       |
                    | topicName             | string         | No       | Pub/Sub topic name (required if enableRealTimeUpdates is true) |

                    ```json theme={null}
                    {
                      "clientId": "your-google-client-id",
                      "clientSecret": "your-google-client-secret",
                      "enableRealTimeUpdates": true,
                      "topicName": "gmail-updates"
                    }
                    ```
                  </Tab>

                  <Tab title="Response">
                    **Status:** `200 OK`

                    ```json theme={null}
                    {
                      "message": "Google Workspace credentials created successfully"
                    }
                    ```
                  </Tab>
                </Tabs>
              </Accordion>

              <Accordion title="GET /connectors/googleWorkspaceOauthConfig - Get Google Workspace OAuth Config">
                <Tabs>
                  <Tab title="Request">
                    **Endpoint:** `GET /api/v1/configurationManager/connectors/googleWorkspaceOauthConfig`
                  </Tab>

                  <Tab title="Response">
                    **Status:** `200 OK`

                    ```json theme={null}
                    {
                      "clientId": "your-google-client-id",
                      "clientSecret": "your-google-client-secret",
                      "enableRealTimeUpdates": true,
                      "topicName": "gmail-updates"
                    }
                    ```
                  </Tab>
                </Tabs>
              </Accordion>
            </AccordionGroup>
          </Accordion>

          <Accordion title="Google Workspace Credentials">
            <AccordionGroup>
              <Accordion title="POST /connectors/googleWorkspaceCredentials - Set Google Workspace Credentials">
                <Tabs>
                  <Tab title="Request">
                    **Endpoint:** `POST /api/v1/configurationManager/connectors/googleWorkspaceCredentials`

                    **Content-Type:** `multipart/form-data`

                    **Request Body Parameters:**

                    | Parameter                  | Type           | Required    | Description                                                    |
                    | -------------------------- | -------------- | ----------- | -------------------------------------------------------------- |
                    | googleWorkspaceCredentials | file           | No          | JSON file with credentials (for business accounts)             |
                    | userType                   | string         | No          | "individual" or "business"                                     |
                    | fileChanged                | boolean        | No          | Whether the file was changed (for business accounts)           |
                    | adminEmail                 | string         | Conditional | Required for business accounts                                 |
                    | enableRealTimeUpdates      | boolean/string | No          | Enable real-time updates                                       |
                    | topicName                  | string         | No          | Pub/Sub topic name (required if enableRealTimeUpdates is true) |

                    For individual accounts, you can also send credentials directly in the request body:

                    ```json theme={null}
                    {
                      "access_token": "your-access-token",
                      "refresh_token": "your-refresh-token",
                      "access_token_expiry_time": 1640995200000,
                      "refresh_token_expiry_time": 1672531200000,
                      "enableRealTimeUpdates": true,
                      "topicName": "gmail-updates"
                    }
                    ```
                  </Tab>

                  <Tab title="Response">
                    **Status:** `200 OK`

                    ```json theme={null}
                    {
                      "message": "Successfully updated"
                    }
                    ```
                  </Tab>
                </Tabs>
              </Accordion>

              <Accordion title="GET /connectors/googleWorkspaceCredentials - Get Google Workspace Credentials">
                <Tabs>
                  <Tab title="Request">
                    **Endpoint:** `GET /api/v1/configurationManager/connectors/googleWorkspaceCredentials`
                  </Tab>

                  <Tab title="Response">
                    **Status:** `200 OK`

                    **Individual Account Response:**

                    ```json theme={null}
                    {
                      "access_token": "your-access-token",
                      "refresh_token": "your-refresh-token",
                      "access_token_expiry_time": 1640995200000,
                      "refresh_token_expiry_time": 1672531200000,
                      "enableRealTimeUpdates": true,
                      "topicName": "gmail-updates",
                      "clientId": "your-google-client-id",
                      "clientSecret": "your-google-client-secret"
                    }
                    ```

                    **Business Account Response:**

                    ```json theme={null}
                    {
                      "type": "service_account",
                      "project_id": "your-project-id",
                      "private_key_id": "your-private-key-id",
                      "private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
                      "client_email": "service-account@project.iam.gserviceaccount.com",
                      "client_id": "your-client-id",
                      "auth_uri": "https://accounts.google.com/o/oauth2/auth",
                      "token_uri": "https://oauth2.googleapis.com/token",
                      "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
                      "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/...",
                      "universe_domain": "googleapis.com",
                      "adminEmail": "admin@example.com",
                      "enableRealTimeUpdates": true,
                      "topicName": "gmail-updates"
                    }
                    ```
                  </Tab>
                </Tabs>
              </Accordion>
            </AccordionGroup>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="Atlassian Configuration">
        Configure Atlassian integration.

        <AccordionGroup>
          <Accordion title="POST /connectors/atlassian/config - Set Atlassian Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/connectors/atlassian/config`

                **Request Body Parameters:**

                | Parameter    | Type   | Required | Description             |
                | ------------ | ------ | -------- | ----------------------- |
                | clientId     | string | Yes      | Atlassian client ID     |
                | clientSecret | string | Yes      | Atlassian client secret |

                ```json theme={null}
                {
                  "clientId": "your-atlassian-client-id",
                  "clientSecret": "your-atlassian-client-secret"
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "Atlassian config created successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /connectors/atlassian/config - Get Atlassian Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/connectors/atlassian/config`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "clientId": "your-atlassian-client-id",
                  "clientSecret": "your-atlassian-client-secret"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="OneDrive Configuration">
        Configure Microsoft OneDrive integration.

        <AccordionGroup>
          <Accordion title="POST /connectors/onedrive/config - Set OneDrive Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/connectors/onedrive/config`

                **Request Body Parameters:**

                | Parameter       | Type    | Required | Description                            |
                | --------------- | ------- | -------- | -------------------------------------- |
                | clientId        | string  | Yes      | Microsoft client ID                    |
                | clientSecret    | string  | Yes      | Microsoft client secret                |
                | tenantId        | string  | Yes      | Microsoft tenant ID                    |
                | hasAdminConsent | boolean | No       | Whether admin consent has been granted |

                ```json theme={null}
                {
                  "clientId": "your-microsoft-client-id",
                  "clientSecret": "your-microsoft-client-secret",
                  "tenantId": "your-tenant-id",
                  "hasAdminConsent": true
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "OneDrive credentials created successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /connectors/onedrive/config - Get OneDrive Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/connectors/onedrive/config`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "clientId": "your-microsoft-client-id",
                  "clientSecret": "your-microsoft-client-secret",
                  "tenantId": "your-tenant-id",
                  "hasAdminConsent": true
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="SharePoint Configuration">
        Configure Microsoft SharePoint integration.

        <AccordionGroup>
          <Accordion title="POST /connectors/sharepoint/config - Set SharePoint Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/connectors/sharepoint/config`

                **Request Body Parameters:**

                | Parameter        | Type    | Required | Description                            |
                | ---------------- | ------- | -------- | -------------------------------------- |
                | clientId         | string  | Yes      | Microsoft client ID                    |
                | clientSecret     | string  | Yes      | Microsoft client secret                |
                | tenantId         | string  | Yes      | Microsoft tenant ID                    |
                | sharepointDomain | string  | Yes      | SharePoint domain                      |
                | hasAdminConsent  | boolean | No       | Whether admin consent has been granted |

                ```json theme={null}
                {
                  "clientId": "your-microsoft-client-id",
                  "clientSecret": "your-microsoft-client-secret",
                  "tenantId": "your-tenant-id",
                  "sharepointDomain": "yourcompany.sharepoint.com",
                  "hasAdminConsent": true
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "SharePoint credentials created successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /connectors/sharepoint/config - Get SharePoint Config">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/connectors/sharepoint/config`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "clientId": "your-microsoft-client-id",
                  "clientSecret": "your-microsoft-client-secret",
                  "tenantId": "your-tenant-id",
                  "sharepointDomain": "yourcompany.sharepoint.com",
                  "hasAdminConsent": true
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="Public URL Configuration">
    Configure public URLs for frontend and connector services.

    <AccordionGroup>
      <Accordion title="Frontend URL Configuration">
        <AccordionGroup>
          <Accordion title="POST /frontendPublicUrl - Set Frontend URL">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/frontendPublicUrl`

                **Request Body Parameters:**

                | Parameter | Type   | Required | Description                     |
                | --------- | ------ | -------- | ------------------------------- |
                | url       | string | Yes      | Public URL for frontend service |

                ```json theme={null}
                {
                  "url": "https://app.example.com"
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "Frontend Url saved successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /frontendPublicUrl - Get Frontend URL">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/frontendPublicUrl`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "url": "https://app.example.com"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>

      <Accordion title="Connector URL Configuration">
        <AccordionGroup>
          <Accordion title="POST /connectorPublicUrl - Set Connector URL">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `POST /api/v1/configurationManager/connectorPublicUrl`

                **Request Body Parameters:**

                | Parameter | Type   | Required | Description                      |
                | --------- | ------ | -------- | -------------------------------- |
                | url       | string | Yes      | Public URL for connector service |

                ```json theme={null}
                {
                  "url": "https://connectors.example.com"
                }
                ```
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "message": "Connector Url saved successfully"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>

          <Accordion title="GET /connectorPublicUrl - Get Connector URL">
            <Tabs>
              <Tab title="Request">
                **Endpoint:** `GET /api/v1/configurationManager/connectorPublicUrl`
              </Tab>

              <Tab title="Response">
                **Status:** `200 OK`

                ```json theme={null}
                {
                  "url": "https://connectors.example.com"
                }
                ```
              </Tab>
            </Tabs>
          </Accordion>
        </AccordionGroup>
      </Accordion>
    </AccordionGroup>
  </Accordion>

  <Accordion title="Metrics Collection Configuration">
    Configure metrics collection settings for monitoring and analytics.

    <AccordionGroup>
      <Accordion title="PUT /metricsCollection/toggle - Toggle Metrics Collection">
        <Tabs>
          <Tab title="Request">
            **Endpoint:** `PUT /api/v1/configurationManager/metricsCollection/toggle`

            **Request Body Parameters:**

            | Parameter              | Type    | Required | Description                          |
            | ---------------------- | ------- | -------- | ------------------------------------ |
            | enableMetricCollection | boolean | Yes      | Enable or disable metrics collection |

            ```json theme={null}
            {
              "enableMetricCollection": true
            }
            ```
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            ```json theme={null}
            {
              "message": "Metrics collection toggled successfully"
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>

      <Accordion title="GET /metricsCollection - Get Metrics Collection Config">
        <Tabs>
          <Tab title="Request">
            **Endpoint:** `GET /api/v1/configurationManager/metricsCollection`
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            ```json theme={null}
            {
              "enableMetricCollection": "true",
              "pushIntervalMs": "30000",
              "serverUrl": "https://metrics.example.com"
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>

      <Accordion title="PATCH /metricsCollection/pushInterval - Set Push Interval">
        <Tabs>
          <Tab title="Request">
            **Endpoint:** `PATCH /api/v1/configurationManager/metricsCollection/pushInterval`

            **Request Body Parameters:**

            | Parameter      | Type   | Required | Description                   |
            | -------------- | ------ | -------- | ----------------------------- |
            | pushIntervalMs | number | Yes      | Push interval in milliseconds |

            ```json theme={null}
            {
              "pushIntervalMs": 30000
            }
            ```
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            ```json theme={null}
            {
              "message": "Metrics collection push interval set successfully"
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>

      <Accordion title="PATCH /metricsCollection/serverUrl - Set Remote Server">
        <Tabs>
          <Tab title="Request">
            **Endpoint:** `PATCH /api/v1/configurationManager/metricsCollection/serverUrl`

            **Request Body Parameters:**

            | Parameter | Type   | Required | Description               |
            | --------- | ------ | -------- | ------------------------- |
            | serverUrl | string | Yes      | Remote metrics server URL |

            ```json theme={null}
            {
              "serverUrl": "https://metrics.example.com"
            }
            ```
          </Tab>

          <Tab title="Response">
            **Status:** `200 OK`

            ```json theme={null}
            {
              "message": "Metrics collection remote server set successfully"
            }
            ```
          </Tab>
        </Tabs>
      </Accordion>
    </AccordionGroup>
  </Accordion>
</AccordionGroup>

## Encryption and Security

The Configuration Manager Service uses AES-256-GCM encryption to protect sensitive configuration data. Key features include:

* **Secret Key Hashing**: The secret key used for encryption is hashed using SHA-256 for added security
* **Per-Configuration Encryption**: Each sensitive configuration is individually encrypted
* **Fine-grained Access Control**: API endpoints require appropriate authentication and authorization
* **Health Checks**: Automatic validation of configurations before storage

## Event-Driven Architecture

The Configuration Manager publishes events when critical configurations change:

* **LLM Configured Event**: When AI models are configured or updated
* **Connector Public URL Changed Event**: When connector URLs are updated
* **Gmail Updates Enabled/Disabled Event**: When Gmail real-time updates are toggled

These events allow other services to react to configuration changes without polling.

## Health Checks

The service includes built-in health checks for various configurations that are automatically performed before saving:

* **Kafka Health Check**: Verifies Kafka broker connectivity and validates broker URLs
* **Redis Health Check**: Tests Redis connection with timeout and retry logic
* **Qdrant Health Check**: Ensures Qdrant vector database is accessible via HTTP
* **MongoDB Health Check**: Validates MongoDB connection using ping command
* **ArangoDB Health Check**: Confirms ArangoDB connection and authentication
* **AI Models Health Check**: Validates AI model configurations with provider APIs

## Schema Definitions

<Tabs>
  <Tab title="Authentication Config Schema">
    ```typescript theme={null}
    // Azure AD Config
    interface AzureAdConfig {
      clientId: string;
      tenantId: string; // defaults to "common"
      authority: string;
    }

    // SSO Config
    interface SsoConfig {
      entryPoint: string;
      certificate: string; // Certificate content (BEGIN/END markers removed)
      emailKey: string;
    }

    // Google Auth Config
    interface GoogleAuthConfig {
      clientId: string;
    }

    // Microsoft Auth Config
    interface MicrosoftAuthConfig {
      clientId: string;
      tenantId: string; // defaults to "common"
      authority: string;
    }

    // OAuth Config
    interface OAuthConfig {
      providerName: string;
      clientId: string;
      clientSecret?: string;
      authorizationUrl?: string;
      tokenEndpoint?: string;
      userInfoEndpoint?: string;
      scope?: string;
      redirectUri?: string;
    }
    ```
  </Tab>

  <Tab title="Storage Config Schema">
    ```typescript theme={null}
    // S3 Storage Config
    interface S3Config {
      storageType: "s3";
      s3AccessKeyId: string;
      s3SecretAccessKey: string;
      s3Region: string;
      s3BucketName: string;
    }

    // Azure Blob Storage Config (Connection String)
    interface AzureBlobConfigConnectionString {
      storageType: "azureBlob";
      azureBlobConnectionString: string;
      containerName: string;
    }

    // Azure Blob Storage Config (Individual Parameters)
    interface AzureBlobConfigParameters {
      storageType: "azureBlob";
      accountName: string;
      accountKey: string;
      containerName: string;
      endpointProtocol?: "http" | "https"; // defaults to "https"
      endpointSuffix?: string; // defaults to "core.windows.net"
    }

    // Local Storage Config
    interface LocalConfig {
      storageType: "local";
      mountName?: string;
      baseUrl?: string;
    }
    ```
  </Tab>

  <Tab title="Database Config Schema">
    ```typescript theme={null}
    // MongoDB Config
    interface MongoDBConfig {
      uri: string; // MongoDB connection URI
      db: string; // Database name (automatically set to "pipesHub")
    }

    // ArangoDB Config
    interface ArangoDBConfig {
      url: string;
      username?: string;
      password?: string;
      db: string; // Database name (automatically set to "pipesHub")
    }

    // Qdrant Config
    interface QdrantConfig {
      host: string;
      port: number;
      grpcPort?: number;
      apiKey?: string; // Not required for localhost
    }

    // Redis Config
    interface RedisConfig {
      host: string;
      port: number;
      password?: string;
      tls?: boolean;
    }
    ```
  </Tab>

  <Tab title="AI Models Config Schema">
    ```typescript theme={null}
    // AI Model Configuration
    interface ModelConfiguration {
      model?: string; // Can be comma-separated for multiple models
      apiKey?: string;
      endpoint?: string;
      organizationId?: string;
      deploymentName?: string;
      provider?: string;
      awsAccessKeyId?: string;
      awsAccessSecretKey?: string;
      region?: string;
      model_kwargs?: Record<string, any>;
      encode_kwargs?: Record<string, any>;
      cache_folder?: string;
    }

    // AI Model Provider
    interface ModelProvider {
      provider: string; // Provider name (openAI, anthropic, cohere, etc.)
      configuration: ModelConfiguration;
      modelKey: string; // Auto-generated UUID
      isMultimodal: boolean;
      isDefault: boolean;
    }

    // Complete AI Models Config
    interface AIModelsConfig {
      ocr?: ModelProvider[];
      embedding?: ModelProvider[];
      slm?: ModelProvider[];
      llm?: ModelProvider[];
      reasoning?: ModelProvider[];
      multiModal?: ModelProvider[];
    }

    // Available Model Types
    type ModelType = "llm" | "embedding" | "ocr" | "slm" | "reasoning" | "multiModal";

    // Supported Providers
    type EmbeddingProvider = "anthropic" | "bedrock" | "azureOpenAI" | "cohere" | "default" | 
      "fireworks" | "gemini" | "huggingFace" | "jinaAI" | "mistral" | "ollama" | "openAI" | 
      "openAICompatible" | "sentenceTransformers" | "together" | "vertexAI" | "voyage";

    type LLMProvider = "anthropic" | "bedrock" | "azureOpenAI" | "cohere" | "fireworks" | 
      "gemini" | "groq" | "mistral" | "ollama" | "openAI" | "openAICompatible" | "together" | 
      "vertexAI" | "xai";
    ```
  </Tab>

  <Tab title="Connector Config Schema">
    ```typescript theme={null}
    // Google Workspace Individual Credentials
    interface GoogleWorkspaceIndividualCredentials {
      access_token: string;
      refresh_token: string;
      access_token_expiry_time: number;
      refresh_token_expiry_time?: number;
      enableRealTimeUpdates: boolean;
      topicName: string;
    }

    // Google Workspace Business Credentials
    interface GoogleWorkspaceBusinessCredentials {
      type: string;
      project_id: string;
      private_key_id: string;
      private_key: string;
      client_email: string;
      client_id: string;
      auth_uri: string;
      token_uri: string;
      auth_provider_x509_cert_url: string;
      client_x509_cert_url: string;
      universe_domain: string;
      adminEmail: string;
      enableRealTimeUpdates: boolean;
      topicName: string;
    }

    // Google Workspace OAuth Config
    interface GoogleWorkspaceOAuthConfig {
      clientId: string;
      clientSecret: string;
      enableRealTimeUpdates: boolean;
      topicName: string;
    }

    // Atlassian Config
    interface AtlassianConfig {
      clientId: string;
      clientSecret: string;
    }

    // OneDrive Config
    interface OneDriveConfig {
      clientId: string;
      clientSecret: string;
      tenantId: string;
      hasAdminConsent?: boolean;
    }

    // SharePoint Config
    interface SharePointConfig {
      clientId: string;
      clientSecret: string;
      tenantId: string;
      sharepointDomain: string;
      hasAdminConsent?: boolean;
    }
    ```
  </Tab>

  <Tab title="Other Config Schemas">
    ```typescript theme={null}
    // Message Broker Config
    interface KafkaConfig {
      brokers: string[]; // Array of broker URLs
      sasl?: {
        mechanism: string;
        username: string;
        password: string;
      };
    }

    // SMTP Config
    interface SMTPConfig {
      host: string;
      port: number;
      username?: string;
      password?: string;
      fromEmail: string;
    }

    // Metrics Collection Config
    interface MetricsConfig {
      enableMetricCollection: string; // "true" or "false"
      pushIntervalMs?: string; // Interval in milliseconds as string
      serverUrl?: string; // Remote metrics server URL
    }
    ```
  </Tab>
</Tabs>
