project-invitation
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseProject Invitations
项目邀请
Overview
概述
When sharing a project with a user who is not a workspace member, Spuree creates a pending invitation instead of adding them directly. This skill manages those invitations.
Direct sharing (target is already a workspace member) is handled immediately byin the project-management skill — no invitation is created.POST /v1/projects/{projectId}/share
Use this skill when an agent needs to:
- Check pending invitations for the current user
- Accept or decline an invitation
- List, cancel, or resend invitations for a project
当与非工作区成员的用户共享项目时,Spuree会创建一个待处理的邀请,而不是直接添加该用户。本skill用于管理这些邀请。
直接共享(目标用户已是工作区成员)由project-management skill中的接口直接处理——不会创建邀请。POST /v1/projects/{projectId}/share
当Agent需要执行以下操作时,可使用本skill:
- 查看当前用户的待处理邀请
- 接受或拒绝邀请
- 列出、取消或重新发送某个项目的邀请
Authentication
认证
Authorization: Bearer $SPUREE_ACCESS_TOKENOr: . See the authentication skill.
X-API-Key: $SPUREE_API_KEYAuthorization: Bearer $SPUREE_ACCESS_TOKEN或使用:。详情请查看authentication skill。
X-API-Key: $SPUREE_API_KEYBase URL
基础URL
https://data.spuree.com/api/v1/projectshttps://data.spuree.com/api/v1/projectsInvitation Object
邀请对象
json
{
"id": "64a7b8c9d1e2f3a4b5c6d7e8",
"projectId": "64a7b8c9d1e2f3a4b5c6d7e9",
"projectName": "My Animation Project",
"workspaceId": "64a7b8c9d1e2f3a4b5c6d7f0",
"invitedEmail": "new-user@example.com",
"invitedBy": "owner@example.com",
"status": "pending",
"createdAt": "2024-01-15T10:00:00Z",
"expiresAt": "2024-01-22T10:00:00Z"
}| Field | Type | Description |
|---|---|---|
| string | Invitation ObjectId |
| string | Project ObjectId |
| string? | Project name |
| string | Workspace ObjectId |
| string | Invited user's email |
| string | Inviter's email |
| string | |
| datetime | Creation timestamp |
| datetime | Expiration (7 days after creation or last resend) |
json
{
"id": "64a7b8c9d1e2f3a4b5c6d7e8",
"projectId": "64a7b8c9d1e2f3a4b5c6d7e9",
"projectName": "My Animation Project",
"workspaceId": "64a7b8c9d1e2f3a4b5c6d7f0",
"invitedEmail": "new-user@example.com",
"invitedBy": "owner@example.com",
"status": "pending",
"createdAt": "2024-01-15T10:00:00Z",
"expiresAt": "2024-01-22T10:00:00Z"
}| 字段 | 类型 | 描述 |
|---|---|---|
| string | 邀请的ObjectId |
| string | 项目的ObjectId |
| string? | 项目名称 |
| string | 工作区的ObjectId |
| string | 被邀请用户的邮箱 |
| string | 邀请者的邮箱 |
| string | 状态: |
| datetime | 创建时间戳 |
| datetime | 过期时间(创建或最后一次重发后的7天) |
Endpoints
接口端点
GET /v1/projects/invitations/pending
GET /v1/projects/invitations/pending
List pending invitations for the current user.
Response:
{ "invitations": [ InvitationObject, ... ] }bash
curl "https://data.spuree.com/api/v1/projects/invitations/pending" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"列出当前用户的所有待处理邀请。
响应:
{ "invitations": [ InvitationObject, ... ] }bash
curl "https://data.spuree.com/api/v1/projects/invitations/pending" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"POST /v1/projects/invitations/{token}/accept
POST /v1/projects/invitations/{token}/accept
Accept an invitation. The user is added to the project's list and automatically joined to the workspace if not already a member.
sharedWithResponse:
json
{
"messageCode": "success",
"projectId": "...",
"projectName": "My Animation Project",
"workspaceId": "..."
}| Code | Description |
|---|---|
| 200 | Accepted — user added to project and workspace |
| 403 | Token does not belong to the authenticated user |
| 404 | Invitation not found or expired |
bash
curl -X POST "https://data.spuree.com/api/v1/projects/invitations/{token}/accept" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"接受邀请。用户会被添加到项目的列表中,如果该用户还不是工作区成员,会自动加入工作区。
sharedWith响应:
json
{
"messageCode": "success",
"projectId": "...",
"projectName": "My Animation Project",
"workspaceId": "..."
}| 状态码 | 描述 |
|---|---|
| 200 | 已接受——用户已添加到项目和工作区 |
| 403 | Token不属于当前认证用户 |
| 404 | 邀请不存在或已过期 |
bash
curl -X POST "https://data.spuree.com/api/v1/projects/invitations/{token}/accept" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"POST /v1/projects/invitations/{token}/decline
POST /v1/projects/invitations/{token}/decline
Decline an invitation.
Response:
{ "messageCode": "success", "projectId": "..." }bash
curl -X POST "https://data.spuree.com/api/v1/projects/invitations/{token}/decline" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"拒绝邀请。
响应:
{ "messageCode": "success", "projectId": "..." }bash
curl -X POST "https://data.spuree.com/api/v1/projects/invitations/{token}/decline" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"GET /v1/projects/{projectId}/invitations
GET /v1/projects/{projectId}/invitations
List all invitations for a project (all statuses).
Authorization: Owner or shared user.
Response:
{ "invitations": [ InvitationObject, ... ] }bash
curl "https://data.spuree.com/api/v1/projects/{projectId}/invitations" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"列出某个项目的所有邀请(包含所有状态)。
权限: 项目所有者或已共享用户。
响应:
{ "invitations": [ InvitationObject, ... ] }bash
curl "https://data.spuree.com/api/v1/projects/{projectId}/invitations" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"DELETE /v1/projects/{projectId}/invitations/{invitationId}
DELETE /v1/projects/{projectId}/invitations/{invitationId}
Cancel a pending invitation.
Authorization: Project owner or original inviter.
Response:
{ "messageCode": "success", "projectId": "..." }bash
curl -X DELETE "https://data.spuree.com/api/v1/projects/{projectId}/invitations/{invitationId}" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"取消待处理的邀请。
权限: 项目所有者或原邀请者。
响应:
{ "messageCode": "success", "projectId": "..." }bash
curl -X DELETE "https://data.spuree.com/api/v1/projects/{projectId}/invitations/{invitationId}" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"POST /v1/projects/{projectId}/invitations/{invitationId}/resend
POST /v1/projects/{projectId}/invitations/{invitationId}/resend
Resend an invitation — resets expiry to 7 days from now.
Authorization: Owner or shared user.
Response:
{ "messageCode": "success", "projectId": "..." }bash
curl -X POST "https://data.spuree.com/api/v1/projects/{projectId}/invitations/{invitationId}/resend" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"重新发送邀请——将过期时间重置为当前时间后的7天。
权限: 项目所有者或已共享用户。
响应:
{ "messageCode": "success", "projectId": "..." }bash
curl -X POST "https://data.spuree.com/api/v1/projects/{projectId}/invitations/{invitationId}/resend" \
-H "Authorization: Bearer $SPUREE_ACCESS_TOKEN"Common Patterns
常见流程
Invite a Non-Member
邀请非工作区成员
- Share the project (project-management skill):
POST /v1/projects/{id}/share { "email": "new-user@example.com" } → { type: "invitation", projectId: "..." } - The target user checks their pending invitations:
GET /v1/projects/invitations/pending - Accept:
POST /v1/projects/invitations/{token}/accept
- 共享项目(使用project-management skill):
POST /v1/projects/{id}/share { "email": "new-user@example.com" } → { type: "invitation", projectId: "..." } - 目标用户查看自己的待处理邀请:
GET /v1/projects/invitations/pending - 接受邀请:
POST /v1/projects/invitations/{token}/accept
Error Handling
错误处理
| Code | Description |
|---|---|
| 200 | Success |
| 400 | Invalid token or ID format |
| 401 | Invalid or expired auth token |
| 403 | Not authorized (wrong user, not owner/inviter) |
| 404 | Invitation not found, expired, or already actioned |
| 409 | Invitation already pending for this user |
| 500 | Internal server error |
| 状态码 | 描述 |
|---|---|
| 200 | 成功 |
| 400 | 无效的token或ID格式 |
| 401 | 无效或过期的认证token |
| 403 | 无权限(用户错误,非所有者/邀请者) |
| 404 | 邀请不存在、已过期或已被处理 |
| 409 | 该用户已有待处理的邀请 |
| 500 | 内部服务器错误 |