{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/scale-ai/json-schema/scale-ai-data-source-entity-schema.json",
  "title": "DataSourceEntity",
  "x-generated": "2026-10-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/scale-ai-document-understanding-openapi.yml#/components/schemas/DataSourceEntity",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id",
      "description": "ID of the entity"
    },
    "project_id": {
      "type": "string",
      "title": "Project Id",
      "description": "ID of the project"
    },
    "object": {
      "type": "string",
      "const": "data_source",
      "title": "Object",
      "default": "data_source"
    },
    "name": {
      "type": "string",
      "title": "Name"
    },
    "provider_type": {
      "type": "string",
      "title": "Provider Type",
      "description": "Provider discriminator (e.g. sharepoint); aligned with Data Sources values"
    },
    "data_sources_data_source_id": {
      "type": "string",
      "title": "Data Sources Data Source Id",
      "description": "Remote data source id in the Data Sources service"
    },
    "data_sources_subscription_id": {
      "type": "string",
      "title": "Data Sources Subscription Id",
      "description": "Active subscription id in the Data Sources service"
    },
    "workflow_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Workflow Id",
      "description": "Workflow triggered by this linked data source."
    },
    "workflow_status": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Workflow Status",
      "description": "Status of the workflow triggered by this linked data source."
    },
    "status": {
      "$ref": "#/$defs/DataSourceStatus"
    },
    "config_metadata": {
      "additionalProperties": true,
      "type": "object",
      "title": "Config Metadata"
    },
    "last_delta_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Delta Cursor"
    },
    "last_event_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Last Event At"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    },
    "deleted_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Deleted At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "project_id",
    "name",
    "provider_type",
    "data_sources_data_source_id",
    "data_sources_subscription_id",
    "status",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "DataSourceStatus": {
      "type": "string",
      "enum": [
        "active",
        "paused",
        "disabled",
        "deleted"
      ],
      "title": "DataSourceStatus"
    }
  }
}