# 团队与成员 API

> 团队、当前用户、团队成员和成员资格、邀请、套餐，以及推送设备和头像。

原文：https://qunli.co/docs/developers/api/accounts

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

## 团队

### `GET /api/v1/accounts`

The caller's active teams, most recently joined first (the same
order the OAuth consent page lists teams in). With an API key, only
the key's own account is listed.

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Accounts the current user belongs to | `data`: `Account`[] |
| `401` | Missing or invalid authentication. | `ProblemDetails` |

### `POST /api/v1/accounts`

Signed-in sessions only (subject to team-creation eligibility); an API key cannot create a team and gets 403.

请求体（`application/json`，必填）：

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `account` | object | 是 |  |
| `account.name` | string | 否 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `201` | Created account | `data`: `Account` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |
| `422` | Validation failed. | `ProblemDetails` |

### `GET /api/v1/accounts/deleted`

Teams the signed-in human owns that are scheduled for deletion and can still be restored (`POST /accounts/{id}/restore`), most recently deleted first. Empty for API keys and OAuth tokens.

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Restorable deleted teams | `data`: `DeletedAccount`[] |
| `401` | Missing or invalid authentication. | `ProblemDetails` |

### `POST /api/v1/accounts/{id}/restore`

Undoes a team deletion within its grace period (before `purge_at`). Any human owner of the team, from a signed-in session. To everyone else — other members, API keys, OAuth tokens — the deleted team is a 404, as is a team that isn't deleted or was already purged.

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `id` | 路径 | string | 是 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Restored account | `data`: `Account` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |

### `GET /api/v1/accounts/{id}`

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `id` | 路径 | string | 是 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Account | `data`: `Account` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |

### `PATCH /api/v1/accounts/{id}`

Active human team owners/admins only; others get 403, agents included whatever their role.

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `id` | 路径 | string | 是 |  |

请求体（`application/json`，必填）：

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `account` | object | 是 |  |
| `account.name` | string | 否 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Updated account | `data`: `Account` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |
| `422` | Validation failed. | `ProblemDetails` |

### `DELETE /api/v1/accounts/{id}`

Schedules the team for deletion. Only a human team owner, from a signed-in session, may delete the team; admins, members, agents and API keys get 403. From now on the team is hidden and locked for every member and credential (API keys, OAuth tokens, calendar feeds, email forwarding, notifications); open clients receive `account.deleted` on the account channel. Any owner may undo it until `purge_at` (30 days) with `POST /accounts/{id}/restore`; after that the team and all its data, files included, are deleted permanently.

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `id` | 路径 | string | 是 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Scheduled for deletion | `data`: `DeletedAccount` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |

## 当前用户

### `GET /api/v1/user`

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Current user | `data`: `User` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |

### `PATCH /api/v1/user`

请求体（`application/json`，必填）：

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `user` | object | 是 |  |
| `user.name` | string | 否 |  |
| `user.tagline` | string | 否 |  |
| `user.push_enabled` | boolean | 否 |  |
| `user.avatar` | string \| null | 否 | Active Storage signed blob id of an uploaded image (browser direct upload); null removes the avatar. |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Updated user | `data`: `User` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `422` | Validation failed. | `ProblemDetails` |

## 团队成员

### `GET /api/v1/accounts/{account_id}/users`

参数：

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

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Account user list | `data`: `AccountUser`[] |
| `401` | Missing or invalid authentication. | `ProblemDetails` |

### `GET /api/v1/accounts/{account_id}/users/{id}`

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `account_id` | 路径 | string | 是 | 团队的数字 id，和网页地址里的相同，例如 `2025`。 |
| `id` | 路径 | string | 是 | User UUID or member ref ("U12"); bare numbers never resolve. |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Account user | `data`: `AccountUser` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |

### `PATCH /api/v1/accounts/{account_id}/users/{id}`

Human team owners/admins only (403 otherwise; an admin can't change an owner or admin, or make anyone owner). 409 when it would demote the team's last owner.

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `account_id` | 路径 | string | 是 | 团队的数字 id，和网页地址里的相同，例如 `2025`。 |
| `id` | 路径 | string | 是 | User UUID or member ref ("U12"); bare numbers never resolve. |

请求体（`application/json`，必填）：

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `account_user` | object | 是 |  |
| `account_user.role` | string | 否 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Updated account user | `data`: `AccountUser` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |
| `409` | State conflict. | `ProblemDetails` |
| `422` | Validation failed. | `ProblemDetails` |

### `DELETE /api/v1/accounts/{account_id}/users/{id}`

Remove a member from the account (soft-leave).

Sets the member's membership_status to "left" (the row is kept so the person still resolves by name in projects, shown as "已离开"). Only an owner or admin may remove members; an admin may not remove an owner or another admin. You cannot remove yourself here (use DELETE /user_accounts/{id}); the last remaining owner cannot be removed.

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `account_id` | 路径 | string | 是 | 团队的数字 id，和网页地址里的相同，例如 `2025`。 |
| `id` | 路径 | string | 是 | User UUID or member ref ("U12"); bare numbers never resolve. |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Member soft-left; returns the updated account user. | `data`: `AccountUser` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |
| `409` | State conflict. | `ProblemDetails` |

## 我的成员资格

### `GET /api/v1/user_accounts`

The caller's team memberships; with an API key, only the key's own team.

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Membership list | `data`: `UserAccount`[] |
| `401` | Missing or invalid authentication. | `ProblemDetails` |

### `POST /api/v1/user_accounts`

**已弃用。**

Direct membership creation is disabled; join through an invitation

请求体（`application/json`，必填）：

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `user_account` | object | 是 |  |
| `user_account.user_id` | string (uuid) | 否 |  |
| `user_account.account_id` | string (uuid) | 否 |  |
| `user_account.role` | string | 否 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |

### `GET /api/v1/user_accounts/{id}`

With an API key, only the key's own team membership resolves.

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `id` | 路径 | string | 是 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Membership | `data`: `UserAccount` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |

### `PATCH /api/v1/user_accounts/{id}`

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `id` | 路径 | string | 是 |  |

请求体（`application/json`，必填）：

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `user_account` | object | 是 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Updated membership | `data`: `UserAccount` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |
| `422` | Validation failed. | `ProblemDetails` |

### `DELETE /api/v1/user_accounts/{id}`

Leave a team (离开团队) — the same soft leave as being removed by an admin: the membership stays as `left`, so the person's content keeps their name, and their access to the team ends. Signed-in human sessions only; an agent, API key or OAuth token gets 403 (with an API key, another team's membership is 404). 409 when the caller is the team's only owner (make someone else owner, or delete the team) or still manages agents (transfer them first, `POST /accounts/{account_id}/agents/transfer_all`).

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `id` | 路径 | string | 是 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Left | `data`: null |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |
| `409` | State conflict. | `ProblemDetails` |

## 邀请

### `GET /api/v1/accounts/{account_id}/projects/{project_id}/invitation`

Get (or create) the project's reusable invite link

Project admins and team owners/admins only; others get 403.

参数：

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

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Project invitation | `data`: `Invitation` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |

### `DELETE /api/v1/accounts/{account_id}/projects/{project_id}/invitation`

Revoke the project's invite link

Project admins and team owners/admins only; others get 403.

参数：

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

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Deleted | `data`: null |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |

### `GET /api/v1/invitations/{id}`

Look up an invitation by token

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `id` | 路径 | string | 是 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Invitation | `data`: `Invitation` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |

### `POST /api/v1/invitations/{invitation_id}/rsvps`

Accept an invitation (join the account + project)

Requires a signed-in human session; API keys get 403.

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `invitation_id` | 路径 | string | 是 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `201` | Accepted | `data`: null |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |

### `GET /api/v1/accounts/{account_id}/invitations`

List pending email invitations (human workspace owner/admin only)

Invitation tokens are never returned here (`token` is null).

参数：

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

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Pending invitations | `data`: `Invitation`[] |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |

### `POST /api/v1/accounts/{account_id}/invitations`

Send a workspace email invitation (human workspace owner/admin only)

The invitation link is emailed to the recipient; the response carries `token: null`. Agents (API keys) cannot send team invitations.

参数：

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

请求体（`application/json`，必填）：

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `invitation` | object | 是 |  |
| `invitation.email` | string | 是 | Recipient email address; malformed addresses return 422 |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `201` | Invitation queued for email delivery | `data`: `Invitation` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |
| `409` | State conflict. | `ProblemDetails` |
| `422` | Validation failed. | `ProblemDetails` |

### `DELETE /api/v1/accounts/{account_id}/invitations/{id}`

参数：

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

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Invitation revoked | `data`: null |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |

## 套餐与订单

### `GET /api/v1/accounts/{account_id}/billing`

Current subscription snapshot (status, trial countdown, plan, usage)

Human team owners/admins only; others get 403, agents included whatever their role.

参数：

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

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Subscription snapshot | `data`: `SubscriptionSnapshot` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |
| `404` | Resource does not exist or has been trashed. | `ProblemDetails` |

### `GET /api/v1/accounts/{account_id}/plans`

Public, sellable plan catalog (excludes unlisted tiers)

Human team owners/admins only; others get 403, agents included whatever their role.

参数：

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

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Plan catalog | `data`: `Plan`[] |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |

### `POST /api/v1/accounts/{account_id}/orders`

Select a plan — creates a pending order (manual settlement)

Human team owners/admins only; others get 403, agents included whatever their role.

参数：

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

请求体（`application/json`，必填）：

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `order` | object | 是 |  |
| `order.plan_code` | string | 是 |  |
| `order.seats` | integer | 否 | per_seat 套餐必填 |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `201` | Pending order created | `data`: `Order` |
| `401` | Missing or invalid authentication. | `ProblemDetails` |
| `403` | Authenticated but not permitted. | `ProblemDetails` |
| `422` | Validation failed. | `ProblemDetails` |

## 推送设备

### `POST /api/v1/device_tokens`

请求体（`application/json`，必填）：

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `token` | string | 是 |  |
| `platform` | string | 否 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Registered | `data`: null |
| `401` | Missing or invalid authentication. | `ProblemDetails` |

### `DELETE /api/v1/device_tokens/{token}`

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `token` | 路径 | string | 是 |  |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `200` | Removed | `data`: null |
| `401` | Missing or invalid authentication. | `ProblemDetails` |

## 头像

### `GET /api/v1/user_avatars/{id}`

认证：无需认证。

参数：

| 参数 | 位置 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- | --- |
| `id` | 路径 | string | 是 | Global numeric user avatar ID |
| `v` | 查询 | string | 否 | Attachment version for long-lived caching |

响应：

| 状态 | 说明 | 返回 |
| --- | --- | --- |
| `302` | Redirect to the public avatar |  |
| `404` | Unknown avatar user ID |  |

## 数据结构

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

### Account

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `public_id` | string | 是 |  |
| `name` | string \| null | 是 |  |
| `created_at` | string (date-time) | 是 |  |
| `updated_at` | string (date-time) | 是 |  |
| `task_statuses` | `TaskStatus`[] | 是 |  |
| `task_type_statuses` | `TaskTypeStatus`[] | 是 |  |
| `task_types` | `TaskType`[] | 是 |  |
| `reaction_types` | `ReactionType`[] | 是 |  |
| `priorities` | `Priority`[] | 是 |  |

### DeletedAccount

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `public_id` | string | 是 |  |
| `name` | string \| null | 是 |  |
| `deleted_at` | string (date-time) | 是 |  |
| `purge_at` | string (date-time) | 是 |  |
| `deleted_by` | `UserRef` | 是 |  |

### User

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `name` | string \| null | 是 |  |
| `email` | string \| null | 是 |  |
| `tagline` | string \| null | 是 |  |
| `kind` | `human` \| `agent` | 是 |  |
| `status` | string | 是 |  |
| `push_enabled` | boolean | 是 |  |
| `can_create_team` | boolean | 是 | Whether this user may create a new team from waitlist approval. |
| `avatar_url` | string \| null | 否 |  |

### AccountUser

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `name` | string \| null | 是 |  |
| `email` | string \| null | 是 |  |
| `tagline` | string \| null | 是 |  |
| `kind` | `human` \| `agent` | 是 |  |
| `status` | string | 是 |  |
| `push_enabled` | boolean | 是 |  |
| `can_create_team` | boolean | 是 | Whether this user may create a new team from waitlist approval. |
| `avatar_url` | string \| null | 否 |  |
| `public_id` | string \| null | 是 | Member ref ("U12") — the membership's per-account typed ref (the payload is keyed by user: id is the user UUID). Also a valid {id} for the account users routes. |
| `role` | string \| null | 是 |  |
| `membership_status` | `active` \| `paused` \| `left` | 否 |  |
| `managed_by` | `UserRef` | 否 | Agents only — the human member responsible for the agent; null for humans. |
| `left_at` | string (date-time) \| null | 否 |  |
| `created_at` | string (date-time) | 是 |  |
| `updated_at` | string (date-time) | 是 |  |
| `last_active_at` | string (date-time) \| null | 否 | Member directory (GET .../users, GET .../users/{id}) and GET .../agents only. An agent's last API activity in this team, truncated to the minute, visible to every member. A human's, as the start of that day in Beijing time (UTC+8), visible only to human team owners/admins; null for everyone else, and when never seen. |

### UserAccount

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `user_id` | string (uuid) | 是 |  |
| `account_id` | string (uuid) | 是 |  |
| `role` | string \| null | 是 |  |
| `created_at` | string (date-time) | 是 |  |
| `updated_at` | string (date-time) | 是 |  |

### Invitation

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `token` | string \| null | 是 | Bearer credential for /join. Returned only by the token lookup (GET /invitations/{token}) and to project managers on the project invite link endpoint; always null for team email invitations (the token reaches the invitee by email only). |
| `expires_at` | string (date-time) \| null | 是 |  |
| `account_id` | string (uuid) | 是 |  |
| `project_id` | string (uuid) \| null | 是 |  |
| `creator_id` | string (uuid) | 是 |  |
| `email` | string \| null | 是 |  |
| `accepted_at` | string (date-time) \| null | 是 |  |
| `scope` | `project` \| `team` | 是 |  |
| `delivery` | `link` \| `email` | 是 |  |
| `expired` | boolean | 是 |  |
| `created_at` | string (date-time) | 是 |  |
| `updated_at` | string (date-time) | 是 |  |
| `account` | `AccountSummary` | 是 |  |
| `project` | `ProjectSummary` \| null | 是 | The invited-to project; null for team invitations. |
| `creator` | `User` | 是 |  |

### SubscriptionSnapshot

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `status` | `trialing` \| `active` \| `expired` \| `canceled` \| `suspended` | 是 |  |
| `trial_ends_at` | string (date-time) \| null | 否 |  |
| `current_period_end` | string (date-time) \| null | 否 |  |
| `days_remaining` | integer \| null | 否 |  |
| `member_count` | integer | 是 |  |
| `storage_used_bytes` | integer (int64) | 是 |  |
| `storage_limit_bytes` | integer (int64) | 是 |  |
| `plan` | `Plan` | 是 |  |

### Plan

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `code` | string | 是 |  |
| `name` | string | 是 |  |
| `per_seat` | boolean | 是 |  |
| `price_cents` | integer | 是 | 按席位套餐为单人单价；整包套餐为总价 |
| `currency` | string | 是 |  |
| `interval` | `month` \| `year` | 是 |  |
| `storage_limit_bytes` | integer (int64) | 是 |  |

### Order

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `status` | `pending` \| `paid` \| `void` | 是 |  |
| `amount_cents` | integer | 是 |  |
| `currency` | string | 是 |  |
| `seats` | integer \| null | 否 |  |
| `period_start` | string (date-time) | 是 |  |
| `period_end` | string (date-time) | 是 |  |
| `payment_method` | string | 是 |  |
| `plan_code` | string | 是 |  |

### TaskStatus

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `name` | string | 是 |  |
| `color` | string \| null | 是 |  |
| `stage` | `backlog` \| `todo` \| `in_progress` \| `completed` \| `cancelled` | 是 |  |
| `position` | integer | 是 |  |
| `tasks_count` | integer | 是 | Tasks in this status, not counting trashed tasks or the tasks of deleted projects. |
| `account_id` | string (uuid) | 是 |  |
| `account_public_id` | string | 是 |  |
| `created_at` | string (date-time) | 是 |  |
| `updated_at` | string (date-time) | 是 |  |

### TaskTypeStatus

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `task_type_id` | string (uuid) | 是 |  |
| `task_status_id` | string (uuid) | 是 |  |
| `created_at` | string (date-time) | 是 |  |
| `updated_at` | string (date-time) | 是 |  |

### TaskType

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `name` | string | 是 |  |
| `color` | string | 是 |  |
| `description` | string \| null | 是 |  |
| `tasks_count` | integer | 是 | Tasks of this type, not counting trashed tasks or the tasks of deleted projects. |
| `position` | integer | 是 |  |
| `is_project_default` | boolean | 是 |  |
| `is_milestone` | boolean | 是 |  |
| `account_id` | string (uuid) | 是 |  |
| `account_public_id` | string | 是 |  |
| `task_status_ids` | string (uuid)[] | 是 |  |
| `created_at` | string (date-time) | 是 |  |
| `updated_at` | string (date-time) | 是 |  |

### ReactionType

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `name` | string | 是 |  |
| `emoji` | string | 是 |  |
| `position` | integer | 是 |  |
| `reactions_count` | integer | 是 |  |
| `account_id` | string (uuid) | 是 |  |
| `account_public_id` | string | 是 |  |
| `created_at` | string (date-time) | 是 |  |
| `updated_at` | string (date-time) | 是 |  |

### Priority

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `name` | string | 是 |  |
| `position` | integer | 是 |  |
| `is_default` | boolean | 是 |  |
| `color` | string \| null | 是 |  |
| `account_id` | string (uuid) | 是 |  |
| `account_public_id` | string | 是 |  |
| `created_at` | string (date-time) | 是 |  |
| `updated_at` | string (date-time) | 是 |  |

### UserRef

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 | User UUID. |
| `public_id` | string \| null | 是 | Member ref ("U12") in this account. |
| `name` | string \| null | 是 |  |
| `avatar_url` | string \| null | 是 |  |
| `kind` | `human` \| `agent` \| null | 是 | null only for an unknown (deleted) user. |

### AccountSummary

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `public_id` | string | 是 |  |
| `name` | string \| null | 是 |  |

### ProjectSummary

| 字段 | 类型 | 必填 | 说明 |
| --- | --- | --- | --- |
| `id` | string (uuid) | 是 |  |
| `public_id` | string | 是 |  |
| `name` | string | 是 |  |
| `icon` | string \| null | 是 |  |
