角色與權限
創建角色
POST /api/organizations/{organizationPk}/groups/
參數
organizationPk
✅
string
A UUID string identifying this 組織 ID
請求內容
請求參數
name
string
是
organization
string (uuid)
否
permissions
array[string]
是
請求結構範例
{
"name": string
"organization"?: string (uuid) // 非必填
"permissions": [
string (uuid)
]
}
請求範例值
{
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X POST "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}'
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
狀態碼: 201
回應結構範例
{
"id": string (uuid)
"name": string
"permissions": [
{
"id": string (uuid)
"name": string
"description"?: string // 非必填
}
]
"createdAt": string (timestamp)
}
回應範例值
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"permissions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"description": "response_string"
}
],
"createdAt": "response_string"
}
批量新增角色成員
POST /api/organizations/{organizationPk}/groups/{groupPk}/group-members/bulk-create/
參數
groupPk
✅
string
organizationPk
✅
string
A UUID string identifying this 組織 ID
請求內容
請求參數
members
array[string]
是
請求結構範例
{
"members": [
string (uuid)
]
}
請求範例值
{
"members": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X POST "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/bulk-create/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"members": [
"550e8400-e29b-41d4-a716-446655440000"
]
}'
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
狀態碼: 201
回應結構範例
[
{
"id"?: string (uuid) // 角色成員 ID (非必填)
"member"?: // 非必填
{
"id"?: string (uuid) // 成員 ID (非必填)
"name"?: string // 成員姓名 (非必填)
"email"?: string (email) // 成員電子郵件 (非必填)
"organization"?: // 非必填
{
"id"?: string (uuid) // 組織 ID (非必填)
"name"?: string // 組織名稱 (非必填)
"owner"?: // 非必填
{
"id"?: string (uuid) // 擁有者 ID (非必填)
"name"?: string // 擁有者姓名 (非必填)
}
"createdAt"?: string // 組織建立時間戳 (非必填)
"usageStatistics"?: // 非必填
{
"chatbotsCount"?: integer // 聊天機器人數量 (非必填)
"canCreateChatbot"?: boolean // 是否可以創建聊天機器人 (非必填)
"hasCreateChatbotLimit"?: boolean // 是否有創建聊天機器人限制 (非必填)
"currentMonthWordsCountTotal"?: integer // 當月總字數限制 (非必填)
"currentMonthUsedWordsCountTotal"?: integer // 當月已使用字數 (非必填)
"currentMonthUsedConversationsCountTotal"?: integer // 當月已使用對話數 (非必填)
"availableUploadFilesSizeTotal"?: integer // 可上傳檔案總大小 (非必填)
"usedUploadFileSizeTotal"?: integer // 已使用上傳檔案大小 (非必填)
}
"organizationPlan"?: // 非必填
{
"id"?: string (uuid) // 方案 ID (非必填)
"planName"?: string // 方案名稱 (非必填)
"expiredAt"?: string // 方案到期時間 (非必填)
}
}
"isOwner"?: boolean // 是否為組織擁有者 (非必填)
"permissions"?: // 非必填
{
"hasOrganizationAccessPermission"?: boolean // 是否有組織存取權限 (非必填)
"hasChatAccessPermission"?: boolean // 是否有聊天存取權限 (非必填)
"hasConversationAccessPermission"?: boolean // 是否有對話存取權限 (非必填)
"hasChatbotAccessPermission"?: boolean // 是否有聊天機器人存取權限 (非必填)
"hasWebChatAccessPermission"?: boolean // 是否有網頁聊天存取權限 (非必填)
}
"createdAt"?: string // 成員建立時間戳 (非必填)
}
"createdAt"?: string // 角色成員建立時間戳 (非必填)
}
]
回應範例值
[
{
"id": "c1e54f04-01fc-45e9-b40c-9d8b37bd0ac0",
"member": {
"id": "af4e472d-3f9b-446b-bab8-05de4112d086",
"name": "h",
"email": "[email protected]",
"organization": {
"id": "670e3d30-9d24-47b4-b2cc-6bf224b2f3bb",
"name": "Updated Org Name",
"owner": {
"id": "7e67d5c0-a3b0-4733-b854-21e665061778",
"name": "jessiekuo"
},
"createdAt": "1745288290000",
"usageStatistics": {
"chatbotsCount": 1,
"canCreateChatbot": false,
"hasCreateChatbotLimit": true,
"currentMonthWordsCountTotal": 1000000,
"currentMonthUsedWordsCountTotal": 0,
"currentMonthUsedConversationsCountTotal": 0,
"availableUploadFilesSizeTotal": 104857600,
"usedUploadFileSizeTotal": 0
},
"organizationPlan": {
"id": "16136181-ae0d-4b3f-aaeb-9a6ed251459f",
"planName": "免費方案",
"expiredAt": null
}
},
"isOwner": false,
"permissions": {
"hasOrganizationAccessPermission": true,
"hasChatAccessPermission": false,
"hasConversationAccessPermission": false,
"hasChatbotAccessPermission": false,
"hasWebChatAccessPermission": false
},
"createdAt": "1748335331000"
},
"createdAt": "1748341252000"
}
]
批量分配 AI 助理給角色
POST /api/organizations/{organizationPk}/groups/{groupPk}/group-chatbots/bulk-create/
參數
groupPk
✅
string
organizationPk
✅
string
A UUID string identifying this 組織 ID
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
query
❌
string
請求內容
請求參數
chatbots
array[string]
是
請求結構範例
{
"chatbots": [
string (uuid)
]
}
請求範例值
{
"chatbots": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X POST "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/bulk-create/?page=1&pageSize=1&query=example" \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatbots": [
"550e8400-e29b-41d4-a716-446655440000"
]
}'
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
狀態碼: 201
回應結構範例
{
"count": integer
"next"?: string (uri) // 非必填
"previous"?: string (uri) // 非必填
"results": [
{
"id": string (uuid)
"group": string (uuid)
"chatbot": // Adds nested create feature
{
"id": string (uuid)
"name": string // 機器人的名稱,在 Agent 模式下,有語義意義,其他模式下,只是用來區分不同的機器人
"rag": string (uuid) // RAG (Retrieval-Augmented Generation) 設定,用於增強回答品質
"largeLanguageModel": string (uuid) // 機器人使用的大型語言模型,用於生成回答
"embeddingModel"?: string (uuid) // 用於向量化文本的嵌入模型,非必填項目 (非必填)
"rerankerModel"?: string (uuid) // 非必填
"instructions"?: string // 機器人的角色指令,用於描述機器人的角色和行為 (非必填)
"knowledgeBases"?: [ // 非必填
string (uuid)
]
"updatedAt": string (timestamp)
"organization"?: string (uuid) // 機器人所屬的組織,如果為空則為個人機器人 (非必填)
"builtInWorkflow"?: string (uuid) // 內建工作流程,用於預定義的處理流程 (非必填)
"replyMode"?: object // 回覆模式:一般回覆或串流回覆
* `normal` - 正常
* `template` - 模板
* `hybrid` - 混合
* `workflow` - 工作流
* `agent` - 代理 (非必填)
"template"?: string // 模板模式、混合模式所使用的模板 (非必填)
"unanswerableTemplate"?: string // 模板模式、混合模式無法回答時的模板 (非必填)
"totalWordsCount"?: integer (int64) // 累積的使用總字數 (非必填)
"outputMode"?: object // 輸出模式:文字、表格或自定義格式
* `text` - 文字
* `json_schema` - JSON Schema (非必填)
"rawOutputFormat"?: object // 自定義輸出格式的JSON結構定義 (非必填)
"databaseUrl"?: string // 資料庫連線URL(用於資料庫查詢功能) (非必填)
"databaseType"?: string // 資料庫類型選項,有 MySQL、PostgreSQL、MSSQL、Oracle (非必填)
"includeTables"?: object // 包含的資料表列表(用於資料庫查詢功能) (非必填)
"groups"?: [ // 機器人可存取的群組列表 (非必填)
{
"id": string (uuid)
"name"?: string // 非必填
}
]
"toolkits"?: [ // 機器人使用的工具套件列表 (非必填)
string (uuid)
]
"tools"?: [ // 機器人可使用的工具列表 (非必填)
string (uuid)
]
"agentMode"?: object // 代理模式:一般、SQL或工作流程模式
* `normal` - 正常
* `canvas` - 畫布 (非必填)
}
"createdAt": string (timestamp)
}
]
}
回應範例值
{
"count": 123,
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2",
"results": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"group": "550e8400-e29b-41d4-a716-446655440000",
"chatbot": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"rag": "550e8400-e29b-41d4-a716-446655440000",
"largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
"embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
"rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
"instructions": "response_string",
"knowledgeBases": [
"550e8400-e29b-41d4-a716-446655440000"
],
"updatedAt": "response_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
"replyMode": {},
"template": "response_string",
"unanswerableTemplate": "response_string",
"totalWordsCount": 456,
"outputMode": {},
"rawOutputFormat": null,
"databaseUrl": "response_string",
"databaseType": "response_string",
"includeTables": null,
"groups": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string"
}
],
"toolkits": [
"550e8400-e29b-41d4-a716-446655440000"
],
"tools": [
"550e8400-e29b-41d4-a716-446655440000"
],
"agentMode": {}
},
"createdAt": "response_string"
}
]
}
列出權限清單
GET /api/permissions/
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/permissions/" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
狀態碼: 200
回應結構範例
[
{
"id": string (uuid)
"name": string
"description"?: string // 非必填
}
]
回應範例值
[
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"description": "response_string"
}
]
獲取角色列表
GET /api/organizations/{organizationPk}/groups/
參數
organizationPk
✅
string
A UUID string identifying this 組織 ID
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
query
❌
string
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/?page=1&pageSize=1&query=example" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
狀態碼: 200
回應結構範例
{
"count": integer
"next"?: string (uri) // 非必填
"previous"?: string (uri) // 非必填
"results": [
{
"id": string (uuid)
"name": string
"permissions": [
{
"id": string (uuid)
"name": string
"description"?: string // 非必填
}
]
"createdAt": string (timestamp)
}
]
}
回應範例值
{
"count": 123,
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2",
"results": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"permissions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"description": "response_string"
}
],
"createdAt": "response_string"
}
]
}
獲取角色的詳情
GET /api/organizations/{organizationPk}/groups/{id}/
參數
id
✅
string
A UUID string identifying this 角色.
organizationPk
✅
string
A UUID string identifying this 組織 ID
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
狀態碼: 200
回應結構範例
{
"id": string (uuid)
"name": string
"permissions": [
{
"id": string (uuid)
"name": string
"description"?: string // 非必填
}
]
"createdAt": string (timestamp)
}
回應範例值
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"permissions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"description": "response_string"
}
],
"createdAt": "response_string"
}
獲取角色成員列表
GET /api/organizations/{organizationPk}/groups/{groupPk}/group-members/
參數
groupPk
✅
string
organizationPk
✅
string
A UUID string identifying this 組織 ID
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
query
❌
string
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/?page=1&pageSize=1&query=example" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
狀態碼: 200
回應結構範例
{
"count": integer
"next"?: string (uri) // 非必填
"previous"?: string (uri) // 非必填
"results": [
{
"id": string (uuid)
"member":
{
"id": string (uuid)
"name": string
"email": string
"organization":
{
"id": string (uuid)
"name": string
"owner": object
"createdAt": string (timestamp)
"compactLogo"?: string (uri) // 非必填
"fullLogo"?: string (uri) // 非必填
"usageStatistics": object
"organizationPlan": object
}
"isOwner": boolean
"permissions": object
"createdAt": string (timestamp)
}
"createdAt": string (timestamp)
}
]
}
回應範例值
{
"count": 123,
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2",
"results": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"member": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"email": "response_string",
"organization": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"owner": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string"
},
"createdAt": "response_string",
"compactLogo": "response_string",
"fullLogo": "response_string",
"usageStatistics": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "回應範例名稱",
"description": "回應範例描述"
},
"organizationPlan": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "回應範例名稱",
"description": "回應範例描述"
}
},
"isOwner": false,
"permissions": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "回應範例名稱",
"description": "回應範例描述"
},
"createdAt": "response_string"
},
"createdAt": "response_string"
}
]
}
查看特定角色成員
GET /api/organizations/{organizationPk}/groups/{groupPk}/group-members/{id}/
參數
groupPk
✅
string
id
✅
string
A UUID string identifying this 角色成員.
organizationPk
✅
string
A UUID string identifying this 組織 ID
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/550e8400-e29b-41d4-a716-446655440000/" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
狀態碼: 200
回應結構範例
{
"id": string (uuid)
"member":
{
"id": string (uuid)
"name": string
"email": string
"organization":
{
"id": string (uuid)
"name": string
"owner": object
"createdAt": string (timestamp)
"compactLogo"?: string (uri) // 非必填
"fullLogo"?: string (uri) // 非必填
"usageStatistics": object
"organizationPlan": object
}
"isOwner": boolean
"permissions": object
"createdAt": string (timestamp)
}
"createdAt": string (timestamp)
}
回應範例值
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"member": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"email": "response_string",
"organization": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"owner": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string"
},
"createdAt": "response_string",
"compactLogo": "response_string",
"fullLogo": "response_string",
"usageStatistics": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "回應範例名稱",
"description": "回應範例描述"
},
"organizationPlan": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "回應範例名稱",
"description": "回應範例描述"
}
},
"isOwner": false,
"permissions": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "回應範例名稱",
"description": "回應範例描述"
},
"createdAt": "response_string"
},
"createdAt": "response_string"
}
獲取角色的 AI 助理列表
GET /api/organizations/{organizationPk}/groups/{groupPk}/group-chatbots/
參數
groupPk
✅
string
organizationPk
✅
string
A UUID string identifying this 組織 ID
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
query
❌
string
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/?page=1&pageSize=1&query=example" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
狀態碼: 200
回應結構範例
{
"count": integer
"next"?: string (uri) // 非必填
"previous"?: string (uri) // 非必填
"results": [
{
"id": string (uuid)
"group": string (uuid)
"chatbot": // Adds nested create feature
{
"id": string (uuid)
"name": string // 機器人的名稱,在 Agent 模式下,有語義意義,其他模式下,只是用來區分不同的機器人
"rag": string (uuid) // RAG (Retrieval-Augmented Generation) 設定,用於增強回答品質
"largeLanguageModel": string (uuid) // 機器人使用的大型語言模型,用於生成回答
"embeddingModel"?: string (uuid) // 用於向量化文本的嵌入模型,非必填項目 (非必填)
"rerankerModel"?: string (uuid) // 非必填
"instructions"?: string // 機器人的角色指令,用於描述機器人的角色和行為 (非必填)
"knowledgeBases"?: [ // 非必填
string (uuid)
]
"updatedAt": string (timestamp)
"organization"?: string (uuid) // 機器人所屬的組織,如果為空則為個人機器人 (非必填)
"builtInWorkflow"?: string (uuid) // 內建工作流程,用於預定義的處理流程 (非必填)
"replyMode"?: object // 回覆模式:一般回覆或串流回覆
* `normal` - 正常
* `template` - 模板
* `hybrid` - 混合
* `workflow` - 工作流
* `agent` - 代理 (非必填)
"template"?: string // 模板模式、混合模式所使用的模板 (非必填)
"unanswerableTemplate"?: string // 模板模式、混合模式無法回答時的模板 (非必填)
"totalWordsCount"?: integer (int64) // 累積的使用總字數 (非必填)
"outputMode"?: object // 輸出模式:文字、表格或自定義格式
* `text` - 文字
* `json_schema` - JSON Schema (非必填)
"rawOutputFormat"?: object // 自定義輸出格式的JSON結構定義 (非必填)
"databaseUrl"?: string // 資料庫連線URL(用於資料庫查詢功能) (非必填)
"databaseType"?: string // 資料庫類型選項,有 MySQL、PostgreSQL、MSSQL、Oracle (非必填)
"includeTables"?: object // 包含的資料表列表(用於資料庫查詢功能) (非必填)
"groups"?: [ // 機器人可存取的群組列表 (非必填)
{
"id": string (uuid)
"name"?: string // 非必填
}
]
"toolkits"?: [ // 機器人使用的工具套件列表 (非必填)
string (uuid)
]
"tools"?: [ // 機器人可使用的工具列表 (非必填)
string (uuid)
]
"agentMode"?: object // 代理模式:一般、SQL或工作流程模式
* `normal` - 正常
* `canvas` - 畫布 (非必填)
}
"createdAt": string (timestamp)
}
]
}
回應範例值
{
"count": 123,
"next": "http://api.example.org/accounts/?page=4",
"previous": "http://api.example.org/accounts/?page=2",
"results": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"group": "550e8400-e29b-41d4-a716-446655440000",
"chatbot": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"rag": "550e8400-e29b-41d4-a716-446655440000",
"largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
"embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
"rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
"instructions": "response_string",
"knowledgeBases": [
"550e8400-e29b-41d4-a716-446655440000"
],
"updatedAt": "response_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
"replyMode": {},
"template": "response_string",
"unanswerableTemplate": "response_string",
"totalWordsCount": 456,
"outputMode": {},
"rawOutputFormat": null,
"databaseUrl": "response_string",
"databaseType": "response_string",
"includeTables": null,
"groups": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string"
}
],
"toolkits": [
"550e8400-e29b-41d4-a716-446655440000"
],
"tools": [
"550e8400-e29b-41d4-a716-446655440000"
],
"agentMode": {}
},
"createdAt": "response_string"
}
]
}
更新角色權限
PUT /api/organizations/{organizationPk}/groups/{id}/
參數
id
✅
string
A UUID string identifying this 角色.
organizationPk
✅
string
A UUID string identifying this 組織 ID
請求內容
請求參數
name
string
是
organization
string (uuid)
否
permissions
array[string]
是
請求結構範例
{
"name": string
"organization"?: string (uuid) // 非必填
"permissions": [
string (uuid)
]
}
請求範例值
{
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X PUT "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}'
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
狀態碼: 200
回應結構範例
{
"id": string (uuid)
"name": string
"permissions": [
{
"id": string (uuid)
"name": string
"description"?: string // 非必填
}
]
"createdAt": string (timestamp)
}
回應範例值
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"permissions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"description": "response_string"
}
],
"createdAt": "response_string"
}
部分更新角色權限
PATCH /api/organizations/{organizationPk}/groups/{id}/
參數
id
✅
string
A UUID string identifying this 角色.
organizationPk
✅
string
A UUID string identifying this 組織 ID
請求內容
請求參數
name
string
否
organization
string (uuid)
否
permissions
array[string]
否
請求結構範例
{
"name"?: string // 非必填
"organization"?: string (uuid) // 非必填
"permissions"?: [ // 非必填
string (uuid)
]
}
請求範例值
{
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X PATCH "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/" \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}'
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
狀態碼: 200
回應結構範例
{
"id": string (uuid)
"name": string
"permissions": [
{
"id": string (uuid)
"name": string
"description"?: string // 非必填
}
]
"createdAt": string (timestamp)
}
回應範例值
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"permissions": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"description": "response_string"
}
],
"createdAt": "response_string"
}
刪除角色
DELETE /api/organizations/{organizationPk}/groups/{id}/
參數
id
✅
string
A UUID string identifying this 角色.
organizationPk
✅
string
A UUID string identifying this 組織 ID
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
204
No response body
移除角色成員
DELETE /api/organizations/{organizationPk}/groups/{groupPk}/group-members/{id}/
參數
groupPk
✅
string
id
✅
string
A UUID string identifying this 角色成員.
organizationPk
✅
string
A UUID string identifying this 組織 ID
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/550e8400-e29b-41d4-a716-446655440000/" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
204
No response body
移除角色裡的 AI 助理
DELETE /api/organizations/{organizationPk}/groups/{groupPk}/group-chatbots/{id}/
參數
groupPk
✅
string
id
✅
string
A UUID string identifying this 角色 AI 助理.
organizationPk
✅
string
A UUID string identifying this 組織 ID
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X DELETE "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/550e8400-e29b-41d4-a716-446655440000/" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
回應內容
204
No response body
Last updated
Was this helpful?