Skip to content

OpenAPI ​

OpenAPI turns WinNexo's frontend capabilities into an "AI capability plugin" for your existing systems. This complete API reference explains authentication and general conventions, then provides overview tables and each endpoint's path, request parameters, response parameters, and examples, organized by capability area.

See the Public Cloud OpenAPI documentation.

How It Works ​

mermaid
graph LR
    A[你的业务系统] -->|HTTP 请求 + AccessToken| B[WinNexo OpenAPI 网关]
    B --> C[会话能力]
    B --> D[快捷技能]
    B --> E[我的资源]
    B --> F[企业知识库]
    B --> I[定时任务]
    B --> J[用户与组织]
    C --> G[数字员工]
    D --> G
    E --> H[产出/资源]
    F --> H

Every call requires an identity credential (Authorization: Bearer <AccessToken>). See the "Authentication" section below for credential types.

Authentication & General Conventions ​

Gateway Address ​

  • All endpoints share a common prefix: /openapi
  • Full URL format: https://<gateway-domain>/openapi/<接口路径>
  • <gateway-domain> is the gateway domain of your deployment. Contact your administrator to obtain it.

AccessToken Types ​

All endpoints authenticate via the Authorization: Bearer <AccessToken> header, handled uniformly by require_openapi_identity. Three token types are supported:

Token TypePrefixDescriptionUse Case
User API Tokenwn_Personal identity credential representing a specific userPersonal scripts, IDE plugins, CLI login
Deployment Tokenwn_dpl_Deployment-level credential, requires tenant/user infoServer-side integration, backend batch processing
Encrypted Token@ENCRYPT__Credential delivered as encrypted stringSpecific hosted/encrypted delivery scenarios

To obtain and manage a user API Token, see UserToken in Personal Settings.

Tenant ID ​

  • Single-tenant users: Tenant is inferred automatically; no explicit input needed.
  • Multi-tenant users: Must explicitly specify the tenant using one of:
    • Query parameter: tenantId or tenant_id
    • Request header: X-Tenant-Id
  • Returns ERR.Auth.TenantIdRequired if unspecified and cannot be inferred.

Request Conventions ​

  • HTTP Methods: Write operations default to POST; read-only queries may use GET (some deletions use DELETE). Refer to each endpoint's "Endpoint Info" section.
  • Required Headers:
    • Authorization: Bearer <AccessToken>
    • Content-Type: application/json
  • Optional Headers:
    • X-Tenant-Id: Specify tenant for multi-tenant scenarios
    • X-Timezone: Specify timezone (e.g., Asia/Shanghai), affects time-related fields
  • Field Naming: Request/response fields use camelCase uniformly.
  • Prohibited Fields: Do not include tenantId / tenant_id or userId / user_id in request bodies — these are derived automatically by the auth chain. Explicit values will be ignored or cause errors.

Response Conventions ​

All endpoints return a POP gateway-compatible format: top-level fixed fields Code / Message / RequestId, with business fields expanded flat (no nested data wrapper).

Success Response:

json
{
  "Code": "200",
  "Message": "success",
  "RequestId": "req-xxx",
  "businessField": "value"
}

Error Response:

json
{
  "Code": "ERR.User.NotFound",
  "Message": "用户不存在",
  "RequestId": "req-xxx",
  "error_type": "USER_ERROR",
  "solution": "请检查用户ID是否正确"
}

Multi-Language Call Examples ​

Using createPersonalFile as an example to demonstrate calling conventions in various languages. For other endpoints, simply replace the path and request body.

cURL:

bash
curl -X POST "https://<gateway-domain>/openapi/createPersonalFile" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{
    "operatingObjectName": "my-agent",
    "name": "周报.md",
    "filePath": "https://oss.example.com/xxx/周报.md"
  }'

Python (requests):

python
import requests

resp = requests.post(
    "https://<gateway-domain>/openapi/createPersonalFile",
    headers={
        "Authorization": "Bearer <AccessToken>",
        "Content-Type": "application/json",
    },
    json={
        "operatingObjectName": "my-agent",
        "name": "周报.md",
        "filePath": "https://oss.example.com/xxx/周报.md",
    },
)
print(resp.json())

Java (OkHttp):

java
OkHttpClient client = new OkHttpClient();
MediaType JSON = MediaType.parse("application/json");
String body = "{\"operatingObjectName\":\"my-agent\",\"name\":\"周报.md\",\"filePath\":\"https://oss.example.com/xxx/周报.md\"}";
Request request = new Request.Builder()
    .url("https://<gateway-domain>/openapi/createPersonalFile")
    .addHeader("Authorization", "Bearer <AccessToken>")
    .post(RequestBody.create(body, JSON))
    .build();
try (Response response = client.newCall(request).execute()) {
    System.out.println(response.body().string());
}

Go (net/http):

go
payload := strings.NewReader(`{"operatingObjectName":"my-agent","name":"周报.md","filePath":"https://oss.example.com/xxx/周报.md"}`)
req, _ := http.NewRequest("POST", "https://<gateway-domain>/openapi/createPersonalFile", payload)
req.Header.Set("Authorization", "Bearer <AccessToken>")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
data, _ := io.ReadAll(resp.Body)
fmt.Println(string(data))

Node.js (fetch):

javascript
const resp = await fetch("https://<gateway-domain>/openapi/createPersonalFile", {
  method: "POST",
  headers: {
    Authorization: "Bearer <AccessToken>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    operatingObjectName: "my-agent",
    name: "周报.md",
    filePath: "https://oss.example.com/xxx/周报.md",
  }),
});
console.log(await resp.json());

Common Error Codes ​

Error CodeMeaningSuggested Action
ERR.Auth.UnsupportedAuthTypeUnsupported auth typeCheck token prefix and Authorization header format
ERR.Auth.TenantIdRequiredTenant not specified and cannot be inferredPass tenantId or X-Tenant-Id for multi-tenant scenarios
ERR.Auth.TenantAccessDeniedNo access to the specified tenantConfirm the current user belongs to the target tenant
ERR.User.NotFoundUser not foundCheck if the user identifier is correct
ERR.Resource.NotFoundResource not foundCheck if the resource ID is correct or if it has been deleted
ERR.Robject.UserDirectory.NotAuthorizedNo directory access permissionConfirm the Digital Worker has visibility/operation permission on the target directory
ERR.System.ErrorInternal system errorContact administrator with RequestId for investigation

Notes ​

  • Idempotent calls: Write endpoints accept a clientToken (caller-generated) for idempotency identification.
  • Digital Worker context: Most resource/knowledge/object endpoints require operatingObjectName (Digital Worker name, i.e., operating object name) to determine the operation context and permission scope.
  • Large file uploads: Large files use OSS direct upload — first call getSourceUploadSignature to get a signed URL, upload directly, then register the resource. Small files in chat can use uploadChatFile for backend direct upload.
  • Async task polling: runSkill returns a runId; poll execution status and results via getSkillRun.
  • Version compatibility: New capabilities are backward-compatible; call paths remain unchanged, and historical endpoints continue to work.

Endpoint Overview ​

A total of 82 endpoints, organized by capability domain.

System & Instance (2) ​

EndpointMethodPathDescription
checkHealthGET/openapi/checkHealthHealth check and auth probe
getInstanceExpireTimeGET/openapi/getInstanceExpireTimeGet instance expiration time

Chat (7) ​

EndpointMethodPathDescription
sendChatMessagePOST/openapi/v1/chatMessagesSend a chat message
getChatSessionGET/openapi/v1/chatSessionGet chat session details
listChatSessionsGET/openapi/v1/chatSession/listList chat sessions
updateChatSessionPOST/openapi/v1/chatSession/updateUpdate chat session info
stopChatSessionPOST/openapi/v1/chatSession/stopStop chat generation
deleteChatSessionDELETE/openapi/v1/chatSession/deleteDelete a chat session
uploadChatFilePOST/openapi/v1/uploadChatFileUpload a chat file

Quick Skills (4) ​

EndpointMethodPathDescription
listSkillsPOST/openapi/listSkillsList skills
getSkillPOST/openapi/getSkillGet skill details
runSkillPOST/openapi/runSkillRun a skill asynchronously
getSkillRunPOST/openapi/getSkillRunGet async skill run result

My Resources (19) ​

EndpointMethodPathDescription
createPersonalFilePOST/openapi/createPersonalFileCreate a personal file resource
createPersonalTextPOST/openapi/createPersonalTextCreate a personal text note
createPersonalVoiceMeetingPOST/openapi/createPersonalVoiceMeetingCreate a personal voice meeting record
createPersonalDingtalkMeetingPOST/openapi/createPersonalDingtalkMeetingCreate a personal DingTalk meeting record
createPersonalAliDingMeetingPOST/openapi/createPersonalAliDingMeetingCreate a personal AliDing meeting record
createPersonalAliDingDocPOST/openapi/createPersonalAliDingDocCreate a personal AliDing document resource
createPersonalAliDingKnowledgeBasePOST/openapi/createPersonalAliDingKnowledgeBaseCreate a personal AliDing knowledge base resource
createPersonalFeishuMinutePOST/openapi/createPersonalFeishuMinuteCreate a personal Feishu Minutes resource
createPersonalDirectoryPOST/openapi/createPersonalDirectoryCreate a personal resource directory
listPersonalDirectoryContentsPOST/openapi/listPersonalDirectoryContentsDrill down into personal resource directory contents
getSourcePOST/openapi/getSourceGet resource details
getSourceUploadSignaturePOST/openapi/getSourceUploadSignatureGet resource upload signature
moveResourcePOST/openapi/moveResourceMove a personal resource
renameSourcePOST/openapi/renameSourceRename a personal resource
updateDirectoryPOST/openapi/updateDirectoryUpdate a personal resource directory
retryDirectoryFailedSourcesPOST/openapi/retryDirectoryFailedSourcesRetry failed resources in a directory
previewPersonalSourcePOST/openapi/previewPersonalSourcePreview a personal resource
listOutputFilesPOST/openapi/listOutputFilesList current user's outputs
saveOutputFileToResourcePOST/openapi/saveOutputFileToResourceBatch save outputs as personal resources

Knowledge Base (16) ​

EndpointMethodPathDescription
listVisibleKnowledgeBasesPOST/openapi/listVisibleKnowledgeBasesList knowledge bases visible to a Digital Worker
listVisibleKnowledgeBaseContentsPOST/openapi/listVisibleKnowledgeBaseContentsDrill down into visible knowledge base directory contents
listAdminKnowledgeBasesPOST/openapi/listAdminKnowledgeBasesAdmin list/drill-down knowledge bases
submitSourceToKnowledgeBasePOST/openapi/submitSourceToKnowledgeBaseSubmit personal resource to knowledge base
createKnowledgeBaseFilePOST/openapi/createKnowledgeBaseFileCreate a knowledge base file resource
createKnowledgeBaseTextPOST/openapi/createKnowledgeBaseTextCreate a knowledge base text resource
createKnowledgeBaseAliDingDocPOST/openapi/createKnowledgeBaseAliDingDocCreate a knowledge base AliDing document resource
createKnowledgeBaseDirectoryPOST/openapi/createKnowledgeBaseDirectoryCreate a knowledge base directory
getKnowledgeBaseSourcePOST/openapi/getKnowledgeBaseSourceGet knowledge base resource details
listKnowledgeBaseDirectoriesPOST/openapi/listKnowledgeBaseDirectoriesList knowledge base directories
updateKnowledgeBaseDirectoryPOST/openapi/updateKnowledgeBaseDirectoryUpdate a knowledge base directory
moveKnowledgeBaseResourcePOST/openapi/moveKnowledgeBaseResourceMove a knowledge base resource
renameKnowledgeBaseSourcePOST/openapi/renameKnowledgeBaseSourceRename a knowledge base resource
updateKnowledgeBaseSourceTagsPOST/openapi/updateKnowledgeBaseSourceTagsUpdate knowledge base resource tags
retryKnowledgeBaseFailedSourcesPOST/openapi/retryKnowledgeBaseFailedSourcesRetry failed resources in knowledge base
previewKnowledgeBaseSourcePOST/openapi/previewKnowledgeBaseSourcePreview a knowledge base resource

Scheduled Tasks (8) ​

EndpointMethodPathDescription
createScheduledTaskPOST/openapi/createScheduledTaskCreate a scheduled task
updateScheduledTaskPOST/openapi/updateScheduledTaskUpdate a scheduled task
listScheduledTasksPOST/openapi/listScheduledTasksList scheduled tasks
executeScheduledTaskPOST/openapi/executeScheduledTaskExecute a scheduled task immediately
getScheduledTaskExecutionDetailPOST/openapi/getScheduledTaskExecutionDetailGet scheduled task execution details
getScheduledTaskExecutionRecordsPOST/openapi/getScheduledTaskExecutionRecordsGet scheduled task execution records
getScheduledTaskPushOptionsPOST/openapi/getScheduledTaskPushOptionsGet scheduled task push options
getScheduledTaskUnderstandDetailPOST/openapi/getScheduledTaskUnderstandDetailGet scheduled task understanding details

Primary Object Data (3) ​

EndpointMethodPathDescription
queryPrimaryObjectDataPOST/openapi/queryPrimaryObjectDataPaginated query of primary object data
togglePrimaryObjectFavoritePOST/openapi/togglePrimaryObjectFavoriteFollow/unfollow a primary object
replaceObjectBindingsPOST/openapi/replaceObjectBindingsReplace object bindings

User, Credit & Billing (4) ​

EndpointMethodPathDescription
getUserInfoGET/openapi/getUserInfoGet current user info
updateUserInfoPOST/openapi/updateUserInfoUpdate current user info
getUserCreditUsagePOST/openapi/getUserCreditUsageGet user Credit usage
listBillingPOST/openapi/listBillingList billing records

User & Permission Management (15) ​

EndpointMethodPathDescription
createUserPOST/openapi/createUserCreate a user
updateUserPOST/openapi/updateUserUpdate a user
getUserPOST/openapi/getUserGet user details
listUsersPOST/openapi/listUsersList users
removeUserPOST/openapi/removeUserRemove a user
resetPasswordPOST/openapi/resetPasswordReset user password
getTokenInfoPOST/openapi/getTokenInfoGet Token info
enableTokenPOST/openapi/enableTokenEnable user Token
disableTokenPOST/openapi/disableTokenDisable user Token
resetTokenPOST/openapi/resetTokenReset user Token
grantAgentUsersPOST/openapi/grantAgentUsersGrant Digital Worker user permissions
revokeAgentUsersPOST/openapi/revokeAgentUsersRevoke Digital Worker user permissions
listAuthorizedAgentsPOST/openapi/listAuthorizedAgentsList authorized Digital Workers
listAuthorizedUsersPOST/openapi/listAuthorizedUsersList authorized users
updateAgentAuthModePOST/openapi/updateAgentAuthModeUpdate Digital Worker auth mode

Organization Sync (4) ​

EndpointMethodPathDescription
createCustomOrgPOST/openapi/createCustomOrgCreate a custom organization
syncOrgStructurePOST/openapi/syncOrgStructureSync organization structure
querySyncResultPOST/openapi/querySyncResultQuery organization sync result
listAvailableConfigsPOST/openapi/listAvailableConfigsList available org sync configurations

System & Instance ​

checkHealth · Health Check & Auth Probe ​

OpenAPI entry health check. Can be used to verify whether authentication is working and inspect the current caller/tenant/Digital Worker in effect.

GET /openapi/checkHealth

Request: No request body parameters.

Response fields:

FieldTypeDescription
callerTypestrCaller type: user / aliyun_main / aliyun_ram / service
authSourcestrAuth source: bearer / aliyun_gateway
userIdintPlatform user ID
tenantIdintActive tenant ID
digitalEmployeeNamestrDigital Worker name in effect for the current request (operating object); empty if none specified and tenant has no Digital Workers
bash
curl -X GET "https://<gateway-domain>/openapi/checkHealth" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json"

getInstanceExpireTime · Query Tenant Standard Package Instance Expiration ​

Query the tenant standard package instance expiration time via OpenAPI.

POST /openapi/getInstanceExpireTime

Request: No request body parameters.

Response fields:

FieldTypeDescription
tenantIdintSystem tenant ID
instanceIdstrInstance ID
instanceExpireTimestrInstance expiration time (ISO format)
instanceStatusstrInstance status
foundboolWhether a standard package instance was found
bash
curl -X POST "https://<gateway-domain>/openapi/getInstanceExpireTime" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{}'

Chat ​

sendChatMessage · Send a Chat Message ​

Send a message to a chat session. Creates a new session if no sessionId is provided.

POST /openapi/v1/chatMessages

Request fields:

FieldTypeRequiredDescription
contentstr✅User message body
contentTypestr❌Message type: Text / Markdown (default Text)
sessionIdstr❌Session ID; creates a new session if omitted
digitalEmployeeNamestr❌Digital Worker name
fileslist[FileRef]❌File reference list
streambool❌Whether to stream response (default True)
reuseLastSessionbool❌When no sessionId is provided, whether to reuse the Digital Worker's most recent session (default False)

Response: Returns only the generic wrapper fields {"Code":"200","Message":"success","RequestId":"req-xxx"} (streaming content is delivered via the stream channel).

bash
curl -X POST "https://<gateway-domain>/openapi/v1/chatMessages" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"content":"帮我总结上周客户拜访","stream":true}'

getChatSession · Get Chat Session Details ​

Get details of a single chat session via OpenAPI.

GET /openapi/v1/chatSession

Query parameters:

ParameterTypeRequiredDescription
sessionIdstring❌Session ID

Response fields:

FieldTypeDescription
sessionConversationInfoSession information
messageslist[ConversationMessageInfo]Recent messages list
bash
curl -X GET "https://<gateway-domain>/openapi/v1/chatSession?sessionId=<sessionId>" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json"

listChatSessions · List Chat Sessions ​

OpenAPI chat session list endpoint.

GET /openapi/v1/chatSession/list

Query parameters:

ParameterTypeRequiredDescription
tenant_idstring❌Tenant ID
page_sizestring❌Page size
pagestring❌Page number
keywordstring❌Keyword
digital_employee_namestring❌Digital Worker name

Response fields:

FieldTypeDescription
datalist[ConversationInfo]Session list
totalintTotal count matching criteria
pageintCurrent page number
pageSizeintPage size
hasMoreboolWhether more data is available
bash
curl -X GET "https://<gateway-domain>/openapi/v1/chatSession/list?page=1&page_size=20" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json"

updateChatSession · Update Chat Session Info ​

Update chat session title and other information.

POST /openapi/v1/chatSession/update

Request fields:

FieldTypeRequiredDescription
sessionIdstr❌Session ID
titlestr❌New session title

Response fields:

FieldTypeDescription
sessionConversationInfoUpdated session information
bash
curl -X POST "https://<gateway-domain>/openapi/v1/chatSession/update" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sessionId":"12345","title":"客户拜访总结"}'

stopChatSession · Stop Chat Generation ​

Stop the reply currently being generated for a specified session.

POST /openapi/v1/chatSession/stop

Query parameters:

ParameterTypeRequiredDescription
sessionIdstring❌Session ID

Request fields:

FieldTypeRequiredDescription
Reasonstr❌Stop reason (for auditing)

Response fields:

FieldTypeDescription
sessionIdstrSession ID
messageIdstrID of the stopped message
statusstrFinal message status
finishReasonstrFinish reason
partialContentstrPartially generated content
bash
curl -X POST "https://<gateway-domain>/openapi/v1/chatSession/stop?sessionId=12345" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"Reason":"用户主动取消"}'

deleteChatSession · Delete a Chat Session ​

OpenAPI delete chat session endpoint.

DELETE /openapi/v1/chatSession/delete

Query parameters:

ParameterTypeRequiredDescription
sessionIdstring❌Session ID

Response fields:

FieldTypeDescription
sessionIdstrSession ID
deletedboolWhether deletion was successful
hardDeleteboolWhether it was a hard delete
bash
curl -X DELETE "https://<gateway-domain>/openapi/v1/chatSession/delete?sessionId=<sessionId>" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json"

uploadChatFile · Upload Chat File ​

Backend direct upload endpoint for chat scenario files.

POST /openapi/v1/uploadChatFile

Request: No request body parameters (file uploaded via multipart form).

Response fields:

FieldTypeDescription
objectNamestrOSS object path
fileUrlstrFile remote_url (stored path)
filePublicUrlstrFile public access URL (valid for 1 hour)
uploadSignatureUrlstrSigned upload URL (empty for this endpoint as it's backend direct upload)
fileRecordIdstrFile record ID
contentTypestrFile MIME type
fileNamestrFile name
bash
curl -X POST "https://<gateway-domain>/openapi/v1/uploadChatFile" \
  -H "Authorization: Bearer <AccessToken>" \
  -F "file=@/path/to/local/file.pdf"

Quick Skills ​

listSkills · List Skills ​

OpenAPI skill list query.

POST /openapi/listSkills

Request fields:

FieldTypeRequiredDescription
filterTypestr❌Filter type: ALL / BUILTIN / CUSTOM / DRAFT / ALL_WITH_DRAFTS (default ALL)
tagslist[str]❌Filter by tags; matches if any tag hits
keywordstr❌Keyword search; fuzzy matches name or description
pageint❌Page number (default 1)
pageSizeint❌Page size, 1-100 (default 20)
operatingObjectNamestr❌Digital Worker name; must be provided together with bindStatus
bindStatusstr❌Binding status: BOUND / UNBOUND; must be provided together with operatingObjectName

Response fields:

FieldTypeDescription
itemslist[OpenAPISkillItem]Skill list
totalintTotal count of matching skills
pageintCurrent page number
pageSizeintPage size
bash
curl -X POST "https://<gateway-domain>/openapi/listSkills" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"filterType":"BUILTIN","page":1,"pageSize":20}'

getSkill · Get Skill Details ​

OpenAPI skill detail query.

POST /openapi/getSkill

Request fields:

FieldTypeRequiredDescription
skillCodestr❌Skill code (globally unique); takes priority over skillName
skillNamestr❌Skill name; used when skillCode is not provided; must be unique within tenant
viewModestr❌View mode: draft / published (default)
includeSkillFilesbool❌Whether to return the full file tree (default false)

Response fields (excerpt):

FieldTypeDescription
skillHubDefinitionIdintSkill definition ID
skillCodestrSkill code (globally unique)
namestrSkill name (i18n-resolved)
displayNamestrDisplay name
descriptionstrSkill description
tagslist[str]Tag list
sourceTypestrSource type: BUILTIN / CUSTOM
globalAccessboolWhether globally accessible
executeModestrExecution mode
inputConfigstrInput configuration raw text
inputConfigFormattedlist[dict]Structured input schema array
detailLogicstrDetailed skill logic
skillMdSummarystrSKILL.md summary
versionNumberstrVersion number
versionCountintTotal version count
statusstrSkill status: ACTIVE / DRAFT
hasDraftChangesboolWhether unpublished draft changes exist
createdTimestrCreation time ISO8601
updatedTimestrModification time ISO8601
argumentslist[ArgumentSchema]Simplified parameter schema describing what runSkill.arguments needs
skillFileslist[dict]Skill file nested tree (only when includeSkillFiles=True)
bash
curl -X POST "https://<gateway-domain>/openapi/getSkill" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"skillCode":"skill-abc","viewMode":"published"}'

runSkill · Run Skill Asynchronously ​

Submit a skill for async execution. Returns a runId for subsequent polling via getSkillRun.

POST /openapi/runSkill

Request fields:

FieldTypeRequiredDescription
skillCodestr❌Skill code (globally unique); takes priority over skillName
skillNamestr❌Skill name; used when skillCode is not provided; must be unique within tenant
argumentsdict[str, Any]❌Skill input parameter dictionary; schema described by getSkill's arguments field
clientTokenstr❌Idempotency token, caller-generated (current version only records to metadata)

Response fields:

FieldTypeDescription
runIdstrAsync task ID for getSkillRun queries
skillCodestrSkill code actually executed
skillNamestrSkill name
statusstrTask status: returns Running on submission
createdAtstrTask creation time, ISO8601 UTC format
bash
curl -X POST "https://<gateway-domain>/openapi/runSkill" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"skillName":"客户摘要","arguments":{"customer_id":"C-2026-0612"}}'

getSkillRun · Get Async Skill Run Result ​

OpenAPI async skill execution result query entry.

POST /openapi/getSkillRun

Request fields:

FieldTypeRequiredDescription
runIdstr❌Async task ID returned by runSkill
includeLogsbool❌Whether to include execution logs (default false)

Response fields:

FieldTypeDescription
runIdstrAsync task ID
skillCodestrSkill code
skillNamestrSkill name
statusstrExecution status: Running / Succeeded / Failed / Cancelled
progressintProgress percentage (meaningful only during Running)
progressMessagestrProgress description
resultdict[str, Any]Execution result; returned only on Succeeded; contains content list
usagedict[str, Any]LLM token usage statistics; returned only on Succeeded
logslist[dict[str, Any]]Execution log list (only when includeLogs=true)
errorCodestrError code; returned only on Failed
errorMessagestrError description; returned only on Failed
createdAtstrTask creation time ISO8601
startedAtstrTask start time ISO8601
finishedAtstrTask end time ISO8601; only available in terminal states
bash
curl -X POST "https://<gateway-domain>/openapi/getSkillRun" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"runId":"run_123","includeLogs":false}'

My Resources ​

createPersonalFile · Upload File to My Resources ​

Upload a file to the current Digital Worker's "My Resources".

POST /openapi/createPersonalFile

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)
namestr✅Resource display name
filePathstr✅File OSS persistent address
filePublicUrlstr❌File public access URL (signed)
fileNamestr❌Original file name (with extension)
fileExtstr❌File extension (e.g., pdf, docx)
fileRecordIdstr❌File record ID
directoryIdstr❌Target directory ID
descriptionstr❌Resource description

Response fields:

FieldTypeDescription
sourceIdstrNew resource ID
namestrResource display name
statusstrResource status
scopestrResource scope, fixed as PERSONAL
directoryIdstrBound directory ID
gmtCreatestrCreation time ISO8601
bash
curl -X POST "https://<gateway-domain>/openapi/createPersonalFile" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent","name":"合同.pdf","filePath":"oss://bucket/path/to/file.pdf"}'

createPersonalText · Upload Plain Text to My Resources ​

Upload plain text to the current Digital Worker's "My Resources".

POST /openapi/createPersonalText

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)
namestr✅Resource display name
textContentstr✅Plain text body
directoryIdstr❌Target directory ID
descriptionstr❌Resource description

Response fields:

FieldTypeDescription
sourceIdstrNew resource ID
namestrResource display name
statusstrResource status (initially PENDING; FAILED on failure)
scopestrResource scope, fixed as PERSONAL
directoryIdstrBound directory ID
gmtCreatestrCreation time ISO8601
bash
curl -X POST "https://<gateway-domain>/openapi/createPersonalText" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent","name":"备忘","textContent":"这是一段小记正文"}'

createPersonalVoiceMeeting · Upload Offline Meeting to My Resources ​

Upload offline meeting audio to the current Digital Worker's "My Resources".

POST /openapi/createPersonalVoiceMeeting

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)
namestr✅Resource display name
fileUrlstr✅Offline meeting audio file URL
directoryIdstr❌Target directory ID
descriptionstr❌Resource description

Response fields:

FieldTypeDescription
sourceIdstrNew resource ID
namestrResource display name
statusstrResource status (initially PENDING; FAILED on failure)
scopestrResource scope, fixed as PERSONAL
directoryIdstrBound directory ID
gmtCreatestrCreation time ISO8601
bash
curl -X POST "https://<gateway-domain>/openapi/createPersonalVoiceMeeting" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent","name":"客户拜访录音","fileUrl":"https://oss.example.com/a.mp3"}'

createPersonalDingtalkMeeting · Upload DingTalk Meeting to My Resources ​

Upload a DingTalk meeting to the current Digital Worker's "My Resources".

POST /openapi/createPersonalDingtalkMeeting

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)
namestr✅Resource display name
roomCodestr✅DingTalk meeting room code
credentialIdstr❌Credential ID (uses system default if not provided)
directoryIdstr❌Target directory ID
descriptionstr❌Resource description
notesstr❌Meeting notes content, used for supplementary analysis

Response fields:

FieldTypeDescription
sourceIdstrNew resource ID
namestrResource display name
statusstrResource status
scopestrResource scope, fixed as PERSONAL
directoryIdstrBound directory ID
gmtCreatestrCreation time ISO8601
bash
curl -X POST "https://<gateway-domain>/openapi/createPersonalDingtalkMeeting" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent","name":"客户会议","roomCode":"1234567890"}'

createPersonalAliDingMeeting · Upload AliDing Meeting to My Resources ​

Upload an AliDing meeting to the current Digital Worker's "My Resources".

POST /openapi/createPersonalAliDingMeeting

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)
namestr✅Resource display name
ossUrlstr✅Public audio/video OSS address
shanjiUrlstr✅Original Shanji link
directoryIdstr❌Target directory ID
descriptionstr❌Resource description
notesstr❌Meeting notes content, used for supplementary analysis

Response fields:

FieldTypeDescription
sourceIdstrNew resource ID
namestrResource display name
statusstrResource status
scopestrResource scope, fixed as PERSONAL
directoryIdstrBound directory ID
gmtCreatestrCreation time ISO8601
bash
curl -X POST "https://<gateway-domain>/openapi/createPersonalAliDingMeeting" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent","name":"周会","ossUrl":"https://oss.example.com/a.mp4","shanjiUrl":"https://shanji.example.com/x"}'

createPersonalAliDingDoc · Upload AliDing Online Document to My Resources ​

Upload an AliDing online document to the current Digital Worker's "My Resources".

POST /openapi/createPersonalAliDingDoc

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)
namestr✅Resource display name (recommended to use DingTalk document title)
filePublicUrlstr✅AliDing online document public access URL
directoryIdstr❌Target directory ID
descriptionstr❌Resource description

Response fields:

FieldTypeDescription
sourceIdstrNew resource ID
namestrResource display name
statusstrResource status (initially PENDING; FAILED on on_create failure)
scopestrResource scope, fixed as PERSONAL
directoryIdstrBound directory ID (null when using default root directory)
filePublicUrlstrDocument public URL (echoed from input)
gmtCreatestrCreation time ISO8601
bash
curl -X POST "https://<gateway-domain>/openapi/createPersonalAliDingDoc" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent","name":"产品方案","filePublicUrl":"https://doc.example.com/x"}'

createPersonalAliDingKnowledgeBase · Create AliDing Knowledge Base in My Resources ​

Create an AliDing knowledge base in the current Digital Worker's "My Resources".

POST /openapi/createPersonalAliDingKnowledgeBase

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)
kbUrlstr✅AliDing knowledge base public access URL
kbNamestr❌Knowledge base display name; auto-filled from remote root node name if omitted
directoryIdstr❌Target directory ID
objectBindingslist[ObjectBinding]❌Multi-value object binding list; written to KB metadata, passed through to child sources during sync
syncConfigSyncConfig❌Scheduled sync configuration; treated as disabled if omitted

Response fields:

FieldTypeDescription
directoryIdstrNew knowledge base root directory ID
namestrKnowledge base display name
statusstrRoot directory status (RUNNING after creation; transitions to READY or FAILED after sync)
kbUrlstrKnowledge base URL (echoed from input)
operatingObjectNamestrOwner Digital Worker name (echoed from input)
gmtCreatestrCreation time ISO8601
bash
curl -X POST "https://<gateway-domain>/openapi/createPersonalAliDingKnowledgeBase" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent","kbUrl":"https://kb.example.com/x"}'

createPersonalFeishuMinute · Upload Feishu Minutes Meeting to My Resources ​

Upload a Feishu Minutes meeting to the current Digital Worker's "My Resources".

POST /openapi/createPersonalFeishuMinute

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)
namestr✅Resource display name
minuteTokenstr✅Feishu Minutes token (unique identifier)
credentialIdstr✅Credential ID (linked to rbj_credential table)
directoryIdstr❌Target directory ID
descriptionstr❌Resource description

Response fields:

FieldTypeDescription
sourceIdstrNew resource ID
namestrResource display name
statusstrResource status
scopestrResource scope, fixed as PERSONAL
directoryIdstrBound directory ID
gmtCreatestrCreation time ISO8601
bash
curl -X POST "https://<gateway-domain>/openapi/createPersonalFeishuMinute" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent","name":"周会纪要","minuteToken":"minute_xxx","credentialId":"cred_1"}'

createPersonalDirectory · Create Personal Directory in My Resources ​

Create a personal directory (category) under "My Resources".

POST /openapi/createPersonalDirectory

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)
namestr✅Directory name
parentDirectoryIdstr❌Parent directory ID
descriptionstr❌Directory description

Response fields:

FieldTypeDescription
directoryIdstrNew directory ID
namestrDirectory name
pathstrFull directory path (auto-calculated)
descriptionstrDirectory description
parentDirectoryIdstrParent directory ID (returns backfilled ID when default root directory is used)
operatingObjectNamestrOwner Digital Worker name
directoryKindstrDirectory KB type: normal / aliding_kb_root / aliding_kb_internal
gmtCreateintCreation timestamp (milliseconds)
gmtModifiedintModification timestamp (milliseconds)
bash
curl -X POST "https://<gateway-domain>/openapi/createPersonalDirectory" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent","name":"合同模板"}'

listPersonalDirectoryContents · Drill Down Personal Resource Directory Contents ​

Drill down to query subdirectories and resources under a "My Resources" directory.

POST /openapi/listPersonalDirectoryContents

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)
directoryIdstr✅Directory ID
pageint❌Page number (default 1)
pageSizeint❌Page size, 1-100 (default 20)
sortFieldstr❌Sort field: name / gmt_create / gmt_modified (default name)
sortOrderstr❌Sort direction: asc / desc (default asc)
sourceTypeslist[str]❌Resource type filter

Response fields:

FieldTypeDescription
itemslist[PersonalDirectoryContentItem]Unified paginated list of directory contents (subdirectories + resources)
totalintTotal count (before pagination)
pageintCurrent page number
pageSizeintPage size
bash
curl -X POST "https://<gateway-domain>/openapi/listPersonalDirectoryContents" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent","directoryId":"dir_1"}'

getSource · Get Data Source Details ​

OpenAPI data source detail query.

POST /openapi/getSource

Request fields:

FieldTypeRequiredDescription
sourceIdstr❌Data source ID (unique within tenant)
includeDetailsbool❌Whether to return details (default false)

Response fields:

FieldTypeDescription
sourceIdstrData source ID
sourceTypestrData source type
sourceKindstrData source kind: normal / aliding_kb_doc
namestrData source name
descriptionstrData source description
statusstrData source status
scopestrVisibility scope: PERSONAL / TENANT
objectTypestrPrimary object type (compatibility field)
objectIdstrPrimary object ID (compatibility field)
operatingObjectNamestrOperating object name
objectBindingslist[ObjectBindingItem]Multi-value object binding list
skillOutputIdstrSkill output ID
sourceTagsstrResource tags JSON string
hasSettingsboolWhether settings configuration exists
hasNotesboolWhether notes exist
hasStructuredTablesboolWhether structured tables exist
hasUnstructuredDocsboolWhether unstructured documents exist
gmtCreatestrCreation time ISO8601
gmtModifiedstrModification time ISO8601
settingsdictData source configuration (only when includeDetails=True)
notesstrNotes (only when includeDetails=True)
structuredTableslist[str]Structured table name list (only when includeDetails=True)
unstructuredDocslist[UnstructuredDocItem]Unstructured document details (only when includeDetails=True; excludes content)
bash
curl -X POST "https://<gateway-domain>/openapi/getSource" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sourceId":"src_1234567890","includeDetails":true}'

getSourceUploadSignature · Get Data Source File OSS Direct Upload Signature URL ​

Get an OSS direct upload signature URL for data source files, used for large file uploads.

POST /openapi/getSourceUploadSignature

Request fields:

FieldTypeRequiredDescription
filenamestr✅File name (with extension, e.g., report.pdf)
operatingObjectNamestr❌Agent namespace identifier (Digital Worker name)
expiresint❌Signature URL expiration time (seconds), default 3600
contentTypestr❌File Content-Type (auto-inferred if not provided)
scopestr❌Ownership scope: source (personal, maps to PERSONAL) / knowledge (enterprise KB, maps to TENANT)

Response fields:

FieldTypeDescription
objectNamestrOSS object name
fileUrlstrFile OSS internal URL
filePublicUrlstrFile public access URL
uploadSignatureUrlstrSigned upload URL (PUT method)
fileRecordIdstrFile record ID
methodstrUpload HTTP method (fixed as PUT)
expiresInintSignature URL validity duration (seconds)
contentTypestrFile Content-Type
bash
curl -X POST "https://<gateway-domain>/openapi/getSourceUploadSignature" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"filename":"report.pdf","scope":"source"}'

moveResource · Move Resource Between Personal Directories ​

Move a resource between personal directories.

POST /openapi/moveResource

Request fields:

FieldTypeRequiredDescription
sourceDirectoryIdstr✅Source directory ID (current personal directory of the resource)
targetDirectoryIdstr✅Target directory ID (personal directory to move the resource to)
sourceIdstr✅ID of the resource to move

Response fields:

FieldTypeDescription
successboolWhether the move was successful
sourceIdstrResource ID (echoed from input)
sourceDirectoryIdstrSource directory ID (echoed from input)
targetDirectoryIdstrTarget directory ID (echoed from input)
bash
curl -X POST "https://<gateway-domain>/openapi/moveResource" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sourceDirectoryId":"dir_1","targetDirectoryId":"dir_2","sourceId":"src_1"}'

renameSource · Rename Data Source ​

Rename a data source (lightweight operation).

POST /openapi/renameSource

Request fields:

FieldTypeRequiredDescription
sourceIdstr✅Data source ID (unique within tenant)
newNamestr✅New data source name

Response fields:

FieldTypeDescription
sourceIdstrData source ID
namestrRenamed data source name
statusstrData source status
gmtModifiedstrLast modification time, ISO8601 format
bash
curl -X POST "https://<gateway-domain>/openapi/renameSource" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sourceId":"src_1234567890","newName":"客户合同-最终版"}'

updateDirectory · Update Personal Directory ​

Update personal directory basic information.

POST /openapi/updateDirectory

Request fields:

FieldTypeRequiredDescription
directoryIdstr✅Directory unique identifier (business ID, not primary key ID)
namestr❌New directory name; omit to skip update
descriptionstr❌New directory description; omit to skip update
parentIdint❌New parent directory primary key ID; omit to skip update
pathstr❌New directory path; cascades update to current directory and all subdirectories

Response fields:

FieldTypeDescription
successboolWhether update was successful
directoryIdstrDirectory unique identifier (echoed from input)
bash
curl -X POST "https://<gateway-domain>/openapi/updateDirectory" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"directoryId":"dir_1234567890","name":"客户资料"}'

retryDirectoryFailedSources · Retry Failed Data Sources in Personal Directory ​

Get failed data sources in a personal directory and batch retry (recursively includes subdirectories).

POST /openapi/retryDirectoryFailedSources

Request fields:

FieldTypeRequiredDescription
directoryIdstr✅Directory ID (recursively includes failed resources in subdirectories)

Response fields:

FieldTypeDescription
directoryIdstrDirectory ID
failedCountintTotal failed resources in the directory
enqueuedCountintNumber successfully enqueued for retry
skippedCountintNumber skipped (not FAILED or no permission)
enqueuedIdslist[str]List of source_ids successfully enqueued
failedSourceslist[FailedSourceItem]List of failed data sources detected in the directory
bash
curl -X POST "https://<gateway-domain>/openapi/retryDirectoryFailedSources" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"directoryId":"dir_1234567890"}'

previewPersonalSource · Preview Personal Knowledge ​

Preview the content of a specific resource in the personal knowledge base (only allows previewing own resources, PERSONAL type directories).

POST /openapi/previewPersonalSource

Request fields:

FieldTypeRequiredDescription
sourceIdstr✅Resource ID (data source unique identifier)

Response fields:

FieldTypeDescription
previewTypestrPreview type: OSS_IMM / IMAGE / AUDIO / VIDEO / HTML / DING_TALK / VOICE_MEETING / CONTENT
previewUrlstrPreview URL (used for OSS_IMM, DING_TALK, VOICE_MEETING)
contentstrText content (used for CONTENT type)
fileNamestrFile name (used for OSS_IMM type)
fileExtstrFile extension (used for OSS_IMM type)
publicUrlstrPublic download URL
bash
curl -X POST "https://<gateway-domain>/openapi/previewPersonalSource" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sourceId":"src_123"}'

listOutputFiles · List Current User's Outputs ​

List the current user's outputs.

POST /openapi/listOutputFiles

Request: No request body parameters.

Response fields:

FieldTypeDescription
itemslist[ListOutputFilesRecord]Output list
totalintTotal count of matching outputs
pageintCurrent page number
pageSizeintPage size
bash
curl -X POST "https://<gateway-domain>/openapi/listOutputFiles" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{}'

saveOutputFileToResource · Batch Save Outputs as Personal Resources ​

Batch save output items as personal resources (link reference or copy).

POST /openapi/saveOutputFileToResource

Request fields:

FieldTypeRequiredDescription
itemIdslist[str]❌Output item ID list, max 50 per batch
modeLiteral["link","copy"]❌Save mode: link — link reference, copy — copy into storage
directoryIdstr❌Target personal directory ID

Response fields:

FieldTypeDescription
resultslist[SaveOutputFileToResourceItem]Per-item results, same order as input itemIds; individual failures don't affect others
bash
curl -X POST "https://<gateway-domain>/openapi/saveOutputFileToResource" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"itemIds":["item_1"],"mode":"link","directoryId":"dir_1"}'

Knowledge Base ​

listVisibleKnowledgeBases · List Knowledge Bases Visible to a Digital Worker ​

Query the top-level enterprise knowledge base directories visible to a Digital Worker.

POST /openapi/listVisibleKnowledgeBases

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)

Response fields:

FieldTypeDescription
itemslist[VisibleKnowledgeBaseItem]Top-level enterprise knowledge base directories visible to the Digital Worker
totalintCount returned (not paginated)
bash
curl -X POST "https://<gateway-domain>/openapi/listVisibleKnowledgeBases" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent"}'

listVisibleKnowledgeBaseContents · Drill Down Visible Knowledge Base Directory Contents ​

Drill down to query subdirectories and resources under a knowledge base directory visible to a Digital Worker.

POST /openapi/listVisibleKnowledgeBaseContents

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name (operating object name)
directoryIdstr✅Directory ID (required, must be within the Digital Worker's linked_directories and subdirectories scope)
pageint❌Page number (default 1)
pageSizeint❌Page size, 1-100 (default 20)
sortFieldstr❌Sort field: name / gmt_create / gmt_modified (default name)
sortOrderstr❌Sort direction: asc / desc (default asc)
sourceTypeslist[str]❌Resource type filter (when provided, only returns resources)

Response fields:

FieldTypeDescription
itemslist[VisibleKnowledgeBaseContentItem]Unified paginated list of directory contents
totalintTotal count (before pagination)
pageintCurrent page number
pageSizeintPage size
bash
curl -X POST "https://<gateway-domain>/openapi/listVisibleKnowledgeBaseContents" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"my-agent","directoryId":"dir_1"}'

listAdminKnowledgeBases · Admin List/Drill-Down Knowledge Bases ​

Admin enterprise knowledge base list / drill-down query.

POST /openapi/listAdminKnowledgeBases

Request fields:

FieldTypeRequiredDescription
directoryIdstr❌Directory ID (provide when drilling down)
pageint❌Page number (default 1)
pageSizeint❌Page size, 1-100 (default 20)
sortFieldstr❌Sort field: name / gmtCreate / gmtModified (default name)
sortOrderstr❌Sort direction: asc / desc (default asc)
keywordstr❌Search keyword; only effective when directoryId is empty/root
sourceTypeslist[str]❌Resource type filter; only effective when drilling down

Response fields:

FieldTypeDescription
itemslist[AdminKnowledgeBaseItem]Content list (KB list: directories only; drill-down: directories + resources)
totalintTotal count matching criteria
pageintCurrent page number
pageSizeintPage size
bash
curl -X POST "https://<gateway-domain>/openapi/listAdminKnowledgeBases" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"page":1,"pageSize":20,"sortField":"name","sortOrder":"asc"}'

submitSourceToKnowledgeBase · Submit Personal Resource to Knowledge Base ​

Submit a personal resource to the enterprise knowledge base (tenant directory).

POST /openapi/submitSourceToKnowledgeBase

Request fields:

FieldTypeRequiredDescription
sourceIdstr✅Personal resource ID to submit (must be scope=PERSONAL and current user is creator)
targetDirectoryIdstr✅Target enterprise knowledge base directory ID (must be TENANT type directory)

Response fields:

FieldTypeDescription
sourceIdstrResource ID (unchanged after migration)
scopestrResource scope after submission, fixed as TENANT on success
targetDirectoryIdstrTarget enterprise knowledge base directory ID the resource is now bound to
bash
curl -X POST "https://<gateway-domain>/openapi/submitSourceToKnowledgeBase" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sourceId":"src_1234567890","targetDirectoryId":"dir_1234567890"}'

createKnowledgeBaseFile · Upload File to Knowledge Base ​

Upload a file to the enterprise knowledge base (requires KB management permission).

POST /openapi/createKnowledgeBaseFile

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr❌Digital Worker name (operating object name)
namestr✅Resource display name
filePathstr✅File OSS persistent address
filePublicUrlstr❌File public access URL (signed)
fileNamestr❌Original file name (with extension)
fileExtstr❌File extension (e.g., pdf, docx)
fileRecordIdstr❌File record ID
directoryIdstr❌Target category ID
descriptionstr❌Resource description
knowledgeIdstr❌Knowledge base ID
sourceTagsstr❌Resource tags (JSON string list)

Response fields:

FieldTypeDescription
sourceIdstrNew resource ID
namestrResource display name
statusstrResource status
scopestrResource scope, fixed as TENANT
directoryIdstrBound directory ID
gmtCreatestrCreation time ISO8601
bash
curl -X POST "https://<gateway-domain>/openapi/createKnowledgeBaseFile" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"name":"合同模板.pdf","filePath":"oss://bucket/path/to/file.pdf","directoryId":"dir_1"}'

createKnowledgeBaseText · Upload Plain Text to Knowledge Base ​

Upload plain text to the enterprise knowledge base (requires KB management permission).

POST /openapi/createKnowledgeBaseText

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr❌Digital Worker name
namestr✅Resource display name
textContentstr✅Plain text body
directoryIdstr❌Target category ID
descriptionstr❌Resource description
knowledgeIdstr❌Knowledge base ID
sourceTagsstr❌Resource tags (JSON string list)

Response fields: sourceId / name / status / scope(TENANT) / directoryId / gmtCreate (same as createKnowledgeBaseFile).

bash
curl -X POST "https://<gateway-domain>/openapi/createKnowledgeBaseText" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"name":"客户服务规范","textContent":"一、服务原则...","directoryId":"dir_1"}'

createKnowledgeBaseAliDingDoc · Upload AliDing Online Document to Knowledge Base ​

Upload an AliDing online document to the enterprise knowledge base (requires KB management permission).

POST /openapi/createKnowledgeBaseAliDingDoc

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr❌Digital Worker name
namestr✅Resource display name (recommended to use DingTalk document title)
filePublicUrlstr✅AliDing online document public access URL
directoryIdstr❌Target category ID
descriptionstr❌Resource description
knowledgeIdstr❌Knowledge base ID
sourceTagsstr❌Resource tags (JSON string list)

Response fields: sourceId / name / status / scope(TENANT) / directoryId / filePublicUrl / gmtCreate.

bash
curl -X POST "https://<gateway-domain>/openapi/createKnowledgeBaseAliDingDoc" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"name":"产品需求文档","filePublicUrl":"https://alidocs.dingtalk.com/i/xxx","directoryId":"dir_1"}'

createKnowledgeBaseDirectory · Create Knowledge Base Category ​

Create a knowledge base category (tenant directory, requires KB management permission).

POST /openapi/createKnowledgeBaseDirectory

Request fields:

FieldTypeRequiredDescription
namestr✅Category name (enterprise knowledge base directory name)
parentDirectoryIdstr❌Parent category ID; placed under tenant root if omitted
descriptionstr❌Category description

Response fields:

FieldTypeDescription
directoryIdstrNew category ID
namestrCategory name
pathstrFull category path (auto-calculated)
descriptionstrCategory description
parentDirectoryIdstrParent category ID; returns null when placed under root
directoryKindstrDirectory KB type: normal / aliding_kb_root / aliding_kb_internal
gmtCreateintCreation timestamp (milliseconds)
gmtModifiedintModification timestamp (milliseconds)
bash
curl -X POST "https://<gateway-domain>/openapi/createKnowledgeBaseDirectory" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"name":"合同模板","description":"各类标准合同"}'

getKnowledgeBaseSource · Get Knowledge Base Resource Details ​

Get details of a specific resource in the enterprise knowledge base (requires KB view permission).

POST /openapi/getKnowledgeBaseSource

Request fields:

FieldTypeRequiredDescription
sourceIdstr❌Resource ID (data source unique identifier)

Response fields:

FieldTypeDescription
sourceIdstrResource ID
sourceTypestrResource type (TEXT / FILE / ONLINE_DOC, etc.)
namestrResource name
descriptionstrResource description
statusstrProcessing status (READY / RUNNING / FAILED, etc.)
statusMessagestrStatus additional info (e.g., failure reason)
sourceKindstrResource KB type: aliding_kb_doc / normal
sourceTagsstrResource tags (JSON string list)
directoryIdstrCategory ID
directoryPathstrFull category path
gmtCreateintCreation timestamp (milliseconds)
gmtModifiedintModification timestamp (milliseconds)
bash
curl -X POST "https://<gateway-domain>/openapi/getKnowledgeBaseSource" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sourceId":"src_1234567890"}'

listKnowledgeBaseDirectories · List Knowledge Base Categories ​

Get the enterprise knowledge base category list (subdirectory tree, requires KB view permission).

POST /openapi/listKnowledgeBaseDirectories

Request fields:

FieldTypeRequiredDescription
directoryIdstr❌Parent category ID; returns all category tree under root if omitted
sortFieldstr❌Sort field: name / gmt_create / gmt_modified (default gmt_create)
sortOrderstr❌Sort direction: asc / desc (default desc)

Response fields:

FieldTypeDescription
directorieslist[dict[str, Any]]Category tree (nested, contains directoryId/name/description/path/directoryKind/gmtCreate/gmtModified/children)
totalCountintTotal category count
bash
curl -X POST "https://<gateway-domain>/openapi/listKnowledgeBaseDirectories" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sortField":"gmt_create","sortOrder":"desc"}'

updateKnowledgeBaseDirectory · Update Knowledge Base Category ​

Update a knowledge base category (tenant directory, requires KB management permission).

POST /openapi/updateKnowledgeBaseDirectory

Request fields:

FieldTypeRequiredDescription
directoryIdstr✅Category ID to update
namestr❌New category name; omit to skip update
descriptionstr❌New category description; omit to skip update
parentDirectoryIdstr❌New parent category ID; omit to skip move; must be an existing KB directory in the current tenant

Response fields:

FieldTypeDescription
successboolWhether update was successful
directoryIdstrCategory ID (echoed from input)
bash
curl -X POST "https://<gateway-domain>/openapi/updateKnowledgeBaseDirectory" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"directoryId":"dir_1234567890","name":"标准合同模板"}'

moveKnowledgeBaseResource · Move Resource Between Knowledge Base Directories ​

Move a resource between enterprise knowledge base directories (requires KB management permission).

POST /openapi/moveKnowledgeBaseResource

Request fields:

FieldTypeRequiredDescription
sourceDirectoryIdstr✅Source directory ID
targetDirectoryIdstr✅Target directory ID
sourceIdstr✅ID of the resource to move
knowledgeIdstr✅Target knowledge base ID

Response fields: sourceId / sourceDirectoryId / targetDirectoryId / knowledgeId (all echoed from input).

bash
curl -X POST "https://<gateway-domain>/openapi/moveKnowledgeBaseResource" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sourceDirectoryId":"dir_1","targetDirectoryId":"dir_2","sourceId":"src_1","knowledgeId":"kb_1"}'

renameKnowledgeBaseSource · Rename Knowledge Base Data Source ​

Rename a data source in the enterprise knowledge base (requires KB management permission).

POST /openapi/renameKnowledgeBaseSource

Request fields:

FieldTypeRequiredDescription
sourceIdstr✅Data source ID (unique within tenant)
newNamestr✅New data source name

Response fields: sourceId / name / status / gmtModified (same as renameSource).

bash
curl -X POST "https://<gateway-domain>/openapi/renameKnowledgeBaseSource" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sourceId":"src_1234567890","newName":"公司制度-2026"}'

updateKnowledgeBaseSourceTags · Update Knowledge Base Data Source Tags ​

Update resource tags for a knowledge base data source (requires KB management permission).

POST /openapi/updateKnowledgeBaseSourceTags

Request fields:

FieldTypeRequiredDescription
sourceIdstr✅Data source ID (unique within tenant)
sourceTagsstr❌Resource tags (JSON string list)

Response fields:

FieldTypeDescription
sourceIdstrData source ID
sourceTagsstrUpdated resource tags
gmtModifiedstrLast modification time, ISO8601 format
bash
curl -X POST "https://<gateway-domain>/openapi/updateKnowledgeBaseSourceTags" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sourceId":"src_1234567890","sourceTags":"[\"合同\",\"2026\"]"}'

retryKnowledgeBaseFailedSources · Retry Failed Data Sources in Knowledge Base Directory ​

Get failed data sources in a knowledge base directory and batch retry (recursively includes subdirectories).

POST /openapi/retryKnowledgeBaseFailedSources

Request fields:

FieldTypeRequiredDescription
directoryIdstr✅Enterprise knowledge base directory ID (recursively includes subdirectories)

Response fields: directoryId / failedCount / enqueuedCount / skippedCount / enqueuedIds / failedSources (same as retryDirectoryFailedSources; failedSources is list[KbFailedSourceItem]).

bash
curl -X POST "https://<gateway-domain>/openapi/retryKnowledgeBaseFailedSources" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"directoryId":"dir_1234567890"}'

previewKnowledgeBaseSource · Preview Knowledge Base Resource ​

Preview the content of a specific resource in the enterprise knowledge base (requires DEVELOPMENT_KB_VIEW permission, TENANT type directories).

POST /openapi/previewKnowledgeBaseSource

Request fields:

FieldTypeRequiredDescription
sourceIdstr✅Resource ID (data source unique identifier)

Response fields: previewType / previewUrl / content / fileName / fileExt / publicUrl (same as previewPersonalSource).

bash
curl -X POST "https://<gateway-domain>/openapi/previewKnowledgeBaseSource" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sourceId":"src_123"}'

Scheduled Tasks ​

createScheduledTask · Create Scheduled Task ​

Create a scheduled task.

POST /openapi/createScheduledTask

Request fields:

FieldTypeRequiredDescription
namestr✅Task name (max 50 characters)
descriptionlist[SegmentItem]❌Task description (segments format), supports text/web_search/mention/skill types
digitalEmployeeNamestr❌Digital Worker name
triggerConfigTriggerConfigRequest❌Trigger configuration including trigger mode, cron expression, etc.; timezone/language auto-injected by server
taskDetailTaskDetailRequest❌Task detail (understanding result passback) including task understanding, related semantics, objects, and skills
isOpenbool❌Whether publicly accessible (default true)
segmentslist[SegmentItem]❌Rich text message segments, supports @object (type=mention) and /skill (type=skill)

Response fields:

FieldTypeDescription
taskIdstrNew task ID
bash
curl -X POST "https://<gateway-domain>/openapi/createScheduledTask" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"name":"每日销售报告","digitalEmployeeName":"销售助手"}'

updateScheduledTask · Update Scheduled Task ​

Update an existing scheduled task definition.

POST /openapi/updateScheduledTask

Request fields:

FieldTypeRequiredDescription
taskIdstr✅Task ID
namestr❌Task name (max 50 characters)
descriptionlist[SegmentItem]❌Task description (segments format), supports text/web_search/mention/skill
digitalEmployeeNamestr❌Digital Worker name
triggerConfigTriggerConfigRequest❌Trigger configuration (trigger mode, cron, etc.); timezone/language auto-injected by server
taskDetailTaskDetailRequest❌Task detail (understanding result passback)
isOpenbool❌Whether publicly accessible
segmentslist[SegmentItem]❌Rich text message segments, supports @object and /skill

Response fields:

FieldTypeDescription
taskIdstrTask ID (echoed)
updatedboolWhether an actual update occurred
bash
curl -X POST "https://<gateway-domain>/openapi/updateScheduledTask" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"taskId":"12345","name":"每日销售日报","isOpen":false}'

listScheduledTasks · List Scheduled Tasks ​

Get the current user's scheduled task list.

POST /openapi/listScheduledTasks

Request fields:

FieldTypeRequiredDescription
pageint❌Page number (default 1)
pageSizeint❌Page size (1-100, default 20)
keywordstr❌Task name fuzzy search
digitalEmployeeNamestr❌Filter by Digital Worker name

Response fields:

FieldTypeDescription
itemslist[ScheduledTaskItem]Task list
totalintTotal count matching criteria
pageintCurrent page number
pageSizeintPage size
hasMoreboolWhether more data is available
bash
curl -X POST "https://<gateway-domain>/openapi/listScheduledTasks" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"page":1,"pageSize":20}'

executeScheduledTask · Execute Scheduled Task Immediately ​

Immediately execute a specified scheduled task, creating a manually triggered execution record and returning task execution metadata that can be passed through to the Chat chain.

POST /openapi/executeScheduledTask

Request fields:

FieldTypeRequiredDescription
taskIdstr✅Task ID

Response fields:

FieldTypeDescription
executionIdstrExecution record ID
taskExecutionScheduledTaskExecutionPayloadExecution metadata that can be passed through to Chat metadata.task_execution

taskExecution (ScheduledTaskExecutionPayload) structure:

FieldTypeDescription
taskIdstrTask ID
executionIdstrExecution record ID
taskUnderstandstrTask understanding content
operatingObjectNamestrDigital Worker name
skillCodesarray<str>Associated skill code list
enableWebSearchbooleanWhether web search is enabled
billingIdstrBilling ID for Chat callback to end billing
tenantIdstrTask tenant ID
userIdstrTask user ID
taskNamestrTask name
modelstrExecution model tier: model_max(flagship)/model_plus(standard)/model_flash(lite)
bash
curl -X POST "https://<gateway-domain>/openapi/executeScheduledTask" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"taskId":"task_123"}'

getScheduledTaskExecutionDetail · Get Scheduled Task Execution Details ​

Get the full details of a single execution record.

POST /openapi/getScheduledTaskExecutionDetail

Request fields:

FieldTypeRequiredDescription
executionIdstr✅Execution record ID

Response fields:

FieldTypeDescription
executionIdstrExecution ID
taskIdstrTask ID
triggerTypestrTrigger type
digitalEmployeeNamestrDigital Worker name
triggerInfodict[str, Any]Trigger information
statusstrExecution status
skillCodeslist[str]Associated skill code list
titlestrExecution result title
contentstrFull execution content
outputContentstrStructured output content
errorMessagestrError message
metadatadict[str, Any]Metadata
fileslist[dict[str, Any]]Output file list
startedAtstrStart time ISO8601
completedAtstrCompletion time ISO8601
creatorstrCreator
gmtCreatestrCreation time ISO8601
bash
curl -X POST "https://<gateway-domain>/openapi/getScheduledTaskExecutionDetail" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"executionId":"exec_456"}'

getScheduledTaskExecutionRecords · Get Scheduled Task Execution Records ​

Query execution record timeline aggregated by operating object for all tasks.

POST /openapi/getScheduledTaskExecutionRecords

Request fields:

FieldTypeRequiredDescription
digitalEmployeeNamestr✅Digital Worker name

Response fields:

FieldTypeDescription
taskslist[ScheduledTaskTimeline]Timeline of all scheduled tasks
bash
curl -X POST "https://<gateway-domain>/openapi/getScheduledTaskExecutionRecords" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"digitalEmployeeName":"销售助手"}'

getScheduledTaskPushOptions · Get Scheduled Task Push Configuration Options ​

Query push channels and methods available for scheduled task notifications for the current user.

POST /openapi/getScheduledTaskPushOptions

Request fields:

FieldTypeRequiredDescription
digitalEmployeeNamestr✅Digital Worker name

Response fields:

FieldTypeDescription
channelsarray<ScheduledTaskPushChannelOption>Push channel list
emptyHintstrHint when no third-party accounts are bound

channels[] (ScheduledTaskPushChannelOption) structure:

FieldTypeDescription
channelTypestrChannel enum value
channelNamestrChannel display name
methodsarray<ScheduledTaskPushMethodOption>Push method list

methods[] (ScheduledTaskPushMethodOption) structure:

FieldTypeDescription
methodstrPush method: channel_bot/direct
namestrPush method display name
enabledbooleanWhether selectable
disabledReasonstrReason for being grayed out
bash
curl -X POST "https://<gateway-domain>/openapi/getScheduledTaskPushOptions" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"digitalEmployeeName":"销售助手"}'

getScheduledTaskUnderstandDetail · Get Scheduled Task Understanding Details ​

Use LLM to understand natural language user input, extracting semantic entities, related objects, and related skills.

POST /openapi/getScheduledTaskUnderstandDetail

Request fields:

FieldTypeRequiredDescription
userInputstr✅Natural language task description
digitalEmployeeNamestr❌Digital Worker name, used to filter available skills
segmentslist[SegmentItem]❌Rich text message segments, supports @object (type=mention) and /skill (type=skill)

Response fields:

FieldTypeDescription
taskUnderstandstrRefined task understanding
relatedSemanticslist[SemanticEntityOpen]Related semantic entity list
relatedObjectslist[RelatedObjectOpen]Related object list
relatedSkillslist[RelatedSkillOpen]Related skill list
bash
curl -X POST "https://<gateway-domain>/openapi/getScheduledTaskUnderstandDetail" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"userInput":"每天早上汇总昨日销售数据"}'

Primary Object Data ​

queryPrimaryObjectData · Paginated Query of Primary Object Data ​

Paginated query of primary object data via OpenAPI.

POST /openapi/queryPrimaryObjectData

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Operating object name (e.g., customer_1)
pageint❌Page number (default 1)
pageSizeint❌Page size, 1-100 (default 20)
keywordstr❌Keyword search (matches name; also matches description when defined in schema)
onlyFavoritesbool❌Return only followed primary objects (default false)

Response fields:

FieldTypeDescription
totalintTotal count
pageintCurrent page number
pageSizeintPage size
itemslist[dict[str, Any]]Primary object data list (fields vary by schema definition)
bash
curl -X POST "https://<gateway-domain>/openapi/queryPrimaryObjectData" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"customer_1","page":1,"pageSize":20}'

togglePrimaryObjectFavorite · Follow/Unfollow Primary Objects ​

Batch follow or unfollow primary objects.

POST /openapi/togglePrimaryObjectFavorite

Request fields:

FieldTypeRequiredDescription
objectTypestr✅Object type (e.g., customer, project)
operatingObjectNamestr✅Operating object name (e.g., customer_1)
objectIdslist[str]✅Primary object business ID list
actionLiteral["add","remove"]✅Action: add — follow, remove — unfollow

Response fields:

FieldTypeDescription
resultslist[TogglePrimaryObjectFavoriteResult]Processing result for each object
favoriteCountintUser's total follow count (for that object type)
bash
curl -X POST "https://<gateway-domain>/openapi/togglePrimaryObjectFavorite" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"objectType":"customer","operatingObjectName":"customer_1","objectIds":["C-001"],"action":"add"}'

replaceObjectBindings · Replace Data Source Object Bindings ​

Fully replace a data source's object bindings (delete then insert within the same transaction).

POST /openapi/replaceObjectBindings

Request fields:

FieldTypeRequiredDescription
sourceIdstr✅Data source ID (unique within tenant)
objectBindingslist[ObjectBindingItem]✅New object binding list (full replacement; pass empty to clear all bindings)

Response fields:

FieldTypeDescription
sourceIdstrData source ID
objectBindingslist[ObjectBindingItem]Object binding list after replacement
bash
curl -X POST "https://<gateway-domain>/openapi/replaceObjectBindings" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"sourceId":"src_1234567890","objectBindings":[]}'

User, Credit & Billing ​

getUserInfo · Get Current User Info ​

Get current user information via OpenAPI.

GET /openapi/getUserInfo

Request: No request body parameters.

Response fields:

FieldTypeDescription
userIdintUser ID
userCodestrUser code
isAdminboolWhether super admin
tenantIdintCurrent tenant ID
tenantNamestrCurrent tenant name
tenantTypeTenantTypeCurrent tenant type
crmTypestrCurrent tenant CRM type
tenantListlist[TenantInfo]List of tenants the user belongs to
namestrUser name
avatarstrUser avatar URL
languagePreferencestrUser language preference
profileRolestrUser role
profileRoleInfostrUser role description (when profileRole is Others)
offeringstrUser service description
parsedOfferingstrUser service parsed result (JSON)
selfIntroductionstrUser self-introduction
isSystemTenantboolWhether the current login tenant is the system tenant (tenantId=10000)
bash
curl -X GET "https://<gateway-domain>/openapi/getUserInfo" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json"

updateUserInfo · Update Current User Info ​

Update basic information of the currently logged-in user.

POST /openapi/updateUserInfo

Request fields:

FieldTypeRequiredDescription
namestr❌User name
avatarstr❌User avatar URL
languagePreferencestr❌Language preference: zh-CN, en-US
profileRoleInfostr❌User role description (when profileRole is Others), max 100 characters
offeringstr❌User service description, max 1000 characters
selfIntroductionstr❌User self-introduction, max 1000 characters

Response fields:

FieldTypeDescription
successboolWhether update was successful
messagestrResult description
userUserInfoUpdated user information
bash
curl -X POST "https://<gateway-domain>/openapi/updateUserInfo" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"name":"张三","languagePreference":"zh-CN"}'

getUserCreditUsage · Query User Credit Consumption ​

Query user's consumed Credit in real-time via OpenAPI.

POST /openapi/getUserCreditUsage

Request: No request body parameters.

Response fields:

FieldTypeDescription
tenantIdintTenant ID
userIdintUser ID
creditLimitDecimalUser Credit limit
usedCreditsDecimalUsed Credit (real-time)
remainingCreditsDecimalRemaining Credit (real-time)
shadowCreditLimitDecimalShadow Credit limit
shadowUsedCreditsDecimalUsed shadow Credit (real-time)
shadowRemainingCreditsDecimalRemaining shadow Credit (real-time)
bash
curl -X POST "https://<gateway-domain>/openapi/getUserCreditUsage" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{}'

listBilling · List Billing Records ​

Query billing records via OpenAPI.

POST /openapi/listBilling

Request fields:

FieldTypeRequiredDescription
userIdint❌User ID (optional filter)
operationstr❌Operation type (optional filter)
statusstr❌Status (optional filter)
startTimedatetime❌Start time range
endTimedatetime❌End time range
bizTypestr❌Business source type (optional filter)
bizIdstr❌Business source ID (optional filter)
ignoreZerobool❌Whether to filter out billing records with zero Credit consumption (default true)
pageint❌Page number (default 1)
pageSizeint❌Page size (default 20)

Response fields:

FieldTypeDescription
listlist[BillingItemResponse]Billing list
totalintTotal count
pageintPage number
pageSizeintPage size
bash
curl -X POST "https://<gateway-domain>/openapi/listBilling" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"page":1,"pageSize":20,"ignoreZero":true}'

User & Permission Management ​

createUser · Create User and Join Tenant ​

Intelligently create a WINNEXO self-built account user and join the current tenant (if account already exists, directly joins).

POST /openapi/createUser

Request fields:

FieldTypeRequiredDescription
accountIdstr✅WINNEXO login account (unique identifier)
displayNamestr✅User display name (unique within tenant)
roleCodesarray<str>❌System roles: SUPER_ADMIN / SYSTEM_ADMIN / SEMANTIC_ADMIN / SKILL_ADMIN / KB_ADMIN / AGENT_ADMIN / APPLICATION_USER (default APPLICATION_USER)
passwordEncryptedstr❌RSA-OAEP-SHA256 encrypted base64 ciphertext; uses system default password if omitted

Response fields:

FieldTypeDescription
userIdintPlatform user ID
accountIdstrWINNEXO login account
displayNamestrUser display name
isNewUserbooleanWhether this is a newly created user
isDefaultPasswordbooleanWhether using system default password (recommend notifying user to change when true)
bash
curl -X POST "https://<gateway-domain>/openapi/createUser" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"accountId":"zhangsan","displayName":"张三","roleCodes":["APPLICATION_USER"]}'

updateUser · Update User Info (Including Enable/Disable) ​

Update user display name, roles, enable/disable status, and user groups. All fields except userId are optional (omit to skip; at least one must be changed); roleCodes/userGroupIds are full replacements.

POST /openapi/updateUser

Request fields:

FieldTypeRequiredDescription
userIdint✅Target user ID
displayNamestr❌New display name (must not be empty if provided)
roleCodesarray<str>❌New role list (full replacement, at least one)
isActiveboolean❌Enable/disable (false=disable, true=enable)
userGroupIdsarray<str>❌New user group ID list (full replacement)

Response fields: userId(int, the modified user ID). HTTP 200 indicates success.

bash
curl -X POST "https://<gateway-domain>/openapi/updateUser" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"userId":1001,"displayName":"张三丰","isActive":true}'

getUser · Get User Details ​

Query user details. Provide either userId or accountId (if both provided, userId takes precedence).

POST /openapi/getUser

Request fields:

FieldTypeRequiredDescription
userIdint❌User ID (provide either this or accountId)
accountIdstr❌WINNEXO login account (provide either this or userId)

Response fields:

FieldTypeDescription
userIdintUser ID
accountIdstrWINNEXO login account
displayNamestrUser display name
isActivebooleanEnable/disable status
roleCodesarray<str>System role code list
userGroupIdsarray<str>User group ID list
gmtCreatestrTime joined tenant
lastLoginTimestrLast login time
bash
curl -X POST "https://<gateway-domain>/openapi/getUser" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"userId":1001}'

listUsers · Paginated Query of Tenant Members ​

Paginated query of tenant member list with status, role, and keyword filtering.

POST /openapi/listUsers

Request fields:

FieldTypeRequiredDescription
pageint❌Page number (default 1)
pageSizeint❌Page size (max 100, default 20)
keywordstr❌Search keyword (fuzzy matches display name and account)
isActiveboolean❌Enable/disable status filter
roleCodesarray<str>❌Filter by roles

Response fields: total(int) / page(int) / pageSize(int) / items(array<ListUsersItemResponse>).

items[]: userId / accountId / displayName / isActive / roleCodes / gmtCreate / lastLoginTime.

bash
curl -X POST "https://<gateway-domain>/openapi/listUsers" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"page":1,"pageSize":20,"keyword":"张"}'

removeUser · Remove User from Tenant ​

Remove a user from the current tenant (preserves user entity), also removing their role/user group associations and Digital Worker authorizations. Includes last super admin protection.

POST /openapi/removeUser

Request fields:

FieldTypeRequiredDescription
userIdint✅User ID to remove

Response fields: userId(int, the removed user ID). HTTP 200 indicates success.

bash
curl -X POST "https://<gateway-domain>/openapi/removeUser" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"userId":1001}'

resetPassword · Reset User Password ​

Admin resets user password; resets to system default password if passwordEncrypted is omitted. Only supports WINNEXO self-built accounts.

POST /openapi/resetPassword

Request fields:

FieldTypeRequiredDescription
userIdint✅Target user ID
passwordEncryptedstr❌RSA-OAEP-SHA256 encrypted new password base64 ciphertext; resets to default if omitted

Response fields: userId(int) / isDefaultPassword(boolean, whether reset to system default password).

bash
curl -X POST "https://<gateway-domain>/openapi/resetPassword" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"userId":1001}'

getTokenInfo · Query User Token Status ​

Query a user's INSTANCE Token status (only callable with personal Token). Empty userId queries self; super admin/system admin can query other users in the same tenant.

POST /openapi/getTokenInfo

Request fields (optional):

FieldTypeRequiredDescription
userIdint❌Target user ID (empty for self; admin can operate on behalf)

Response fields:

FieldTypeDescription
enabledbooleanWhether Token is enabled (has ACTIVE status)
tokenMaskedstrMasked Token value
gmtCreatestrToken creation time (ISO 8601)
bash
curl -X POST "https://<gateway-domain>/openapi/getTokenInfo" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{}'

enableToken · Enable API Token ​

Enable a user's INSTANCE Token (idempotent). Plaintext is returned only on first enablement. Only callable with personal Token.

POST /openapi/enableToken

Request fields (optional): userId(int, empty for self; admin can operate on behalf).

Response fields:

FieldTypeDescription
tokenstrToken plaintext (returned only this once; store securely)
tokenMaskedstrMasked Token value
bash
curl -X POST "https://<gateway-domain>/openapi/enableToken" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{}'

disableToken · Disable API Token ​

Disable a user's INSTANCE Token (ACTIVE → INACTIVE, idempotent). Only callable with personal Token.

POST /openapi/disableToken

Request fields (optional): userId(int, empty for self).

Response fields: disabled(boolean, whether operation succeeded).

bash
curl -X POST "https://<gateway-domain>/openapi/disableToken" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{}'

resetToken · Reset API Token ​

Reset a user's INSTANCE Token: the old ACTIVE Token is permanently invalidated (RESET), and a new ACTIVE Token is generated. Only callable with personal Token.

POST /openapi/resetToken

Request fields (optional): userId(int, empty for self).

Response fields:

FieldTypeDescription
tokenstrNew Token plaintext (returned only this once)
tokenMaskedstrMasked new Token value
bash
curl -X POST "https://<gateway-domain>/openapi/resetToken" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{}'

grantAgentUsers · Authorize Users/Groups to Use a Digital Worker ​

Authorize users or user groups to use a specified Digital Worker (updates if already exists). Requires MANAGE permission. Provide either userIds or userGroupIds.

POST /openapi/grantAgentUsers

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name
userIdsarray<int>❌Authorized user ID list (provide either this or userGroupIds)
userGroupIdsarray<str>❌Authorized user group ID list (16-char hex)
expireDateint❌Authorization expiration timestamp (milliseconds); never expires if omitted
permissionsarray<str>❌Permissions: USE and/or MANAGE (default USE only)

Response fields: grantedCount(int, number of authorization records processed).

bash
curl -X POST "https://<gateway-domain>/openapi/grantAgentUsers" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"销售助手","userIds":[1001,1002],"permissions":["USE"]}'

revokeAgentUsers · Revoke Users/Groups Digital Worker Usage Permission ​

Revoke user or user group usage permissions for a specified Digital Worker. Requires MANAGE permission. Provide either userIds or userGroupIds.

POST /openapi/revokeAgentUsers

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name
userIdsarray<int>❌User ID list to revoke (provide either this or userGroupIds)
userGroupIdsarray<str>❌User group ID list to revoke

Response fields: revokedCount(int, number of records successfully revoked).

bash
curl -X POST "https://<gateway-domain>/openapi/revokeAgentUsers" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"销售助手","userIds":[1001,1002]}'

listAuthorizedAgents · List Digital Workers with Specified Permission ​

Query the list of Digital Worker names where the current caller has a specified permission (USE/MANAGE). Request body is optional; defaults to USE.

POST /openapi/listAuthorizedAgents

Request fields (optional): permission(str, USE / MANAGE, default USE).

Response fields: agentNames(array<str>, Digital Worker names with the specified permission).

bash
curl -X POST "https://<gateway-domain>/openapi/listAuthorizedAgents" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"permission":"USE"}'

listAuthorizedUsers · List Authorized Users/Groups for a Digital Worker ​

Query the list of authorized users/user groups for a Digital Worker (requires APPLICATION_AGENT_VIEW).

POST /openapi/listAuthorizedUsers

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name
keywordstr❌Search keyword (fuzzy matches user name or group name)
granteeTypestr❌Filter: USER / USER_GROUP / omit for all
permissionstr❌Permission filter: USE / MANAGE

Response fields: authMode(str, SPECIFIED_USERS / ALL_USERS) / total(int) / items(array<AuthorizedUserItem>).

items[] (AuthorizedUserItem): id / granteeId / granteeType(USER/USER_GROUP) / userId / userGroupId / userName / userGroupName / memberCount / permissions / expireDate / grantedBy / gmtCreate / gmtModified.

bash
curl -X POST "https://<gateway-domain>/openapi/listAuthorizedUsers" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"销售助手","granteeType":"USER"}'

updateAgentAuthMode · Update Digital Worker Authorization Mode ​

Switch the Digital Worker's usage permission authorization mode. Requires MANAGE permission.

POST /openapi/updateAgentAuthMode

Request fields:

FieldTypeRequiredDescription
operatingObjectNamestr✅Digital Worker name
authModestr✅SPECIFIED_USERS = specified users (requires explicit authorization), ALL_USERS = all users (no authorization required)

Response fields: updated(boolean, whether update was successful).

bash
curl -X POST "https://<gateway-domain>/openapi/updateAgentAuthMode" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"operatingObjectName":"销售助手","authMode":"ALL_USERS"}'

Organization Sync ​

createCustomOrg · Register Custom Organization ​

Register a custom organization for subsequent department tree pushes via syncOrgStructure (only supports department tree sync, not member relationship sync).

POST /openapi/createCustomOrg

Request fields:

FieldTypeRequiredDescription
corpIdstr✅Custom organization identifier, format ^[a-z0-9][a-z0-9\-]{2,63}$ (3-64 characters)
corpNamestr❌Organization display name (same as corpId if omitted, max 128)

Response fields:

FieldTypeDescription
corpIdstrSuccessfully registered organization identifier
corpNamestrOrganization display name
platformTypestrPlatform type, fixed as custom
bash
curl -X POST "https://<gateway-domain>/openapi/createCustomOrg" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"corpId":"acme-corp","corpName":"Acme 公司"}'

syncOrgStructure · Push Organization Structure Sync ​

Receive client-pushed department tree and member relationships, create an async sync task, and return a taskId for polling via querySyncResult. Single push limit: departments + members total max 50000.

POST /openapi/syncOrgStructure

Request fields:

FieldTypeRequiredDescription
platformTypestr✅Platform type: saml / oauth2 / custom
corpIdstr✅Enterprise identifier (must match listAvailableConfigs response)
ssoSettingsIdstr❌SSO configuration ID (required when multiple IdPs share corpId; not needed for custom)
syncMembersboolean❌Whether to sync member relationships (default false; forced false for custom)
departmentsarray<PushDepartmentItem>✅Department list (at least one root department)
membersarray<PushMemberItem>❌Member list (required when syncMembers=true)

departments[] (PushDepartmentItem): deptId(✅) / deptName(✅, max 128) / parentDeptId(null for root) / order(default 0).
members[] (PushMemberItem): deptId(✅) / accountId(✅, must match rbj_user_account.account_id) / name(optional).

Response fields:

FieldTypeDescription
taskIdnumberAsync sync task ID for querySyncResult polling
statusstrInitial task status (PENDING)
bash
curl -X POST "https://<gateway-domain>/openapi/syncOrgStructure" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"platformType":"custom","corpId":"acme-corp","syncMembers":false,"departments":[{"deptId":"d1","deptName":"总部","parentDeptId":null,"order":0}]}'

querySyncResult · Query Organization Sync Result ​

Query the execution status and result of an organization sync task by taskId (states: PENDING → RUNNING → COMPLETED / FAILED / TIMEOUT / CANCELED; recommended polling interval: 3-5 seconds).

POST /openapi/querySyncResult

Request fields:

FieldTypeRequiredDescription
taskIdnumber✅Sync task ID (returned by syncOrgStructure)

Response fields:

FieldTypeDescription
taskIdnumberTask ID
statusstrTask status (PENDING / RUNNING / COMPLETED / FAILED / TIMEOUT / CANCELED)
platformTypestrPlatform type
corpIdstrEnterprise identifier
submittedAtstrTask submission time (ISO 8601)
startedAtstrTask start time
completedAtstrTask completion time
durationSecondsnumberExecution duration (seconds)
summarystrExecution summary (human-readable)
errorMessagestrError message (present on failure)
deptStatsDeptStatsResponseDepartment sync statistics (present on completion)
memberStatsMemberStatsResponseMember sync statistics (present when syncMembers=true and completed)

deptStats: totalExternal / created / renamed / moved / deleted / skipped (all number).
memberStats: totalExternal / relationshipAdded / relationshipRemoved / unchanged / failed (all number).

bash
curl -X POST "https://<gateway-domain>/openapi/querySyncResult" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{"taskId":123456}'

listAvailableConfigs · List Available Organization Sync Configurations ​

Enumerate all available organization sync configurations under the current tenant, covering wecom / saml / oauth2 / custom platform types.

POST /openapi/listAvailableConfigs

Request: No request body parameters.

Response fields:

FieldTypeDescription
configsarray<OrgSyncConfigItem>Available organization sync configuration list

configs[] (OrgSyncConfigItem):

FieldTypeDescription
platformTypestrPlatform type: wecom / saml / oauth2 / custom
corpIdstrEnterprise identifier (wecom=corpId, saml=idpEntityId, oauth2=clientId, custom=client-defined)
corpNamestrEnterprise display name
ssoSettingsIdstrSSO configuration ID (null for custom)
ssoSettingsNamestrSSO configuration name (null for custom)
bash
curl -X POST "https://<gateway-domain>/openapi/listAvailableConfigs" \
  -H "Authorization: Bearer <AccessToken>" \
  -H "Content-Type: application/json" \
  -d '{}'

Best Practices ​

✓
"Prefer skills over chat" — Quick Skills are pre-configured "finished capabilities" set up by you or an admin, with stable parameters and predictable results. Calling chat directly is like having someone conduct a live conversation with a Digital Worker — results can vary.
✓
"Validate with CLI first, then convert to code" — All OpenAPI capabilities are wrapped in CLI commands. Verify parameters and response structures in the terminal first, then translate to code.
i
"Don't hardcode tokens" — Read from environment variables and inject via secret manager at deployment time.

📌 Related Reading: CLI, Custom Skills, Capability Center