COMMERCIAL

开发者接口

API 文档

事件列表、详情、筛选、国家风险和疾病事件接口都在这里,兼容层仍然保留给旧客户端。

AUTH

鉴权与调用习惯

v1 读 API 默认保持公开;带 API Key 时会记录调用量,开启强制开关后必须提供 Key。

支持 `X-API-Key` 和 `Authorization: Bearer` 两种携带方式。公开读端默认 scope 为 `events:read`,导出创建/取消使用 `exports:write`,导出查询/下载使用 `exports:read`,自助注册和密码重置不要求 API Key;客户后台登录态上下文、只读用量、只读账单摘要、只读成员清单、只读导出任务清单、只读组织审计日志清单、组织通知清单、通知保存视图和单条/批量通知已读/归档/隐藏/重试使用 Django session 且永不返回 raw API Key;登录态 API Key 签发和轮换仅在创建/轮换响应中一次性返回 raw key,登录态 API Key 轮换、权限更新和停用允许 owner/admin 管理同组织其他成员 Key,billing 仍只能管理本人 Key,后续只返回前缀和权限元数据;组织用量、账单摘要、账单通知偏好、通知收件箱、账单请求队列、账单请求活动时间线、成员列表、审计日志、审计导出、审计保存视图列表/详情和审计告警规则列表/详情/命中预览/指标/投递历史/投递详情使用 `organization:read`,成员邀请、通知已读/归档/隐藏/重试/批量处理、账单通知偏好更新、手工账单请求、账单请求补件、账单请求内部备注、审计 legal hold、审计保存视图创建/更新/删除和审计告警规则创建/更新/删除/测试发送/投递重试使用 `organization:write`;邀请接受使用邮件中的一次性令牌;API Key 和组织月额度超额都会返回 429。

ENDPOINTS

接口清单

兼容层保留,v1 接口为当前推荐入口。
接口方法认证说明返回重点
/api/v1/events/GET可选事件列表,支持分页和疾病、国家、地点、日期、风险等级等筛选。items、total、page、page_size
/api/v1/events/{event_id}/GET可选按数字 ID 或 event_uid 获取单条事件和来源证据链。event、sources、versions
/api/v1/filter-options/GET可选返回疾病、国家、风险等级、状态和来源候选项。filters
/api/v1/countries/{country_code}/risk/GET可选国家风险摘要与相关事件。country、risk_events
/api/v1/diseases/{disease_slug}/events/GET可选疾病维度事件列表。disease、events
/api/v1/auth/register/POST无需 Key自助创建本地用户、trial 组织和 owner 成员关系;组织 slug 自动去重,创建动作写入 `organization_create` 审计日志;当前不是支付开通或外部身份提供商。user、organization、membership
/api/v1/auth/password-reset/request/POST无需 Key按邮箱请求密码重置邮件;有效邮箱会收到 uid/token,响应保持 generic accepted,避免暴露账号是否存在。status
/api/v1/auth/password-reset/confirm/POSTuid/token使用密码重置邮件中的 uid/token 设置新密码;token 无效或过期时拒绝。status、user
/api/v1/customer-portal/context/GETDjango session已登录客户后台用户查看自己的 active 组织、可切换组织和本人已有 API Key 前缀/权限;不返回 raw API Key,不替代完整登录态 SaaS 控制台。user、organizations、active_organization、api_keys
/api/v1/customer-portal/usage/GETDjango session已登录 owner/admin/billing 成员可无 raw API Key 查看当前组织当月 API 用量、导出额度和资源摘要;该只读入口不写 ApiUsageLog,不替代 API Key 配额计量。organization、api_usage、exports、resources
/api/v1/customer-portal/billing/summary/GETDjango session已登录 owner/admin/billing 成员可无 raw API Key 查看当前组织套餐、账单邮箱、手工合同状态、provider_adapters 支付/发票配置状态、月度用量、额度和最近账单请求工单;写操作仍需组织 API Key。organization、billing、quotas、month_to_date
/api/v1/customer-portal/members/GETDjango session已登录 owner/admin/billing 成员可无 raw API Key 查看当前组织成员和邀请只读清单,支持 status、page 和 page_size;该登录态读取不写 ApiUsageLog,不替代成员邀请、角色调整、停用或删除 API。items、total、page、page_size
/api/v1/customer-portal/data-exports/GETDjango session已登录 owner/admin/billing 成员可无 raw API Key 查看当前组织导出任务只读清单,支持 status、page 和 page_size;该登录态读取不写 ApiUsageLog,不替代导出创建、取消、下载或签名链接 API。items、total、page、page_size
/api/v1/customer-portal/audit-logs/GETDjango session已登录 owner/admin/billing 成员可无 raw API Key 查看当前组织审计日志只读清单,支持 q、action、target_type、target_uid、actor、created_from、created_to、page 和 page_size;该登录态读取不写 ApiUsageLog,不替代审计 CSV 导出、legal hold、保存视图或审计告警规则操作。items、total、page、page_size、retention
/api/v1/customer-portal/notifications/GETDjango session已登录 owner/admin/billing 成员可无 raw API Key 查看当前组织通知收件箱清单,支持 q、status、alert_type、channel、read_state、archive_state、visibility_state、error_state、retry_state、page 和 page_size;该登录态读取不写 ApiUsageLog,不替代退订、退信处理、值班分派或完整通知中心。items、total、page、page_size、summary
/api/v1/customer-portal/notifications/{delivery_uid}/read/POSTDjango session已登录 owner/admin/billing 成员可无 raw API Key 把当前组织单条通知标记已读;回执只写入既有 AlertDelivery.payload.organization_inbox,不写 ApiUsageLog,不是用户订阅、退订、删除或完整通知中心。notification、already_read
/api/v1/customer-portal/notifications/{delivery_uid}/archive/POSTDjango session已登录 owner/admin/billing 成员可无 raw API Key 归档或恢复当前组织单条通知;回执只写入既有 AlertDelivery.payload.organization_inbox,不写 ApiUsageLog,不是删除、退订、退信处理或外部通知 provider。notification、archived、changed
/api/v1/customer-portal/notifications/{delivery_uid}/hide/POSTDjango session已登录 owner/admin/billing 成员可无 raw API Key 隐藏或恢复显示当前组织单条通知;隐藏只影响组织收件箱默认列表,不物理删除 AlertDelivery 投递历史,也不写 ApiUsageLog。notification、hidden、changed
/api/v1/customer-portal/notifications/{delivery_uid}/retry/POSTDjango session已登录 owner/admin/billing 成员可无 raw API Key 立即重试当前组织 pending 或 failed 单条通知;复用既有 AlertDelivery 重试与邮件发送路径,不写 ApiUsageLog,不代表外部通知 provider 已接入。sent、notification
/api/v1/customer-portal/notifications/bulk/POSTDjango session已登录 owner/admin/billing 成员可无 raw API Key 对当前组织通知批量处理;action 支持 `mark_read`、`archive`、`restore`、`hide`、`unhide` 和 `retry`,最多 100 条;复用既有组织收件箱状态和 AlertDelivery 重试路径,不写 ApiUsageLog。changed_count、sent_count、failed_count、skipped_count、notifications、summary
/api/v1/customer-portal/notifications/saved-views/GET / POSTDjango session已登录 owner/admin/billing 成员可无 raw API Key 列出或保存当前组织通知筛选视图;保存 q、status、alert_type、channel、read_state、archive_state、visibility_state、error_state、retry_state、默认视图和共享标记;不写 ApiUsageLog,且通知保存视图不能用于事件数据导出。items / saved_view
/api/v1/customer-portal/notifications/saved-views/{view_uid}/GET / PATCH / DELETEDjango session已登录 owner/admin/billing 成员可无 raw API Key 查看、更新或软删除当前组织通知保存视图;PATCH 可调整筛选、启用状态、默认视图和共享标记;DELETE 仅标记 SavedFilter deleted,不物理删除通知投递历史。saved_view / deleted
/api/v1/customer-portal/api-keys/GET / POSTDjango sessionGET 让已登录 owner/admin/billing 成员查看当前组织全部 API Key 前缀、owner、状态、scope 和额度元数据;POST 为当前组织签发客户后台 API Key;raw_api_key 只在创建响应中一次性返回,后续清单和 context 只显示前缀。items / api_key、raw_api_key
/api/v1/customer-portal/api-keys/{key_uid}/scopes/PATCHDjango session已登录 owner/admin/billing 成员可更新自己在当前组织下的 active 客户后台 API Key scope,owner/admin 还可更新同组织其他成员 Key;billing 对其他成员 Key 返回 403;只能从客户后台允许 scope 白名单中选择,不回显 raw key,并写入 `organization_api_key_scope_update` 审计。api_key、changed、allowed_scopes
/api/v1/customer-portal/api-keys/{key_uid}/rotate/POSTDjango session已登录 owner/admin/billing 成员可轮换自己在当前组织下的 active 客户后台 API Key,owner/admin 还可轮换同组织其他成员 Key;billing 对其他成员 Key 返回 403;新 raw key 只在轮换响应中一次性返回,旧 raw key 立即失效,并写入 `organization_api_key_rotate` 审计。api_key、raw_api_key
/api/v1/customer-portal/api-keys/{key_uid}/disable/POSTDjango session已登录 owner/admin/billing 成员可停用自己在当前组织下的客户后台 API Key,owner/admin 还可停用同组织其他成员 Key;billing 对其他成员 Key 返回 403,raw key 不会回显,停用后 API 鉴权拒绝该 Key,并写入 `organization_api_key_disable` 审计。api_key、changed
/api/v1/organization/usage/GET必需组织管理员、所有者或账单角色查看当月 API 用量、导出额度和资源摘要。organization、api_usage、exports、resources
/api/v1/organization/billing/summary/GET必需组织所有者、管理员或账单角色查看套餐、账单邮箱、手工合同状态、provider_adapters 支付/发票配置状态、月度用量、额度和最近账单请求工单。organization、billing、quotas、month_to_date
/api/v1/organization/billing/notification-preferences/GET / PATCH必需GET 使用 `organization:read` 返回组织账单请求客户通知和负责人提醒偏好;PATCH 要求 `organization:write`,可保存 `customer_notifications_enabled`、`assignee_notifications_enabled` 和抑制原因,并以 `organization_billing_notification_preferences_update` 写入专用组织审计日志;状态变更、负责人提醒和 SLA 违约扫描都会读取这些偏好。notification_preferences
/api/v1/organization/notifications/GET必需组织所有者、管理员或账单角色查看同组织 AlertDelivery 通知收件箱,支持 q、status、alert_type、channel、read_state、archive_state、visibility_state、error_state、retry_state、page 和 page_size;默认只显示 visible,visibility_state=hidden/all 可查看隐藏项,error_state=with_error/without_error 可按最近错误字段排查投递,retry_state=retryable/waiting_retry/exhausted/not_failed 可按既有重试字段排查失败队列;q 可匹配主题、正文预览、收件人、错误、规则名、audit/billing/event UID 和 payload 关键字段;summary 返回状态分布、unread_count、read_count、archived_count、active_count、hidden_count、visible_count、with_error_count、without_error_count、by_retry_state、retryable_count、waiting_retry_count、exhausted_retry_count 和 not_failed_retry_count;当前复用既有投递台账,不物理删除投递历史,也不是退订、退信或外部通知 provider。items、summary、filters
/api/v1/organization/notifications/summary/GET必需组织所有者、管理员或账单角色按同一组 q、status、alert_type、channel、read_state、archive_state、visibility_state、error_state 和 retry_state 只读获取通知汇总;响应不返回 items,便于客户后台独立刷新计数。summary、total、filters
/api/v1/organization/notifications/bulk/POST必需组织所有者、管理员或账单角色对同组织通知做当前页或指定 UID 批量处理,要求 `organization:write`;action 支持 `mark_read`、`archive`、`restore`、`hide`、`unhide` 和 `retry`,最多 100 条;重试只会立即发送 pending/failed 投递,sent/skipped 会被计入 skipped_count,其余动作仍只写入 `AlertDelivery.payload.organization_inbox`。changed_count、sent_count、failed_count、skipped_count、notifications、summary
/api/v1/organization/notifications/saved-views/GET / POST必需组织所有者、管理员或账单角色列出/保存通知收件箱筛选视图;创建要求 `organization:write`,保存 q、status、alert_type、channel、read_state、archive_state、visibility_state、error_state、retry_state、默认视图和共享标记;默认视图在列表中优先返回,客户后台首次加载且当前筛选为空时会自动套用。items / saved_view
/api/v1/organization/notifications/saved-views/{view_uid}/GET / PATCH / DELETE必需组织所有者、管理员或账单角色查看、更新或删除同组织通知保存视图;更新/删除要求 `organization:write`,可调整筛选、启用状态、默认视图和共享标记;通知保存视图不能用于事件数据导出。saved_view / deleted
/api/v1/organization/notifications/{delivery_uid}/GET必需组织所有者、管理员或账单角色查看同组织单条通知详情,返回完整 body、payload、重试字段和 provider message id;仍只读取既有 AlertDelivery,不物理删除或修改投递历史。notification
/api/v1/organization/notifications/{delivery_uid}/read/POST必需组织所有者、管理员或账单角色把同组织单条通知标记已读,要求 `organization:write`;已读回执仅写入 `AlertDelivery.payload.organization_inbox`,不是用户订阅、退订、删除、归档或完整通知中心。notification、already_read
/api/v1/organization/notifications/{delivery_uid}/archive/POST必需组织所有者、管理员或账单角色归档或恢复同组织单条通知,要求 `organization:write`;归档回执仅写入 `AlertDelivery.payload.organization_inbox`,不是删除、退订、退信处理或完整通知中心。notification、archived、changed
/api/v1/organization/notifications/{delivery_uid}/hide/POST必需组织所有者、管理员或账单角色隐藏或恢复显示同组织单条通知,要求 `organization:write`;隐藏只影响组织收件箱默认列表,不物理删除 AlertDelivery 投递历史。notification、hidden、changed
/api/v1/organization/notifications/{delivery_uid}/retry/POST必需组织所有者、管理员或账单角色立即重试同组织 pending 或 failed 通知,要求 `organization:write`;复用现有邮件发送器,非 email 渠道仍会按当前 provider 未实现状态失败,不代表外部通知 provider 已接入。sent、notification
/api/v1/organization/billing/requests/GET / POST必需GET 使用 `organization:read` 返回同组织账单请求队列,支持 status、assigned_to=me/unassigned、overdue、task_status、task_priority、task_owner=me/unassigned、task_overdue、page 和 page_size,并返回 open/overdue/unassigned/assigned-to-me SLA 摘要;POST 要求 `organization:write` 提交账单请求工单,记录状态、SLA 截止时间和专用组织审计日志;默认仍是手工合同,配置 `EPIC_BILLING_PAYMENT_PROVIDER=hosted_checkout` 和 `EPIC_BILLING_PAYMENT_CHECKOUT_URL_TEMPLATE` 后,套餐调整请求会返回 `provider_handoff.payment.handoff_url`,配置 `EPIC_BILLING_INVOICE_PROVIDER=hosted_invoice` 和 `EPIC_BILLING_INVOICE_REQUEST_URL_TEMPLATE` 后,发票请求会返回 `provider_handoff.invoice.handoff_url`;这只是 hosted provider handoff 和配置契约,不代表付款状态同步、退款、对账或生产 provider smoke 已完成。items / billing_request
/api/v1/organization/billing/requests/{request_uid}/PATCH必需组织所有者、管理员或账单角色更新同组织账单请求状态、状态备注或负责人;assigned_to 支持 me/unassigned,变更以 `organization_billing_request_update` / `operation=billing_request_update` 写入专用组织审计日志;状态或状态备注变更会按通知偏好入队 `billing_request_customer_notification` 客户邮件投递,接手负责人会按通知偏好入队 `billing_request_assignee_notification` 内部邮件提醒。billing_request
/api/v1/organization/billing/requests/{request_uid}/success-task/GET / PATCH必需GET 使用 `organization:read` 查看单条账单请求的客服任务状态;PATCH 要求 `organization:write`,可更新 status、priority、owner=me/unassigned、due_at 和 next_action,结果保存到工单 metadata 并以 `operation=customer_success_task_update` 写入专用组织审计日志。billing_request、customer_success_task
/api/v1/organization/billing/requests/{request_uid}/timeline/GET必需组织所有者、管理员或账单角色查看单条账单请求活动时间线,聚合创建、状态/负责人变更、客户补件、内部备注、附件引用、客服任务和 SLA 违约审计日志;缺少创建审计的历史工单会返回一条只读创建记录兜底。billing_request、items、total
/api/v1/organization/billing/requests/{request_uid}/supplements/POST必需组织所有者、管理员或账单角色给 open 账单请求追加客户补件,要求 `organization:write`;补件保存到工单 metadata,并以 `organization_billing_request_update` / `operation=customer_supplement` 写入专用组织审计日志。billing_request
/api/v1/organization/billing/requests/{request_uid}/notes/POST必需组织所有者、管理员或账单角色给同组织账单请求追加内部备注,要求 `organization:write`;备注保存到工单 metadata,可用于 open 或 closed 工单,并以 `organization_billing_request_update` / `operation=internal_note` 写入专用组织审计日志。billing_request
/api/v1/organization/billing/requests/{request_uid}/attachments/POST必需组织所有者、管理员或账单角色给 open 账单请求追加附件引用,要求 `organization:write`;仅保存 file_name、file_url、label、description、content_type、size_bytes 等引用 metadata,不上传文件、不拉取 URL、不做文件杀毒,并以 `operation=attachment_reference` 写入专用组织审计日志。billing_request
/api/v1/organization/billing/requests/{request_uid}/attachments/upload/POST multipart必需组织所有者、管理员或账单角色给 open 账单请求上传私有附件,要求 `organization:write`;默认写入 `.private/billing_request_attachments`,也可通过 `EPIC_BILLING_ATTACHMENT_STORAGE_BACKEND=s3_compatible` 接入 S3/MinIO 类对象存储;manifest 保存 local 或 `s3_compatible` object_key、SHA256、content_type、size_bytes 和扫描结果,默认 `local_static` 返回 `security_scan.status=passed_basic_validation`,可通过 `EPIC_BILLING_ATTACHMENT_SCAN_PROVIDER=clamav_tcp` 启用 ClamAV TCP 扫描;成功以 `operation=attachment_upload` 写入专用组织审计日志。billing_request
/api/v1/organization/billing/requests/{request_uid}/attachments/{attachment_uid}/signed-url/GET必需组织所有者、管理员或账单角色为已上传附件生成短期签名下载 URL,要求 `organization:read`;local 存储会先校验本地文件存在和 SHA256,`s3_compatible` 存储返回 AWS SigV4 query 预签名 URL。attachment、signed_download
/api/v1/organization/billing/requests/{request_uid}/attachments/{attachment_uid}/signed-download/GET签名令牌local 附件签名 URL 下载入口;令牌过期、object_key 不一致、文件缺失或 SHA256 不匹配时拒绝访问;`s3_compatible` 附件使用 signed-url 响应中的对象存储预签名 URL 下载。附件文件
/api/v1/organization/audit-logs/GET必需组织所有者、管理员或账单角色查看自助组织创建、成员变更、成员删除、owner 转移、API Key 创建/轮换/权限变更/停用、审计保留和账单请求审计日志,支持 q、action、target_type、target_uid、actor、created_from、created_to、page 和 page_size;自助注册 action 为 `organization_create`,target_type 为 `organization`;API Key action 包含 `organization_api_key_create`、`organization_api_key_rotate`、`organization_api_key_scope_update` 和 `organization_api_key_disable`,target_type 为 `api_key`;账单请求 action 包含 `organization_billing_request_create`、`organization_billing_request_update`、`organization_billing_request_sla_breach` 和 `organization_billing_notification_preferences_update`;客户后台提供独立筛选和分页,并返回只读保留策略摘要。items、total、page、page_size、retention
/api/v1/organization/audit-logs/export/GET必需组织所有者、管理员或账单角色按 q、action、target_type、target_uid、actor、created_from、created_to 导出同组织审计 CSV,默认最多 1000 行,可用 limit 调整到 5000 行。CSV 文件
/api/v1/organization/audit-logs/legal-hold/POST必需组织所有者、管理员或账单角色设置或解除组织审计 legal hold,要求 `organization:write`;操作写入专用组织审计表。retention、legal_hold
/api/v1/organization/audit-saved-views/GET / POST必需组织所有者、管理员或账单角色列出/保存审计日志筛选视图;创建要求 `organization:write`,保存 q、action、target_type、target_uid、actor、日期范围、默认视图和共享标记。items / saved_view
/api/v1/organization/audit-saved-views/{view_uid}/GET / PATCH / DELETE必需组织所有者、管理员或账单角色查看、更新或删除同组织审计保存视图;更新/删除要求 `organization:write`,可调整筛选、启用状态、默认视图和共享标记。saved_view / deleted
/api/v1/organization/audit-alert-rules/GET / POST必需组织所有者、管理员或账单角色列出/创建组织审计告警规则;创建要求 `organization:write`,当前仅支持即时邮件。items / alert_rule
/api/v1/organization/audit-alert-rules/{rule_uid}/GET / PATCH / DELETE必需组织所有者、管理员或账单角色查看、更新、停用或软删除组织审计告警规则;更新/删除要求 `organization:write`。alert_rule / deleted
/api/v1/organization/audit-alert-rules/{rule_uid}/test-send/POST必需组织所有者、管理员或账单角色发送一次组织审计告警测试邮件,要求 `organization:write`。sent / delivery
/api/v1/organization/audit-alert-rules/{rule_uid}/deliveries/GET必需组织所有者、管理员或账单角色查看单条组织审计告警规则的投递历史,支持 status、page 和 page_size。items / alert_rule
/api/v1/organization/audit-alert-rules/{rule_uid}/deliveries/{delivery_uid}/GET必需组织所有者、管理员或账单角色查看单条组织审计告警投递详情,包含正文、载荷、计划/重试时间和 provider message id。delivery / alert_rule
/api/v1/organization/audit-alert-rules/{rule_uid}/deliveries/retry/POST必需组织所有者、管理员或账单角色批量重试 failed/pending 的组织审计告警投递,要求 `organization:write`,支持 statuses 和 limit。retry / items
/api/v1/organization/audit-alert-rules/{rule_uid}/deliveries/{delivery_uid}/retry/POST必需组织所有者、管理员或账单角色立即重试 pending 或 failed 的组织审计告警投递,要求 `organization:write`。sent / delivery
/api/v1/organization/audit-alert-rules/{rule_uid}/metrics/GET必需组织所有者、管理员或账单角色查看单条组织审计告警规则的投递状态计数、成功率、最近失败、失败原因聚合、待重试概览和 SLA 摘要。metrics / alert_rule
/api/v1/organization/audit-alert-rules/{rule_uid}/preview/GET必需组织所有者、管理员或账单角色预览单条组织审计告警规则最近可能命中的审计日志,支持 limit 和 scan_limit。items / matched_count
/api/v1/organization/members/GET必需组织所有者、管理员或账单角色查看成员和邀请列表,支持 status、page 和 page_size。items、total、page、page_size
/api/v1/organization/members/{membership_uid}/PATCH / DELETE必需组织所有者或管理员更新非 owner 成员角色、停用成员/取消邀请,或物理删除 invited/disabled 非 owner 成员记录。membership / deleted
/api/v1/organization/members/{membership_uid}/transfer-owner/POST必需当前 active owner 将组织所有权转移给另一个 active 注册成员,原 owner 降为 admin。membership
/api/v1/organization/invitations/POST必需组织所有者或管理员邀请成员加入组织,要求 `organization:write`。membership
/api/v1/organization/invitations/{membership_uid}/accept/POST邀请令牌受邀邮箱使用邮件令牌接受邀请;新用户需提交 email、username 和 password 完成本地注册。membership、user
/api/v1/data-exports/GET必需列出当前 API Key 可访问的组织或个人导出任务,支持 status、page 和 page_size。items、total、page、page_size
/api/v1/data-exports/POST必需创建 pending 导出任务,不在请求内执行大查询,要求 `exports:write`,并检查组织月导出额度。job_uid、status、download_url
/api/v1/data-exports/{job_uid}/GET必需查询导出任务状态,要求 API Key 与任务同组织;无组织任务按 owner 校验。status、row_count、expires_at
/api/v1/data-exports/{job_uid}/cancel/POST必需取消尚未运行的 pending 导出任务,要求 `exports:write` 且通过组织或 owner 隔离校验。job_uid、status
/api/v1/data-exports/{job_uid}/download/GET必需下载已完成且未过期的数据导出文件,要求 API Key 与任务同组织;无组织任务按 owner 校验。CSV/JSON 文件
/api/v1/data-exports/{job_uid}/signed-url/GET必需为已完成且未过期的导出生成短期本地签名下载 URL,要求 `exports:read` 且通过组织或 owner 隔离校验。signed_download.download_url、expires_at、storage
/api/v1/data-exports/{job_uid}/signed-download/GET签名令牌签名 URL 下载入口;令牌过期、文件过期或校验不一致时拒绝访问。CSV/JSON 文件
/api/data/GET可选静态 JSON 兼容层,保留旧客户端访问。原始兼容数据
/api/data/overview/GET可选摘要指标和筛选维度。overview
/api/data/map/GET可选地图聚合数据。markers
/api/data/table/GET可选分页表格数据。items、total
/api/data/epietl/GET可选公开 EpiETL 快照。meta、risk_summary、events

EXAMPLES

调用示例

以下示例演示公开调用与带 Key 调用的差异。
curl -sS 'https://example.com/api/v1/events/?page=1&page_size=5'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/events/?disease=measles'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/usage/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/billing/summary/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/billing/notification-preferences/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/notifications/?alert_type=billing_request_customer_notification&status=failed'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/notifications/summary/?visibility_state=all&read_state=unread'

curl -sS \
  -X PATCH \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"customer_notifications_enabled":true,"assignee_notifications_enabled":false,"reason":"contract support window"}' \
  'https://example.com/api/v1/organization/billing/notification-preferences/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/billing/requests/?assigned_to=unassigned&overdue=true'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"action":"request_plan_change","requested_plan":"enterprise","message":"Need annual contract"}' \
  'https://example.com/api/v1/organization/billing/requests/'

curl -sS \
  -X PATCH \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"assigned_to":"me","status":"in_review","status_note":"Finance owner picked this up"}' \
  'https://example.com/api/v1/organization/billing/requests/{request_uid}/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/billing/requests/{request_uid}/timeline/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"message":"Uploaded purchase order and billing contact"}' \
  'https://example.com/api/v1/organization/billing/requests/{request_uid}/supplements/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"message":"Internal finance follow-up is assigned"}' \
  'https://example.com/api/v1/organization/billing/requests/{request_uid}/notes/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/audit-logs/?q=owner&action=organization_member_update&actor=ops@example.org&created_from=2026-05-01'

curl -L -o audit.csv \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/audit-logs/export/?q=owner&action=organization_member_update&created_from=2026-05-01'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Owner audit view","filter_payload":{"q":"owner","action":"organization_member_update"}}' \
  'https://example.com/api/v1/organization/audit-saved-views/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"is_default":true,"shared_with_organization":true}' \
  'https://example.com/api/v1/organization/audit-saved-views/{view_uid}/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"active":true,"reason":"contract dispute","legal_hold_until":"2026-12-31"}' \
  'https://example.com/api/v1/organization/audit-logs/legal-hold/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Legal hold alert","recipient":"audit@example.org","actions":["organization_audit_retention_update"],"target_types":["organization_audit_retention"],"metadata_active":true}' \
  'https://example.com/api/v1/organization/audit-alert-rules/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"email":"analyst@example.org","role":"analyst"}' \
  'https://example.com/api/v1/organization/invitations/'

curl -sS \
  -H 'Content-Type: application/json' \
  -d '{"token":"invite_token_from_email","email":"analyst@example.org","username":"analyst","password":"change-me"}' \
  'https://example.com/api/v1/organization/invitations/{membership_uid}/accept/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"format":"csv","filter":{"diseases":["measles"]}}' \
  'https://example.com/api/v1/data-exports/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/data-exports/?status=pending'

curl -sS -X POST \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/data-exports/{job_uid}/cancel/'

curl -L -o export.csv \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/data-exports/{job_uid}/download/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/data-exports/{job_uid}/signed-url/'
curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/notifications/?q=invoice&read_state=unread&archive_state=active'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/notifications/?visibility_state=hidden'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/notifications/summary/?q=invoice&archive_state=active'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/notifications/{delivery_uid}/'

curl -sS \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"name":"Failed invoice notices","filter_payload":{"q":"invoice","status":"failed","read_state":"unread","visibility_state":"visible"}}' \
  'https://example.com/api/v1/organization/notifications/saved-views/'

curl -sS \
  -X POST \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/notifications/{delivery_uid}/read/'

curl -sS \
  -X POST \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"archived":false}' \
  'https://example.com/api/v1/organization/notifications/{delivery_uid}/archive/'

curl -sS \
  -X POST \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"hidden":true}' \
  'https://example.com/api/v1/organization/notifications/{delivery_uid}/hide/'

curl -sS \
  -X POST \
  -H 'X-API-Key: epic_live_...' \
  'https://example.com/api/v1/organization/notifications/{delivery_uid}/retry/'

curl -sS \
  -X POST \
  -H 'X-API-Key: epic_live_...' \
  -H 'Content-Type: application/json' \
  -d '{"action":"retry","delivery_uids":["{delivery_uid}"]}' \
  'https://example.com/api/v1/organization/notifications/bulk/'

ERRORS

状态码与限流

调用失败时会返回结构化错误,便于客户端统一处理。
状态码场景说明
401缺少或无效 Key仅在强制鉴权开启或携带无效 Key 时出现。
403Key 失效 / 范围不符 / IP 不允许 / 组织停用 / 组织角色不足账号状态、组织状态、scope、IP 或组织成员角色不满足要求。
410导出或邀请已过期导出文件超过保留期需重新创建;邀请令牌过期需重新邀请。
409导出未就绪或不可取消导出文件尚未生成,或任务已运行/完成,无法取消。
429额度用尽API Key 日/月/分钟额度、组织 API 月额度或组织导出月额度触发限制。
404资源不存在事件、国家或疾病标识未找到。

响应中会保留 `data_version`、`updated_at`、`ETag` 和 `Last-Modified` 等缓存字段。