---
title: "Get a data source by ID"
method: GET
path: "/datasource/{id}"
tags: ["DataSource"]
---

# Get a data source by ID

`GET /datasource/{id}`

Retrieve a data source configuration by ID

## Path parameters

- `id` string, required

## Response `200`

OK

- GithubComTencentWeKnoraInternalTypesDataSource
  - `config` integer[] — Encrypted configuration (API credentials, tokens, etc.) Stored as JSON with AES-256-GCM encryption
  - `conflict_strategy` string — Conflict resolution strategy: overwrite or skip
  - `created_at` string — Creation timestamp
  - `deleted_at` GormDeletedAt
    - `time` string
    - `valid` boolean — Valid is true if Time is not NULL
  - `error_message` string — Error message if status is "error"
  - `id` string — Unique identifier
  - `knowledge_base_id` string — Target knowledge base ID
  - `last_sync_at` string — Last successful sync timestamp
  - `last_sync_cursor` integer[] — Cursor or state for incremental sync (connector-specific)
  - `last_sync_result` integer[] — Summary of last sync result
  - `latest_sync_log` GithubComTencentWeKnoraInternalTypesSyncLog
    - `created_at` string — Creation timestamp (usually same as StartedAt)
    - `data_source_id` string — Reference to the data source
    - `error_message` string — Error details if status is "failed"
    - `finished_at` string — Sync completion time
    - `id` string — Unique identifier
    - `items_created` integer — New items created in knowledge base
    - `items_deleted` integer — Items deleted from knowledge base
    - `items_failed` integer — Items that failed to sync
    - `items_skipped` integer — Items skipped (no changes detected)
    - `items_total` integer — Total items fetched from source
    - `items_updated` integer — Existing items updated
    - `result` integer[] — Detailed sync result (JSON-encoded)
    - `started_at` string — Sync start time
    - `status` string — Sync status: running, success, partial, failed, canceled
    - `tenant_id` integer — Workspace ID
    - `updated_at` string — Last update timestamp
  - `name` string — User-friendly name
  - `status` string — Current status: active, paused, error
  - `sync_deletions` boolean — Whether to sync deletions from source
  - `sync_log_retention_days` integer — Number of days to keep sync logs (default: 30)
  - `sync_mode` string — Sync mode: "incremental" (recommended) or "full"
  - `sync_schedule` string — Cron expression for scheduled syncs (e.g., "0 */6 * * *" = every 6 hours)
  - `tenant_id` integer — Workspace ID for multi-workspace isolation
  - `total_items_synced` integer — Total items synced (not stored in DB, calculated on query)
  - `type` string — Connector type (feishu, notion, confluence, etc.)
  - `updated_at` string — Last update timestamp

## Other responses

- `404` — Not Found

---

[API](https://skmtc.net/tencentblueking/apis/weknora-api.md) · [All operations](https://skmtc.net/tencentblueking/apis/weknora-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tencentblueking/weknora-api/versions/d6921ae22ce0/schema)
