組織與成員
帳號註冊
POST /api/v1/auth/registration/
請求內容
請求參數
string (email)
是
password1
string
是
password2
string
是
name
string
是
company
string
是
referralCode
string
否
authSource
object (含 2 個屬性: id, name)
否
authSource.id
string (uuid)
是
請求結構範例
{
"email": string (email)
"password1": string
"password2": string
"name": string
"company": string
"referralCode"?: string // 非必填
"authSource"?: // 非必填
{
"id": string (uuid)
}
}請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
更換密碼
POST /api/v1/auth/password/change/
請求內容
請求參數
oldPassword
string
是
newPassword1
string
是
newPassword2
string
是
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
建立新組織
POST /api/v1/organizations/
請求內容
請求參數
name
string
是
組織名稱
compact_logo
string (binary)
否
簡潔版 Logo(選填,僅企業方案可用)
full_logo
string (binary)
否
完整版 Logo(選填,僅企業方案可用)
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
新增成員至指定組織
POST /api/v1/organizations/{organizationPk}/members/
參數
organizationPk
✅
string
A UUID string identifying this 組織 ID
請求內容
請求參數
string (email)
是
organization
string (uuid)
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
批次匯入成員
POST /api/v1/organizations/{organizationPk}/members/bulk-import/
參數
organizationPk
✅
string
A UUID string identifying this 組織 ID
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
狀態碼: 400 - 驗證錯誤,整份檔案都不會匯入
回應結構範例
回應範例值
取得組織列表
GET /api/v1/organizations/
參數
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
pagination
❌
string
是否分頁 (true/false)
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得特定組織資訊
GET /api/v1/organizations/{id}/
參數
id
✅
string
A UUID string identifying this Organization.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得當前用戶詳細資訊
GET /api/v1/users/current/
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得當前用戶權限
GET /api/v1/permissions/
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得指定組織的成員列表
GET /api/v1/organizations/{organizationPk}/members/
參數
organizationPk
✅
string
A UUID string identifying this 組織 ID
group
❌
string
ids
❌
string
inbox
❌
string
isActive
❌
boolean
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
pagination
❌
string
是否分頁 (true/false)
query
❌
string
search
❌
string
withGroupSources
❌
boolean
為 true 時,`groups` 每個角色只列一次並多回 `sources`(這個角色被指派的方式:manual/ldap/scim/eip/cloudflare_access,去重排序;預設角色是空陣列)。只有分頁的列表支援。
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得特定成員詳細資訊
GET /api/v1/organizations/{organizationPk}/members/{id}/
參數
id
✅
string
A UUID string identifying this Member.
organizationPk
✅
string
A UUID string identifying this 組織 ID
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
更新組織資訊
PUT /api/v1/organizations/{id}/
參數
id
✅
string
A UUID string identifying this Organization.
請求內容
請求參數
name
string
是
compactLogo
string (uri)
否
fullLogo
string (uri)
否
themePrimaryColor
object
否
UI theme color for buttons, links and similar elements (HEX, e.g. #0960bd). Leave blank to fall back to the system brand color.
hideChinaModels
boolean
否
When on, platform models whose developer is based in China (including ones added later) cannot be used in this organization: model menus, assistants, the API and AI Gateway exclude them, and live tran...
autoActivateNewChatbotChannels
boolean
否
Initial state of the web chat and API channels of a new chatbot whose creator did not set them (duplicates, templates and API calls without the values included). When on, they start active; when off (...
companyName
string
否
Applicant-reported company name collected at organization creation for approval review.
taxId
object
否
Applicant-reported business tax ID (8 digits, optional). Stored as-is; not verified.
contactPhone
string
否
Applicant-reported contact phone collected at organization creation for approval review.
applicationMetadata
object
否
Extra applicant-reported key-value fields collected at organization creation. Lets the frontend collect additional review fields without a schema migration; the core review fields (company name, tax I...
invitationCode
string
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
更新當前用戶詳細資訊
PUT /api/v1/users/current/
請求內容
請求參數
avatar
string (uri)
否
originalAvatar
string (uri)
否
The original avatar the user uploaded (long side capped at 2048px). Every edit re-crops from it, so distortion never accumulates from cropping an already cropped result. Empty for data from before thi...
avatarCropBox
object
否
Position and size of the last crop box on the original image (x/y/width/height, optional rotate/scale_x/scale_y); coordinates are relative to the saved original
name
string
是
string (email)
是
company
string
否
invitationCode
object
否
browserPanelCollapsedByDefault
boolean
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
更新成員所屬角色
POST /api/v1/organizations/{organizationPk}/members/{id}/update-groups/
參數
id
✅
string
A UUID string identifying this Member.
organizationPk
✅
string
A UUID string identifying this 組織 ID
請求內容
請求參數
groups
array[string]
是
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
狀態碼: 400
回應結構範例
修改成員名稱
PATCH /api/v1/organizations/{organizationPk}/members/{id}/display-name/
參數
id
✅
string
A UUID string identifying this Member.
organizationPk
✅
string
A UUID string identifying this 組織 ID
請求內容
請求參數
displayName
string
是
New name of the member in this organization. Leading/trailing whitespace is trimmed; an empty or whitespace-only value clears it so the account name is shown again.
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
狀態碼: 400 - 成員由 SCIM 同步管理、名稱超過 255 字,或沒有帶 displayName
回應結構範例
回應範例值
狀態碼: 403 - 呼叫者不是組織擁有者
回應結構範例
回應範例值
狀態碼: 404 - 成員不存在或不屬於本組織
邀請成員加入組織
POST /api/v1/auth/unified-invitations/
請求內容
請求參數
creditQuota
object (含 4 個屬性: quotaLimit, validUntil, resetPeriod...)
否
Optional credit quota allocated to the invitee when they join.
creditQuota.quotaLimit
string (decimal)
是
creditQuota.validUntil
object
否
ISO 8601 date-time or 13-digit epoch milliseconds (string or number).
creditQuota.resetPeriod
object
否
creditQuota.note
string
否
groups
array[IdName]
否
emails
array[string]
是
Email address list to invite. Up to 100 emails.
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
狀態碼: 400 - 請求內容不正確,例如 email 格式錯誤、角色不存在、`creditQuota.validUntil` 格式錯誤或已過期,或組織不是 Credit 計費模式卻帶了 `creditQuota`
狀態碼: 403 - 沒有組織概覽權限、帶了 `creditQuota` 但沒有 Credit 管理權限,或非組織擁有者指定擁有者角色/重新邀請帶擁有者角色的待處理邀請
列出組織邀請信紀錄
GET /api/v1/auth/organization-mail-invitations/
參數
pagination
❌
boolean
是否分頁
status
❌
string
邀請狀態,可多選(例如 status=pending&status=mail_failed);不帶則回傳全部狀態
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
重寄組織邀請信
POST /api/v1/auth/organization-mail-invitations/{id}/resend/
參數
id
✅
string
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
列出組織的 API Key
GET /api/v1/organizations/{organizationPk}/api-keys/
參數
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
source
❌
string
status
❌
string
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
狀態碼: 403 - 權限不足
替成員簽發 API Key
POST /api/v1/organizations/{organizationPk}/api-keys/
參數
organizationPk
✅
string
A UUID string identifying this 組織 ID
請求內容
請求參數
name
string
是
expiryDate
string (timestamp)
否
memberId
string (uuid)
是
isActive
boolean
否
creditBudgetDaily
string (decimal)
否
creditBudgetMonthly
string (decimal)
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
狀態碼: 400 - 驗證錯誤(例如:名稱空白、到期日已過)
狀態碼: 403 - 權限不足
取得特定 API Key
GET /api/v1/organizations/{organizationPk}/api-keys/{id}/
參數
id
✅
string
organizationPk
✅
string
A UUID string identifying this 組織 ID
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
更新 API Key 設定
PATCH /api/v1/organizations/{organizationPk}/api-keys/{id}/
參數
id
✅
string
organizationPk
✅
string
A UUID string identifying this 組織 ID
請求內容
請求參數
name
string
否
A free-form name for the API key. Need not be unique. 50 characters max.
isActive
boolean
否
Reversible enable switch. A disabled key is rejected exactly like an unknown key (generic 401, no information leak), but keeps its secret and usage history and can be re-enabled at any time — unlike t...
rateLimitRpm
integer
否
Max requests per minute across every platform API this key can call. Null = unlimited.
rateLimitTpm
integer
否
Max LLM tokens per minute through the AI Gateway inference endpoints. Null = unlimited.
creditBudgetDaily
string (decimal)
否
Max credits this key may spend through the AI Gateway per natural day (Asia/Taipei). Once reached, further inference calls are refused with 402 key_budget_exceeded until the next day. Null = unlimited...
creditBudgetMonthly
string (decimal)
否
Max credits this key may spend through the AI Gateway per calendar month (Asia/Taipei). Once reached, further inference calls are refused with 402 key_budget_exceeded until the next month. Null = unli...
expiryDate
string (timestamp)
否
Once API key expires, clients cannot use it anymore.
lastUsedAt
string (timestamp)
否
revokedAt
string (timestamp)
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
撤銷 API Key
DELETE /api/v1/organizations/{organizationPk}/api-keys/{id}/
參數
id
✅
string
organizationPk
✅
string
A UUID string identifying this 組織 ID
程式碼範例
回應內容
204
API Key 撤銷成功
400
API Key 已被撤銷
403
權限不足
404
找不到 API Key
查詢 API Key 所屬組織
GET /api/v1/users/api-key-context/
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
狀態碼: 401 - 缺少或無效的 API Key,或使用非 API Key 憑證
換發成員嵌入 token
POST /api/v1/members/embed-tokens/
請求內容
請求參數
string (email)
否
memberId
string (uuid)
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
狀態碼: 400 - email 與 memberId 必須且只能提供其中一個
狀態碼: 401 - 未以 Api-Key 認證
狀態碼: 403 - API Key 持有者不是組織擁有者也沒有組織管理權限
狀態碼: 404 - 指定的成員不存在、已停用或不屬於本組織
列出 OAuth 應用程式
GET /api/v1/oauth/applications/
參數
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
註冊 OAuth 應用程式
POST /api/v1/oauth/applications/
請求內容
請求參數
name
string
是
clientType
object
否
redirectUris
array[string]
是
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 201
回應結構範例
回應範例值
取得特定 OAuth 應用程式
GET /api/v1/oauth/applications/{id}/
參數
id
✅
string
A UUID string identifying this MaiAgent OAuth application.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
更新 OAuth 應用程式
PATCH /api/v1/oauth/applications/{id}/
參數
id
✅
string
A UUID string identifying this MaiAgent OAuth application.
請求內容
請求參數
name
string
否
redirectUris
array[string]
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
刪除 OAuth 應用程式並撤銷其 token
DELETE /api/v1/oauth/applications/{id}/
參數
id
✅
string
A UUID string identifying this MaiAgent OAuth application.
程式碼範例
回應內容
204
No response body
重新產生 client secret
POST /api/v1/oauth/applications/{id}/regenerate-secret/
參數
id
✅
string
A UUID string identifying this MaiAgent OAuth application.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
列出我授權過的 OAuth 應用程式
GET /api/v1/oauth/authorized-applications/
參數
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
撤銷我對某應用程式的授權
DELETE /api/v1/oauth/authorized-applications/{id}/
參數
id
✅
string
程式碼範例
回應內容
204
No response body
刪除組織
DELETE /api/v1/organizations/{id}/
參數
id
✅
string
A UUID string identifying this Organization.
程式碼範例
回應內容
204
No response body
刪除指定成員
DELETE /api/v1/organizations/{organizationPk}/members/{id}/
參數
id
✅
string
A UUID string identifying this Member.
organizationPk
✅
string
A UUID string identifying this 組織 ID
程式碼範例
回應內容
204
No response body
取得成員使用統計
GET /api/v1/organizations/{organizationPk}/usage-statistics/members/
參數
organizationPk
✅
string
A UUID string identifying this 組織 ID
chatbot
❌
string
篩選特定 AI 助理 ID
chatbotId
❌
string
endDate
❌
string
結束日期,格式: YYYY-MM-DD
includeTime
❌
boolean
是否返回只按時間聚合的時間序列資料,用於趨勢圖表(true/false)。設為 true 時,回應不包含實體資訊,只有時間欄位和統計數值,且不分頁。
memberId
❌
string
page
❌
integer
頁碼
pageSize
❌
integer
每頁筆數
search
❌
string
搜尋成員 ID、名稱或 Email
sortBy
❌
string
排序欄位
sortOrder
❌
string
排序方式 (asc/desc)
startDate
✅
string
開始日期,格式: YYYY-MM-DD
timeGranularity
❌
string
時間粒度 (hour/day/month)
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得成員使用統計摘要
GET /api/v1/organizations/{organizationPk}/usage-statistics/members/summary/
參數
organizationPk
✅
string
A UUID string identifying this 組織 ID
endDate
❌
string
結束日期,格式: YYYY-MM-DD
startDate
✅
string
開始日期,格式: YYYY-MM-DD
timeGranularity
❌
string
時間粒度 (hour/day/month)
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得 AI 助理使用統計
GET /api/v1/organizations/{organizationPk}/usage-statistics/chatbots/
參數
organizationPk
✅
string
A UUID string identifying this 組織 ID
chatbotId
❌
string
endDate
❌
string
結束日期,格式: YYYY-MM-DD
includeTime
❌
boolean
是否返回只按時間聚合的時間序列資料,用於趨勢圖表(true/false)。設為 true 時,回應不包含實體資訊,只有時間欄位和統計數值,且不分頁。
page
❌
integer
頁碼
pageSize
❌
integer
每頁筆數
search
❌
string
搜尋 AI 助理 ID 或名稱
sortBy
❌
string
排序欄位
sortOrder
❌
string
排序方式 (asc/desc)
startDate
✅
string
開始日期,格式: YYYY-MM-DD
timeGranularity
❌
string
時間粒度 (hour/day/month)
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
取得 AI 助理使用統計摘要
GET /api/v1/organizations/{organizationPk}/usage-statistics/chatbots/summary/
參數
organizationPk
✅
string
A UUID string identifying this 組織 ID
endDate
❌
string
結束日期,格式: YYYY-MM-DD
startDate
✅
string
開始日期,格式: YYYY-MM-DD
timeGranularity
❌
string
時間粒度 (hour/day/month)
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
列出自己的記憶
GET /api/v1/me/memories/
參數
kind
❌
string
`fact`: Fact ; `preference`: Preference ; `instruction`: Instruction ; `summary`: Summary ; `profile`: Profile;
page
❌
integer
A page number within the paginated result set.
pageSize
❌
integer
Number of results to return per page.
status
❌
string
`pending`: Pending ; `active`: Active ; `rejected`: Rejected ; `expired`: Expired;
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
狀態碼: 4XX - Error response; X-Error-Code carries its code (see "Error codes").
建立或更新自己的記憶
POST /api/v1/me/memories/
請求內容
請求參數
topic
string
是
category
string (enum: personal_info, work_role, projects, communication, response_format, tools_tech, interests, health_lifestyle, schedule_plans, other)
否
personal_info: Personal Info ; work_role: Work and Role ; projects: Projects and Work ; communication: Communication Preferences ; response_format: Response Format Preferences ; tools_tech...
summary
string
是
details
array[string]
是
kind
object
否
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
狀態碼: 201
回應結構範例
回應範例值
狀態碼: 4XX - Error response; X-Error-Code carries its code (see "Error codes").
修改或重新啟用自己的記憶
PATCH /api/v1/me/memories/{id}/
參數
id
✅
string
A UUID string identifying this Memory Entry.
請求內容
請求參數
topic
string
否
category
string (enum: personal_info, work_role, projects, communication, response_format, tools_tech, interests, health_lifestyle, schedule_plans, other)
否
personal_info: Personal Info ; work_role: Work and Role ; projects: Projects and Work ; communication: Communication Preferences ; response_format: Response Format Preferences ; tools_tech...
summary
string
否
details
array[string]
否
status
string (enum: active, expired)
否
active: active ; expired: expired;
請求結構範例
請求範例值
程式碼範例
回應內容
狀態碼: 200
回應結構範例
回應範例值
狀態碼: 4XX - Error response; X-Error-Code carries its code (see "Error codes").
刪除自己的記憶
DELETE /api/v1/me/memories/{id}/
參數
id
✅
string
A UUID string identifying this Memory Entry.
程式碼範例
回應內容
204
No response body
4XX
Error response; X-Error-Code carries its code (see "Error codes").
最後更新於
這有幫助嗎?