Qeasy Cloud
Get Started
POSThttps://open.feishu.cn/open-apis/approval/v4/instances/searchtenant_access_token(Bearer)

Search Approval Instances (approval/v4/instances/search)

按审批定义与时间窗口分页搜索飞书审批实例,返回实例编号、状态与表单数据,用于报销/付款/采购审批单据同步进 ERP 财务。

## Overview This endpoint searches approval instances page by page — the entry point of Feishu approval integration. A typical flow syncs approved expense, payment and purchase applications into the ERP/finance system as vouchers or documents, closing the loop from OA approval to accounting. ### Request essentials 1. POST with Content-Type: application/json and Authorization: Bearer {tenant_access_token}. 2. Body: approval_code (one or more definition codes), instance_code for pinpoint lookup, start_time/end_time (ms epoch bounding creation time), page_size (up to 100) and page_token. 3. The response carries instance codes (or summaries, version dependent) plus page_token/has_more; fetch each instance's form via /open-apis/approval/v4/instances/{instance_id} — the form field is a JSON string that needs a second parse. 4. Slice windows by day; advance incremental sync on start_time with a few minutes of overlap. ### Field mapping - Each form widget exposes id, name, type, value; amount widgets are numeric strings and date widgets are ms epochs — normalize types before mapping to ERP fields. - Only APPROVED instances belong in finance; REJECTED/CANCELED statuses should sync as well to drive reversals. ### Idempotency Qeasy uses instance_code as the idempotency key, so re-pulling an instance never creates duplicate vouchers. ### Detail fetch strategy Search returns codes or summaries, not full forms — budget one instances/{id} call per instance and cache terminal (APPROVED/REJECTED/CANCELED) instances immutably. Watch the per-app frequency control on approval APIs during bulk backfills, and validate filters with a small page_size first before widening the window.

Code examples

curl
curl -X POST "https://open.feishu.cn/open-apis/approval/v4/instances/search" \
  -H "Authorization: Bearer t-xxxx" \
  -H "Content-Type: application/json" \
  -d '{"approval_code":["C7XXXX"],"start_time":1780000000000,"end_time":1780086400000,"page_size":100}'

Error codes

CodeMessageMeaning
99991663token invalidtenant_access_token 过期,刷新后重试
99991401forbidden应用缺少审批相关 scope,开通并发版后重试
99991400bad request查询参数不合法,检查时间戳单位与 page_size