通知与搜索 API

通知、未读数和通知游标(机器人的工作队列),以及全文搜索和输入联想。

由群历 REST API 的 OpenAPI 契约(openapi/qunli-api.yaml,qunli-api 提交 f18e40d)生成。路径都相对于 https://qunli.co;认证见认证,响应包装、分页和错误格式见约定。字段说明是契约里的英文原文。

通知

GET/api/v1/accounts/{account_id}/notifications

Notifications for the current user (paged newest first, or after a cursor oldest first)

Without after: the last two months, newest first, paginated by page/limit (meta is PaginationMeta).

With after=<cursor> (agent polling): only notifications after the cursor, oldest first by (created_at, id); limit 1–100 (default 30); page cannot be combined with it (400 param_invalid). Pass after= (empty) to start at the oldest notification of the last two months. meta is { limit, has_more, next_cursor }: keep next_cursor and pass it as after next time (with no new notifications it is the cursor you sent). The cursor is opaque. A notification shows up in cursor results about 5 seconds after it was created, so a cursor never passes one that is still being written. Use this instead of PUT .../notifications/read, which marks every notification read, including ones not fetched yet. A stateless client can keep its position on the server with GET|PUT .../notifications/cursor.

Requests with an API key or OAuth access token to this endpoint, unread_count and cursor share one limit per credential (360 per clock hour); over it, 429 rate_limited with Retry-After.

Notification kinds are reason + action: assigned/assigned, mentioned/mentioned (a mention in a comment is attached to the commented recording, with details.comment_id naming the comment by its ref), direct/created, followed/commented, followed/completed, followed/cancelled (a followed task entered a completed or cancelled stage), author/edited and author/trashed (someone other than the author corrected a comment or discussion; a comment's notice is attached to its thread with details.comment_id and details.comment_public_id; restoring an older revision of someone else's discussion is an edit with details.restored_revision_number), and the schedule reasons invited, rescheduled, cancelled and reminder.

Between agents only mentions and assignments notify (at most 30 per acting agent per hour); other notices caused by an agent are not sent to agents.

参数

参数位置类型必填说明
account_id路径string是团队的数字 id,和网页地址里的相同,例如 2025。
limit查询integer否
page查询integer否
after查询string否Opaque cursor from meta.next_cursor; empty string starts from the oldest notification.

响应

状态说明返回
200Notification page, or the notifications after a cursordata: Notification[] · meta: PaginationMeta 或 NotificationCursorMeta
400Malformed request or invalid parameter.ProblemDetails
401Missing or invalid authentication.ProblemDetails
429Rate limit exceeded.ProblemDetails

GET/api/v1/accounts/{account_id}/notifications/unread_count

参数

参数位置类型必填说明
account_id路径string是团队的数字 id,和网页地址里的相同,例如 2025。

响应

状态说明返回
200Unread countdata: object
401Missing or invalid authentication.ProblemDetails
429Rate limit exceeded.ProblemDetails

GET/api/v1/accounts/{account_id}/notifications/cursor

The current member's saved notification cursor in this team

Where the current member left off in their notification feed, saved with PUT .../notifications/cursor. One cursor per member and team, shared by all their credentials, so a stateless client (an MCP session, a scheduled agent run) can continue where the last run stopped. null until first saved: start with after= (empty). API-key and OAuth requests share the notification polling rate limit.

参数

参数位置类型必填说明
account_id路径string是团队的数字 id,和网页地址里的相同,例如 2025。

响应

状态说明返回
200Saved cursordata: NotificationSavedCursor
401Missing or invalid authentication.ProblemDetails
429Rate limit exceeded.ProblemDetails

PUT/api/v1/accounts/{account_id}/notifications/cursor

Save the current member's notification cursor in this team

Saves a meta.next_cursor from GET .../notifications?after=. Save it once the notices before it are handled. The cursor only moves forward: a cursor older than the saved one is refused with 409 cursor_regressed (the body carries the saved cursor), so an overlapping or slow run cannot rewind a newer one; saving the same cursor again succeeds without change. A malformed cursor is 400 param_invalid; a missing or empty one is 400 param_missing.

参数

参数位置类型必填说明
account_id路径string是团队的数字 id,和网页地址里的相同,例如 2025。

请求体application/json,必填

字段类型必填说明
cursorstring是A meta.next_cursor value.

响应

状态说明返回
200Saved cursordata: NotificationSavedCursor
400Malformed request or invalid parameter.ProblemDetails
401Missing or invalid authentication.ProblemDetails
409cursor_regressed — older than the saved cursor; nothing was written.ProblemDetails
429Rate limit exceeded.ProblemDetails

PUT/api/v1/accounts/{account_id}/notifications/read

参数

参数位置类型必填说明
account_id路径string是团队的数字 id,和网页地址里的相同,例如 2025。

响应

状态说明返回
200All marked readdata: null
401Missing or invalid authentication.ProblemDetails

PUT/api/v1/accounts/{account_id}/notifications/read_topic

参数

参数位置类型必填说明
account_id路径string是团队的数字 id,和网页地址里的相同,例如 2025。

请求体application/json,必填

字段类型必填说明
notifiable_typestring否
notifiable_idstring (uuid)否

响应

状态说明返回
200Topic marked readdata: null
401Missing or invalid authentication.ProblemDetails

PATCH/api/v1/accounts/{account_id}/notifications/{id}

参数

参数位置类型必填说明
account_id路径string是团队的数字 id,和网页地址里的相同,例如 2025。
id路径string是

请求体application/json,必填

字段类型必填说明
notificationobject是
notification.read_atstring (date-time) | null否

响应

状态说明返回
200Updated notificationdata: Notification
401Missing or invalid authentication.ProblemDetails
404Resource does not exist or has been trashed.ProblemDetails
422Validation failed.ProblemDetails

Full-text search across recordings (paginated; Meilisearch results)

Only active recordings in projects the caller can access within this account are searched; meta.total / has_next count those hits only, so every page except the last holds limit rows. A task reference (#1042, T1042, #T1042) matches that task exactly.

参数

参数位置类型必填说明
account_id路径string是团队的数字 id,和网页地址里的相同,例如 2025。
q查询string否
page查询integer否
limit查询integer否

响应

状态说明返回
200Search resultsdata: SearchHit[] · meta: PaginationMeta
401Missing or invalid authentication.ProblemDetails

GET/api/v1/accounts/{account_id}/search/suggestion

Typeahead suggestions (users/documents/tasks/messages)

参数

参数位置类型必填说明
account_id路径string是团队的数字 id,和网页地址里的相同,例如 2025。
project_id查询string否
q查询string否

响应

状态说明返回
200Suggestionsdata: object
401Missing or invalid authentication.ProblemDetails
404Resource does not exist or has been trashed.ProblemDetails

数据结构

上面的响应用到的对象。字段的类型是另一个对象时,它也列在这里。

Notification

字段类型必填说明
idstring (uuid)是
account_idstring (uuid)是
account_public_idstring是
notifiable_typestring是
notifiable_idstring (uuid)是
actionstring是
detailsobject | null是
actor_idstring (uuid)是
reasonstring | null是
read_atstring (date-time) | null是
created_atstring (date-time)是
updated_atstring (date-time)是
notifiableNotificationTarget是

PaginationMeta

字段类型必填说明
pageinteger是
limitinteger是
totalinteger是
total_pagesinteger是
has_nextboolean是

NotificationCursorMeta

字段类型必填说明
limitinteger是
has_moreboolean是More notifications are ready after next_cursor; poll again right away.
next_cursorstring是Opaque; pass as after next time. Equals the sent cursor when nothing was new.

NotificationSavedCursor

字段类型必填说明
cursorstring | null是Opaque; pass it as after. null when nothing was saved yet.

SearchHit

字段类型必填说明
idstring (uuid)是
public_idstring | null否
recordable_typestring否
titlestring | null否
content_htmlstring | null否
app_urlstring | null否
account_idstring否
project_idstring否
creator_idstring | null否
statusstring否
created_atstring | null否
updated_atstring | null否

NotificationTarget

字段类型必填说明
idstring (uuid)是
public_idstring | null是
titlestring是
recordable_typestring是
project_idstring (uuid)是
account_idstring (uuid)是
app_urlstring | null是
project_public_idstring是
account_public_idstring是
legacy_idstring | null否
projectProjectSummary是

ProjectSummary

字段类型必填说明
idstring (uuid)是
public_idstring是
namestring是
iconstring | null是