Create a tenant invitation
POST
/v1/tenant-invitationscurl -X POST 'https://api.embodiflow.io/v1/tenant-invitations' \
-H 'Authorization: Bearer $EMBODIFLOW_PAT' \
-H 'Content-Type: application/json' \
-d '{
"email": "user+tag@example.com",
"role": "owner",
"expiresInDays": 0,
"projectGrants": [
{
"projectId": "00000000-0000-0000-0000-000000000000",
"role": "owner",
"orderId": "00000000-0000-0000-0000-000000000000",
"taskId": "00000000-0000-0000-0000-000000000000"
}
]
}'认证
每个请求都需要携带个人访问令牌(PAT)。
- Authorization: Bearer PAT
请求头参数
- Idempotency-Keystring
Optional idempotency key, at most 255 characters (UUIDv4 recommended). A repeated key returns the first response byte-for-byte, including a 5xx. The same key with a different body, or a second in-flight request, returns 409 IDEMPOTENCY_CONFLICT. Keys are unique per tenant and retained for 24 hours.
请求体
Content-Typeapplication/json
- emailstring必填
Invitee email. Must include a domain with a real TLD (rejects qa-probe@bad).
- rolestring必填可选值owneradminresearcherbilling_adminviewer
- expiresInDaysnumber
Invitation lifetime in days. Omitted defaults to 7 (ADR 0019). Allowed range 1–7.
- projectGrantsarray<InvitationProjectGrantBodyDto>
Project roles applied when the invitee accepts (SCHEMA §10). Collector grants may include orderId and taskId.
- projectIdstring (uuid)必填
- rolestring必填可选值ownereditorreviewerlabelervieweruploaderdata_supplier
- orderIdstring (uuid)
- taskIdstring (uuid)
响应
Success
- dataobject必填
- idstring必填
- tenantIdstring必填
- emailstring必填
- emailNormalizedstring必填
- rolestring必填可选值owneradminresearcherbilling_adminviewer
- statusstring必填可选值expiredpendingacceptedrevoked
- invitedByUserIdstring | null必填
- expiresAtstring必填
- acceptedAtstring | null必填
- acceptedByUserIdstring | null必填
- createdAtstring必填
- updatedAtstring必填
- metaobject必填
- requestIdstring必填
响应示例
{
"data": {
"id": "string",
"tenantId": "string",
"email": "string",
"emailNormalized": "string",
"role": "owner",
"status": "expired",
"invitedByUserId": "string",
"expiresAt": "string",
"acceptedAt": "string",
"acceptedByUserId": "string",
"createdAt": "string",
"updatedAt": "string"
},
"meta": {
"requestId": "string"
}
}服务器https://api.embodiflow.io/v1https://api.embodiflow.dev/v1