{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipeshub/json-schema/pipeshub-connector-config-schema.json",
  "title": "ConnectorConfig",
  "description": "Configuration for a connector instance including auth, sync, and filter settings",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipeshub-connector-configuration-api-openapi.yml#/components/schemas/ConnectorConfig",
  "type": "object",
  "properties": {
    "connectorId": {
      "type": "string",
      "description": "Connector instance ID"
    },
    "connectorType": {
      "type": "string",
      "description": "Connector type"
    },
    "instanceName": {
      "type": "string",
      "description": "Instance name"
    },
    "authType": {
      "$ref": "#/$defs/ConnectorAuthType"
    },
    "scope": {
      "$ref": "#/$defs/ConnectorScope"
    },
    "config": {
      "type": "object",
      "description": "Configuration sections",
      "properties": {
        "auth": {
          "type": "object",
          "description": "Authentication configuration (sensitive data redacted)"
        },
        "sync": {
          "type": "object",
          "description": "Sync configuration (schedule, options)"
        },
        "filters": {
          "type": "object",
          "description": "Filter selections for data scope"
        }
      }
    },
    "baseUrl": {
      "type": "string",
      "description": "Base URL for self-hosted instances"
    },
    "isActive": {
      "type": "boolean"
    },
    "isConfigured": {
      "type": "boolean"
    },
    "isAuthenticated": {
      "type": "boolean"
    }
  },
  "$defs": {
    "ConnectorAuthType": {
      "type": "string",
      "description": "Authentication method required by the connector:<br>\n<ul>\n<li><code>OAUTH</code> - User OAuth consent flow</li>\n<li><code>OAUTH_ADMIN_CONSENT</code> - Admin OAuth with org-wide consent</li>\n<li><code>API_TOKEN</code> - API key or token authentication</li>\n<li><code>USERNAME_PASSWORD</code> - Username/password credentials</li>\n<li><code>NONE</code> - No authentication required</li>\n</ul>\n",
      "enum": [
        "OAUTH",
        "OAUTH_ADMIN_CONSENT",
        "API_TOKEN",
        "USERNAME_PASSWORD",
        "NONE"
      ]
    },
    "ConnectorScope": {
      "type": "string",
      "description": "Scope determines visibility and access control for connectors:<br>\n<ul>\n<li><code>team</code> - Available to all users in the organization (admin-only creation)</li>\n<li><code>personal</code> - Private to the creating user only</li>\n</ul>\n",
      "enum": [
        "team",
        "personal"
      ]
    }
  }
}