搜尋完整文件

輸入關鍵字,例如 idempotency、proposal lifecycle 或權限。

選擇 開啟
English
瀏覽文件

Activity · 契約參考

HTTP 操作索引

本頁列出契約測試版的 canonical Activity HTTP surface。目前尚未在網站上獨立發佈有版本號的 machine-readable schema。

契約狀態

項目目前狀態
OpenAPI version3.1.0
API document version0.8.0
Customer base path/api/v1
Maturity契約測試版
Public realtime API
受支援的 SDK

核心 schema 與 HMAC model 可供 consumer beta integration 使用。Activity 尚未提供 deprecation window、migration policy、generated client 或 managed-service compatibility promise。

身分驗證與 response

每個 /api/v1 operation 都需要 x-tenant-idx-actor-idx-feedaas-timestampx-feedaas-signature。呼叫以下 operation 前,請先閱讀簽署 Activity 請求

GET /api/health 是唯一不需身分驗證的 operation。

成功 response 會依資源使用不同 top-level key,例如 postfollowrelationshiplikecommentreportok。Timeline 與 comment collection 使用 data 加上 page.next_cursor

Error 使用同一種 envelope:

{
  "error": {
    "code": "post_not_found",
    "message": "post not found"
  }
}

Health

MethodPath用途
GET/api/health回傳 process 與 service health

Post 與 timeline

MethodPath用途
POST/api/v1/posts以簽署 actor 發佈 post
PATCH/api/v1/posts/{post_id}修改作者擁有的 body、metadata 或 render reference
DELETE/api/v1/posts/{post_id}Soft delete 作者擁有的 post,並移除 timeline entry
GET/api/v1/timeline/home讀取簽署 actor 的 materialized home timeline
GET/api/v1/actors/{actor_id}/posts讀取簽署 actor 可見的 profile post

Publish 接受選填的 idempotency_key。在同一個 tenant 與 actor 範圍內重複使用相同 key,會回傳原本的 post,不會重複執行 projection 或 delivery work。Timeline 與 profile read 使用 opaque cursor pagination。整合前請閱讀發佈與讀取排序與重建可見性與政策

Follow graph 與 relationship

MethodPath用途
POST/api/v1/followsFollow followed_id 或重新啟用 relationship
DELETE/api/v1/follows/{followed_id}Unfollow 並清除既有 following entry
POST/api/v1/relationships/{actor_id}/muteMute actor,並從 caller read 移除其 entry
DELETE/api/v1/relationships/{actor_id}/mute把 relationship state 還原成 active
POST/api/v1/relationships/{actor_id}/block套用雙向 read 與 follow 限制
DELETE/api/v1/relationships/{actor_id}/block刪除 caller 的 block edge

這些 operation 實作 feed graph state,不取代 host business authorization 或 organization membership。

Like、comment 與 reply

MethodPath用途
POST/api/v1/posts/{post_id}/likes冪等記錄簽署 actor 的 like
DELETE/api/v1/posts/{post_id}/likes移除簽署 actor 的 like,或確認已不存在
GET/api/v1/posts/{post_id}/comments使用 cursor 列出 top-level comment 或 reply
POST/api/v1/posts/{post_id}/comments建立 top-level comment
PATCH/api/v1/posts/{post_id}/comments/{comment_id}修改作者擁有的 comment
DELETE/api/v1/posts/{post_id}/comments/{comment_id}Soft delete 作者擁有的 comment 與可見 reply subtree
POST/api/v1/posts/{post_id}/comments/{comment_id}/replies回覆既有 comment

刪除 top-level comment 後,其 reply subtree 也會從 comment read 與 derived counter 移除。Comment body 與 metadata 仍是 Activity boundary 內的 host-shaped content。

Repost 與 share

MethodPath用途
POST/api/v1/posts/{post_id}/reposts建立 first-class shared post 與 repost engagement
POST/api/v1/posts/{post_id}/shares建立可帶 body 與 render reference 的 shared post

Share attribution 與 nested rendering rule 仍在 hardening。render_refs 只儲存 host reference,不會解析 identity 或驗證 media byte。

Viewer lifecycle

MethodPath用途
POST/api/v1/posts/{post_id}/hide對簽署 viewer 隱藏可見 post
POST/api/v1/posts/{post_id}/reports建立或更新簽署 actor 的 report record

Hide 不會刪除來源 post。Report 不會做 moderation decision,也不會改變 moderation_state

常見 domain error

StatusCode
400missing_tenant_idinvalid_tenant_idinvalid_followed_idcannot_follow_selfinvalid_actor_idinvalid_cursor 與 comment validation error
401HMAC timestamp 或 signature 缺少、格式錯誤、過期或不相符
403not_post_authornot_comment_authorrelationship_blocked
404post_not_foundcomment_not_found
422Ash 或未分類的 domain validation error

無權讀取的 post 會回傳 post_not_found。不要用 error 探測 cross-tenant、hidden、private、muted 或 blocked resource。

Compatibility boundary

OpenAPI artifact 是 operation-level source of truth。契約測試期間,client 應保持 cursor opaque、不依賴未記載欄位,也不要在未檢查目前 artifact 的情況下重新產生 client。

/api/v1 prefix 不代表 generally available stable API。目前沒有公開的 deprecation overlap window、changelog contract、migration guide 或 server-to-client compatibility matrix。

下一步:檢視 Activity 測試版限制與已知缺口