project-invitation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Project 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 by
POST /v1/projects/{projectId}/share
in the project-management skill — no invitation is created.
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_TOKEN
Or:
X-API-Key: $SPUREE_API_KEY
. See the authentication skill.
Authorization: Bearer $SPUREE_ACCESS_TOKEN
或使用:
X-API-Key: $SPUREE_API_KEY
。详情请查看authentication skill。

Base URL

基础URL

https://data.spuree.com/api/v1/projects
https://data.spuree.com/api/v1/projects

Invitation 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"
}
FieldTypeDescription
id
stringInvitation ObjectId
projectId
stringProject ObjectId
projectName
string?Project name
workspaceId
stringWorkspace ObjectId
invitedEmail
stringInvited user's email
invitedBy
stringInviter's email
status
string
pending
,
accepted
,
declined
,
expired
createdAt
datetimeCreation timestamp
expiresAt
datetimeExpiration (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"
}
字段类型描述
id
string邀请的ObjectId
projectId
string项目的ObjectId
projectName
string?项目名称
workspaceId
string工作区的ObjectId
invitedEmail
string被邀请用户的邮箱
invitedBy
string邀请者的邮箱
status
string状态:
pending
(待处理)、
accepted
(已接受)、
declined
(已拒绝)、
expired
(已过期)
createdAt
datetime创建时间戳
expiresAt
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
sharedWith
list and automatically joined to the workspace if not already a member.
Response:
json
{
  "messageCode": "success",
  "projectId": "...",
  "projectName": "My Animation Project",
  "workspaceId": "..."
}
CodeDescription
200Accepted — user added to project and workspace
403Token does not belong to the authenticated user
404Invitation 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已接受——用户已添加到项目和工作区
403Token不属于当前认证用户
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

邀请非工作区成员

  1. Share the project (project-management skill):
    POST /v1/projects/{id}/share { "email": "new-user@example.com" }
    → { type: "invitation", projectId: "..." }
  2. The target user checks their pending invitations:
    GET /v1/projects/invitations/pending
  3. Accept:
    POST /v1/projects/invitations/{token}/accept
  1. 共享项目(使用project-management skill):
    POST /v1/projects/{id}/share { "email": "new-user@example.com" }
    → { type: "invitation", projectId: "..." }
  2. 目标用户查看自己的待处理邀请:
    GET /v1/projects/invitations/pending
  3. 接受邀请:
    POST /v1/projects/invitations/{token}/accept

Error Handling

错误处理

CodeDescription
200Success
400Invalid token or ID format
401Invalid or expired auth token
403Not authorized (wrong user, not owner/inviter)
404Invitation not found, expired, or already actioned
409Invitation already pending for this user
500Internal server error
状态码描述
200成功
400无效的token或ID格式
401无效或过期的认证token
403无权限(用户错误,非所有者/邀请者)
404邀请不存在、已过期或已被处理
409该用户已有待处理的邀请
500内部服务器错误