Create a tenant
POST
/v1/tenantscurl -X POST 'https://api.embodiflow.io/v1/tenants' \
-H 'Authorization: Bearer $EMBODIFLOW_PAT' \
-H 'Content-Type: application/json' \
-d '{
"name": "string",
"storageKey": "string"
}'认证
每个请求都需要携带个人访问令牌(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
- namestring必填
Display name for the new tenant.
- storageKeystring
Optional storage naming identity (1–20 ASCII letters/digits). Server trims and lowercases to [a-z0-9]{1,20}. Omitted → server generates a 20-char key. Immutable after create. Do not send COS appId or physical bucket names.
响应
Success
- dataobject必填
- tenantobject必填
- membershipobject必填
- metaobject必填
响应示例
{
"data": {
"tenant": {
"id": "00000000-0000-0000-0000-000000000000",
"slug": "string",
"name": "string",
"status": "string",
"storageKey": "string"
},
"membership": {
"id": "00000000-0000-0000-0000-000000000000",
"tenantId": "00000000-0000-0000-0000-000000000000",
"tenant": {
"id": "00000000-0000-0000-0000-000000000000",
"slug": "string",
"name": "string",
"status": "string",
"storageKey": "string"
},
"role": "string",
"status": "string",
"joinedAt": "string"
}
},
"meta": {
"requestId": "018f0000-0000-7000-8000-0000000000aa"
}
}服务器https://api.embodiflow.io/v1https://api.embodiflow.dev/v1