角色與權限
創建角色
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 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
}
};
// 請求內容 (payload)
const data = {
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
};
axios.post("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/", data, config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
# 請求內容 (payload)
data = {
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
response = requests.post(url, json=data, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->post("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY',
'Content-Type' => 'application/json'
],
'json' => {
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
狀態碼: 201
回應結構範例
{
"id": string (uuid)
"name": string
}
回應範例值
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"permissions": [
"613c86f7-a45f-4e29-b255-29caf899e320"
],
"createdAt": "1740636953000"
}
列出權限清單
GET /api/permissions/
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/permissions/" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
axios.get("https://api.maiagent.ai/api/permissions/", config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/permissions/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->get("https://api.maiagent.ai/api/permissions/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
狀態碼: 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.
程式碼範例
# 呼叫 API 示例 (Shell)
curl -X GET "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/?page=1&pageSize=1" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
axios.get("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/?page=1&pageSize=1", config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/?page=1&pageSize=1"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->get("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/?page=1&pageSize=1", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
狀態碼: 200
回應結構範例
{
"count": integer
"next"?: string (uri) // 非必填
"previous"?: string (uri) // 非必填
"results": [
{
"id": string (uuid),
"name": string,
"description": "string"
}
],
"createdAt": "string"
}
回應範例值
{
"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",
"description": "response_string"
},
"createdAt": "1743064363000"
]
}
獲取角色的詳情
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 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
axios.get("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->get("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
狀態碼: 200
回應結構範例
{
"id": string (uuid)
"name": string,
"permissions": [
{
"id"?: string (uuid), // 非必填
"name"?: string (uuid), // 非必填
"description"?:string (uuid)" // 非必填
}
],
"createdAt": "string"
}
回應範例值
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"permissions": [
{
"id": "aeb30cc3-2760-42f7-8820-da7afab04383",
"name": "AI 助理權限",
"description": "控制 admin 頁面上是否可以看到並操作「AI 助理」分頁"
},
{
"id": "d27af70a-8913-453d-bedd-816f779d435c",
"name": "對話平台權限",
"description": "控制 admin 頁面上是否可以看到並操作「對話平台」分頁"
},
{
"id": "26e2890e-548a-46ed-96f0-135f51b5609c",
"name": "所有對話權限",
"description": "控制 admin 頁面上是否可以看到並操作「所有對話」分頁"
},
{
"id": "19f4c0d8-e363-4a4e-8d71-91f83a23a2c2",
"name": "內部問答權限",
"description": "控制 admin 頁面上是否可以看到並操作「內部問答」分頁"
},
{
"id": "08b22382-2291-4f6a-be63-1758516346c0",
"name": "組織設定權限",
"description": "控制 admin 頁面上是否可以看到並操作「組織設定」分頁"
}
],
"createdAt": "1740636953000"
}
更新角色權限
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 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
}
};
// 請求內容 (payload)
const data = {
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
};
axios.put("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", data, config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
# 請求內容 (payload)
data = {
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
response = requests.put(url, json=data, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->put("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY',
'Content-Type' => 'application/json'
],
'json' => {
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
狀態碼: 200
回應結構範例
{
"id": string (uuid)
"name": string,
"permissions": [
{
"id"?: string (uuid), // 非必填
"name"?: string (uuid), // 非必填
"description"?:string (uuid)" // 非必填
}
],
"createdAt": "string"
}
回應範例值
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"permissions": [
{
"id": "aeb30cc3-2760-42f7-8820-da7afab04383",
"name": "AI 助理權限",
"description": "控制 admin 頁面上是否可以看到並操作「AI 助理」分頁"
},
{
"id": "d27af70a-8913-453d-bedd-816f779d435c",
"name": "對話平台權限",
"description": "控制 admin 頁面上是否可以看到並操作「對話平台」分頁"
},
{
"id": "26e2890e-548a-46ed-96f0-135f51b5609c",
"name": "所有對話權限",
"description": "控制 admin 頁面上是否可以看到並操作「所有對話」分頁"
},
{
"id": "19f4c0d8-e363-4a4e-8d71-91f83a23a2c2",
"name": "內部問答權限",
"description": "控制 admin 頁面上是否可以看到並操作「內部問答」分頁"
},
{
"id": "08b22382-2291-4f6a-be63-1758516346c0",
"name": "組織設定權限",
"description": "控制 admin 頁面上是否可以看到並操作「組織設定」分頁"
}
],
"createdAt": "1740636953000"
}
部分更新角色權限
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 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
}
};
// 請求內容 (payload)
const data = {
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
};
axios.patch("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", data, config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
# 請求內容 (payload)
data = {
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
response = requests.patch(url, json=data, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->patch("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY',
'Content-Type' => 'application/json'
],
'json' => {
"name": "request_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"permissions": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
狀態碼: 200
回應結構範例
{
"id": string (uuid)
"name": string,
"permissions": [
string (uuid)" // 非必填
],
"createdAt": "string"
}
回應範例值
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"permissions": [
"aeb30cc3-2760-42f7-8820-da7afab04383",
],
"createdAt": "1740636953000"
}
刪除角色
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 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
// 請求內容 (payload)
const data = null;
axios.delete("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", data, config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.delete(url, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->delete("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
204
No response body
批量新增角色成員
POST /api/organizations/{organizationPk}/groups/{groupPk}/group-members/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.
請求內容
請求參數
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/?page=1&pageSize=1" \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"members": [
"550e8400-e29b-41d4-a716-446655440000"
]
}'
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
}
};
// 請求內容 (payload)
const data = {
"members": [
"550e8400-e29b-41d4-a716-446655440000"
]
};
axios.post("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/bulk-create/?page=1&pageSize=1", data, config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/bulk-create/?page=1&pageSize=1"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
# 請求內容 (payload)
data = {
"members": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
response = requests.post(url, json=data, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->post("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/bulk-create/?page=1&pageSize=1", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY',
'Content-Type' => 'application/json'
],
'json' => {
"members": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
201
此 API 成功執行後返回空對象 {}
獲取角色成員列表
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.
程式碼範例
# 呼叫 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" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
axios.get("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/?page=1&pageSize=1", config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/?page=1&pageSize=1"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->get("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/?page=1&pageSize=1", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
狀態碼: 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)
"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",
"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 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
axios.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/", config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/550e8400-e29b-41d4-a716-446655440000/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->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/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
狀態碼: 200
回應結構範例
{
"id": string (uuid)
"member":
{
"id": string (uuid)
"name": string
"email": string
"organization":
{
"id": string (uuid)
"name": string
"owner": object
"createdAt": string (timestamp)
"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",
"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"
}
移除角色成員
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 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
// 請求內容 (payload)
const data = null;
axios.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/", data, config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-members/550e8400-e29b-41d4-a716-446655440000/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.delete(url, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->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/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
204
No response body
批量分配 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.
請求內容
請求參數
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" \
-H "Authorization: Api-Key YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"chatbots": [
"550e8400-e29b-41d4-a716-446655440000"
]
}'
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY',
'Content-Type': 'application/json'
}
};
// 請求內容 (payload)
const data = {
"chatbots": [
"550e8400-e29b-41d4-a716-446655440000"
]
};
axios.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", data, config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "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"
headers = {
"Authorization": "Api-Key YOUR_API_KEY",
"Content-Type": "application/json"
}
# 請求內容 (payload)
data = {
"chatbots": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
response = requests.post(url, json=data, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->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", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY',
'Content-Type' => 'application/json'
],
'json' => {
"chatbots": [
"550e8400-e29b-41d4-a716-446655440000"
]
}
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
狀態碼: 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
"largeLanguageModel": string (uuid)
"rag": string (uuid)
"embeddingModel"?: string (uuid) // 非必填
"rerankerModel"?: string (uuid) // 非必填
"instructions"?: string // 非必填
"updatedAt": string (timestamp)
"organization"?: string (uuid) // 非必填
"builtInWorkflow"?: string (uuid) // 非必填
"replyMode"?: object // 非必填
"template"?: string // 非必填
"unanswerableTemplate"?: string // 非必填
"totalWordsCount"?: integer (int64) // 累積的使用總字數 (非必填)
"enableChineseConversion"?: boolean // 非必填
"outputMode"?: object // 非必填
"outputFormat"?: object // 非必填
"databaseUrl"?: string // 非必填
"databaseType"?: string // 非必填
"groups"?: [ // 非必填
{
"id": string (uuid)
"name": 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",
"group": "550e8400-e29b-41d4-a716-446655440000",
"chatbot": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
"rag": "550e8400-e29b-41d4-a716-446655440000",
"embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
"rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
"instructions": "response_string",
"updatedAt": "response_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
"replyMode": {},
"template": "response_string",
"unanswerableTemplate": "response_string",
"totalWordsCount": 456,
"enableChineseConversion": false,
"outputMode": {},
"outputFormat": null,
"databaseUrl": "response_string",
"databaseType": "response_string",
"groups": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "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.
程式碼範例
# 呼叫 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" \
-H "Authorization: Api-Key YOUR_API_KEY"
# 請確認在執行前替換 YOUR_API_KEY 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
axios.get("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/?page=1&pageSize=1", config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/?page=1&pageSize=1"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.get(url, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->get("https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/?page=1&pageSize=1", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
狀態碼: 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
"largeLanguageModel": string (uuid)
"rag": string (uuid)
"embeddingModel"?: string (uuid) // 非必填
"rerankerModel"?: string (uuid) // 非必填
"instructions"?: string // 非必填
"updatedAt": string (timestamp)
"organization"?: string (uuid) // 非必填
"builtInWorkflow"?: string (uuid) // 非必填
"replyMode"?: object // 非必填
"template"?: string // 非必填
"unanswerableTemplate"?: string // 非必填
"totalWordsCount"?: integer (int64) // 累積的使用總字數 (非必填)
"enableChineseConversion"?: boolean // 非必填
"outputMode"?: object // 非必填
"outputFormat"?: object // 非必填
"databaseUrl"?: string // 非必填
"databaseType"?: string // 非必填
"groups"?: [ // 非必填
{
"id": string (uuid)
"name": 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",
"group": "550e8400-e29b-41d4-a716-446655440000",
"chatbot": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string",
"largeLanguageModel": "550e8400-e29b-41d4-a716-446655440000",
"rag": "550e8400-e29b-41d4-a716-446655440000",
"embeddingModel": "550e8400-e29b-41d4-a716-446655440000",
"rerankerModel": "550e8400-e29b-41d4-a716-446655440000",
"instructions": "response_string",
"updatedAt": "response_string",
"organization": "550e8400-e29b-41d4-a716-446655440000",
"builtInWorkflow": "550e8400-e29b-41d4-a716-446655440000",
"replyMode": {},
"template": "response_string",
"unanswerableTemplate": "response_string",
"totalWordsCount": 456,
"enableChineseConversion": false,
"outputMode": {},
"outputFormat": null,
"databaseUrl": "response_string",
"databaseType": "response_string",
"groups": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "response_string"
}
]
},
"createdAt": "response_string"
}
]
}
移除角色裡的 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 並核對請求資料。
const axios = require('axios');
// 設定請求標頭
const config = {
headers: {
'Authorization': 'Api-Key YOUR_API_KEY'
}
};
// 請求內容 (payload)
const data = null;
axios.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/", data, config)
.then(response => {
console.log('成功取得回應:');
console.log(response.data);
})
.catch(error => {
console.error('請求發生錯誤:');
console.error(error.response?.data || error.message);
});
import requests
url = "https://api.maiagent.ai/api/organizations/550e8400-e29b-41d4-a716-446655440000/groups/550e8400-e29b-41d4-a716-446655440000/group-chatbots/550e8400-e29b-41d4-a716-446655440000/"
headers = {
"Authorization": "Api-Key YOUR_API_KEY"
}
response = requests.delete(url, headers=headers)
try:
print("成功取得回應:")
print(response.json())
except Exception as e:
print("請求發生錯誤:", e)
<?php
require 'vendor/autoload.php';
$client = new GuzzleHttp\Client();
try {
$response = $client->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/", [
'headers' => [
'Authorization' => 'Api-Key YOUR_API_KEY'
]
]);
$data = json_decode($response->getBody(), true);
echo "成功取得回應:\n";
print_r($data);
} catch (Exception $e) {
echo '請求發生錯誤: ' . $e->getMessage();
}
?>
回應內容
204
No response body
Last updated
Was this helpful?