Skip to main content

Documentation 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.

The sync webhook endpoint lets Feishu Automation (飞书自动化) trigger a data sync whenever new records are added or updated in a Feishu Bitable. Unlike the admin job API, this endpoint does not require a session cookie — it authenticates via a shared Bearer token instead, making it suitable for automated, server-to-server calls from within the Feishu platform. The sync job runs asynchronously in the background; the endpoint returns immediately after queuing the job.
Set the SYNC_WEBHOOK_SECRET environment variable separately from ADMIN_PASSWORD. Using a dedicated webhook secret means a leaked URL or server log entry cannot compromise your admin dashboard.

POST /api/admin/sync/webhook

Queues a Feishu data sync job and returns immediately. The job runs in the background; use GET /api/admin/sync/jobs/:jobId to monitor progress. Authentication: Bearer token — does not use the admin_auth cookie. See Authentication below. Rate limit: 60 requests per hour per IP address. Exceeding this limit returns 429 Too Many Requests.

Authentication

Two authentication methods are supported. Use whichever is compatible with your Feishu Automation environment.
MethodExampleNotes
Authorization headerAuthorization: Bearer <SYNC_WEBHOOK_SECRET>Recommended — keeps the secret out of URLs and server logs.
secret query parameter?secret=<SYNC_WEBHOOK_SECRET>Use only when custom request headers are not supported.
The secret value is read from the SYNC_WEBHOOK_SECRET environment variable. If that variable is not set, the server falls back to ADMIN_PASSWORD.
Prefer the Authorization: Bearer header over the ?secret= query parameter. Query parameter values appear in server access logs, proxy logs, and browser history, which risks exposing your secret. Reserve the query-param method only for Feishu Automation configurations that do not support custom HTTP headers.

Query parameters

tables
string
default:"creation_board"
A comma-separated list of SyncTableKey values specifying which tables to sync. Defaults to creation_board when omitted.Valid values: locations, stories, creation_headers, creation_board, contributorsExample: ?tables=creation_board,creation_headers
secret
string
Alternative authentication method. Provide the value of SYNC_WEBHOOK_SECRET here if your environment does not support custom request headers. See the Authentication section above.

Request body

The request body is ignored. You may send an empty body, or allow Feishu Automation to send its default payload — the server does not read it.

Responses

202 Accepted — Sync job was queued successfully. The job is now running in the background.
{
  "jobId": "sync_20260430100000_ab12cd",
  "status": "queued",
  "message": "同步任务已创建"
}
400 Bad Request — One or more values in the tables parameter are not valid SyncTableKey values.
{ "message": "不支持的同步表: unknown_table" }
401 Unauthorized — The Bearer token is missing or does not match SYNC_WEBHOOK_SECRET.
{ "message": "Unauthorized" }
409 Conflict — Another sync job is already running. Wait for it to finish before triggering a new one.
{
  "message": "已有同步任务运行中,请等待完成后重试",
  "currentJobId": "sync_20260430095900_xy99zz"
}
429 Too Many Requests — This IP has exceeded 60 requests in the past hour.
{ "message": "请求过于频繁,请稍后重试" }

Feishu Automation setup

In Feishu Automation (飞书自动化), add a “发送 HTTP 请求” (Send HTTP Request) action to your automation rule and fill in the fields as shown below.

Config 1 — Sync creation_board only

Use this when you only need to refresh the creation board after new entries are submitted.
FieldValue
MethodPOST
URLhttps://himematsu.cn/api/admin/sync/webhook
HeadersAuthorization: Bearer <SYNC_WEBHOOK_SECRET>
Body(empty)
curl -X POST https://himematsu.cn/api/admin/sync/webhook \
  -H "Authorization: Bearer <SYNC_WEBHOOK_SECRET>"

Config 2 — Sync creation_board and creation_headers together

Use this when your automation rule affects both the main board table and its header metadata table.
FieldValue
MethodPOST
URLhttps://himematsu.cn/api/admin/sync/webhook?tables=creation_board,creation_headers
HeadersAuthorization: Bearer <SYNC_WEBHOOK_SECRET>
Body(empty)
curl -X POST "https://himematsu.cn/api/admin/sync/webhook?tables=creation_board,creation_headers" \
  -H "Authorization: Bearer <SYNC_WEBHOOK_SECRET>"

Config 3 — Query-param auth (no custom headers)

Use this only if your Feishu Automation environment does not support setting custom HTTP headers.
FieldValue
MethodPOST
URLhttps://himematsu.cn/api/admin/sync/webhook?secret=<SYNC_WEBHOOK_SECRET>&tables=creation_board
Body(empty)
curl -X POST "https://himematsu.cn/api/admin/sync/webhook?secret=<SYNC_WEBHOOK_SECRET>&tables=creation_board"
Storing the secret in the URL (as ?secret=...) means it will appear in Feishu Automation’s execution logs and any HTTP access logs on your server. Rotate SYNC_WEBHOOK_SECRET regularly if you use this method.

Build docs developers (and LLMs) love