The sync jobs API manages the full lifecycle of Feishu data sync tasks. Each job pulls records from Feishu Bitable and writes them to JSON output files underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/HNU-himematsu/HNU-TimeLetter/llms.txt
Use this file to discover all available pages before exploring further.
src/data/. The frontend reads those files through the public runtime API (/api/content, /api/contributors, /api/creation-board) at request time — no build or server restart is needed after a sync completes.
All sync jobs execute asynchronously. A
202 Accepted response means the job has been queued successfully — it does not mean the sync has finished. Poll GET /api/admin/sync/jobs/:jobId or stream GET /api/admin/sync/jobs/:jobId/logs to track progress.Enum reference
SyncJobKind
| Value | Description |
|---|---|
sync-data | Pull records from Feishu Bitable and write JSON output files to src/data/. |
SyncJobStatus
| Value | Description |
|---|---|
queued | Job has been created and is waiting to run. |
running | Job is actively executing. |
success | All tables synced successfully. |
partial_success | Some tables failed, but output files were still written. |
failed | Job failed; output files were not updated. |
canceled | Job was canceled before completion. |
SyncStepStatus
| Value | Description |
|---|---|
pending | Step is waiting to be executed. |
running | Step is currently executing. |
success | Step completed without issues. |
success_with_warnings | Step completed but some records had non-fatal issues. |
skipped | Step was skipped due to missing dependencies or an earlier termination. |
failed | Step failed. |
DependencyMode
| Value | Description |
|---|---|
read_local | (Default) Sync only the selected tables; read dependency data from local output files. |
run_dependencies | Automatically run dependency tables before the selected tables. |
strict | Fail immediately if a dependency is missing — no local read, no automatic run. |
GET /api/admin/sync/jobs
Returns a paginated list of sync job records, sorted bycreatedAt descending (most recent first).
Authentication: admin_auth cookie required.
Query parameters
Maximum number of records to return. Accepted range:
1 – 100.Response fields
Array of sync job records sorted newest-first.
curl example
POST /api/admin/sync/jobs
Creates a new sync job and immediately queues it for background execution. The response is returned as soon as the job is queued — before any Feishu API calls are made. Authentication:admin_auth cookie required.
Request body
Job type. Defaults to the value from the scheduler configuration. Currently the only accepted value is
"sync-data".Which tables to sync in this job. Defaults to
config.defaultTables when omitted. Cannot be an empty array.Controls how tables that other selected tables depend on are handled. See the DependencyMode enum above.
When
true, attachment files are downloaded and their OSS URLs are back-filled into the output JSON.When
true, a failure in one table step does not abort the remaining steps.A free-form label identifying the caller. Stored in the job record for auditing.
Optional human-readable note stored with the job record (e.g.
"手动刷新首页内容").Responses
202 Accepted — Job was queued successfully.
409 Conflict — Another sync job is already running. Wait for it to finish before creating a new one.
400 Bad Request — One or more table keys are not valid SyncTableKey values.
curl example
GET /api/admin/sync/jobs/:jobId
Returns the fullSyncJobRecord for a single job, including the expanded steps array with per-table results.
Authentication: admin_auth cookie required.
Path parameters
The job identifier returned when the job was created. Format:
sync_{YYYYMMDDHHmmss}_{random6} (e.g. sync_20260430100000_ab12cd).Response fields
The top-level object matches theSyncJobRecord shape described under GET /api/admin/sync/jobs. The steps array is always fully expanded here.
One entry per table included in the job.
Example response
404 Not Found — No job exists with the given ID.
curl example
GET /api/admin/sync/jobs/:jobId/logs
Returns the tail of the raw execution log for a job. Up to the last 200 lines are returned. For a job that is stillrunning, polling this endpoint lets you observe progress in real time.
Authentication: admin_auth cookie required.
Path parameters
The job identifier. Format:
sync_{YYYYMMDDHHmmss}_{random6}.Response fields
The last up-to-200 log lines for the job. Each line includes a timestamp and step prefix, e.g.
"[2026-04-30T10:00:01.000Z] [locations] 获取飞书 token 成功". Empty array when no log file exists yet.Total number of lines in the full log file. Useful for detecting whether lines were truncated.
0 when no log file exists.Example responses
With log data:404 Not Found — No job exists with the given ID.