{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/pipeshub/json-schema/pipeshub-connector-instance-schema.json",
  "title": "ConnectorInstance",
  "description": "A configured connector instance. Represents an active or configured\nconnection to an external service.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/pipeshub-connector-control-api-openapi.yml#/components/schemas/ConnectorInstance",
  "type": "object",
  "properties": {
    "connectorId": {
      "type": "string",
      "description": "Unique instance identifier"
    },
    "connectorType": {
      "type": "string",
      "description": "Type of connector (from registry)"
    },
    "instanceName": {
      "type": "string",
      "description": "User-defined name for this instance"
    },
    "scope": {
      "$ref": "#/$defs/ConnectorScope"
    },
    "authType": {
      "$ref": "#/$defs/ConnectorAuthType"
    },
    "createdBy": {
      "type": "string",
      "description": "User ID who created this instance"
    },
    "orgId": {
      "type": "string",
      "description": "Organization ID"
    },
    "isActive": {
      "type": "boolean",
      "description": "Whether connector is enabled for syncing/agent"
    },
    "desktopOnline": {
      "type": "boolean",
      "description": "Whether the owner device (`ownerDeviceId`) is currently connected.\nLocal FS only; omitted otherwise, and while the connector has no owner.\n"
    },
    "ownerDeviceId": {
      "type": "string",
      "description": "Local FS only. The desktop device that owns this connector, set when\nsync is first enabled from the desktop app.\n"
    },
    "ownerDeviceName": {
      "type": "string",
      "description": "Local FS only. Display name of the desktop device that owns this\nconnector, set when sync is first enabled from the desktop app.\n"
    },
    "isConfigured": {
      "type": "boolean",
      "description": "Whether all required configuration is complete"
    },
    "isAuthenticated": {
      "type": "boolean",
      "description": "Whether authentication is complete and valid"
    },
    "pendingFullSync": {
      "type": "boolean",
      "description": "Whether a full sync is pending due to filter changes or other configuration updates"
    },
    "syncEnabled": {
      "type": "boolean",
      "description": "Whether sync is enabled"
    },
    "agentEnabled": {
      "type": "boolean",
      "description": "Whether agent integration is enabled"
    },
    "lastSyncAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of last successful sync"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$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"
      ]
    }
  }
}