跳到主要内容

ONLYOFFICE DocSpace AI API

The browsable version of this reference, with a request builder and code samples, is published at https://api.onlyoffice.com/docspace/api-backend/usage-api/.

All URIs are relative to https://yourportal.onlyoffice.com, where the host is the address of your DocSpace instance.

AI​

MethodHTTP requestDescription
aiApproveToolCallPOST /api/2.0/ai/ai/approve-tool-callApprove tool call
aiDenyToolCallPOST /api/2.0/ai/ai/deny-tool-callDeny tool call
aiRegenerateStreamPOST /api/2.0/ai/ai/regenerate-streamRegenerate stream
aiSendPOST /api/2.0/ai/ai/sendRun an AI action
aiSendCustomPOST /api/2.0/ai/ai/send-customSend custom
aiSendWithStreamPOST /api/2.0/ai/ai/send-with-streamSend with stream
aiSendWithStreamOpenAIPOST /api/2.0/ai/ai/send-with-stream-openaiStream a chat in OpenAI format

Agents​

MethodHTTP requestDescription
aiAgentsCreatePOST /api/2.0/ai/agentsCreate an agent
aiAgentsDeleteDELETE /api/2.0/ai/agents/{id}Delete an agent
aiAgentsGetGET /api/2.0/ai/agents/{id}Get an agent
aiAgentsListGET /api/2.0/ai/agentsList agents
aiAgentsNewsGET /api/2.0/ai/agents/newsList agent news items
aiAgentsResetQuotaPUT /api/2.0/ai/agents/resetquotaReset agents' quota
aiAgentsUpdatePUT /api/2.0/ai/agents/{id}Update an agent
aiAgentsUpdateQuotaPUT /api/2.0/ai/agents/agentquotaUpdate agents' quota

Assignments​

MethodHTTP requestDescription
aiAssignmentsAssignPUT /api/2.0/ai/assignments/assignBind a profile to an action
aiAssignmentsBulkAssignPUT /api/2.0/ai/assignments/bulk-assignBulk assign
aiAssignmentsCascadeProfileDeleteDELETE /api/2.0/ai/assignments/cascade-profile-deleteCascade profile delete
aiAssignmentsGetAllAssignmentsGET /api/2.0/ai/assignments/get-all-assignmentsGet all assignments
aiAssignmentsGetAssignmentGET /api/2.0/ai/assignments/get-assignmentGet assignment
aiAssignmentsResolveForActionGET /api/2.0/ai/assignments/resolve-for-actionResolve for action
aiAssignmentsTryResolveForActionGET /api/2.0/ai/assignments/try-resolve-for-actionTry resolve for action
aiAssignmentsUnassignDELETE /api/2.0/ai/assignments/unassignClear an action's profile

Attachments​

MethodHTTP requestDescription
aiAttachmentsDeleteDELETE /api/2.0/ai/attachments/deleteDelete one attachment
aiAttachmentsDeleteManyDELETE /api/2.0/ai/attachments/delete-manyDelete many
aiAttachmentsGetPOST /api/2.0/ai/attachments/getGet one attachment
aiAttachmentsGetManyPOST /api/2.0/ai/attachments/get-manyGet many
aiAttachmentsGetSuggestedQuestionsPOST /api/2.0/ai/attachments/suggested-questionsGet suggested questions
aiAttachmentsLinkToMessagePOST /api/2.0/ai/attachments/link-to-messageLink to message
aiAttachmentsSaveFilePOST /api/2.0/ai/attachments/save-fileSave file
aiAttachmentsSaveFilesManyPOST /api/2.0/ai/attachments/save-files-manySave files many

Context​

MethodHTTP requestDescription
aiContextGetContextFoldersGET /api/2.0/ai/context/get-context-foldersGet context folders
aiContextGetRoomSkillGET /api/2.0/ai/context/get-room-skillGet room skill
aiContextGetRoomSkillsGET /api/2.0/ai/context/get-room-skillsGet room skills

Editor tools​

MethodHTTP requestDescription
aiEditorToolsCallPOST /api/2.0/ai/editor-tools/callCall an editor tool
aiEditorToolsListGET /api/2.0/ai/editor-tools/listList editor tools

Export​

MethodHTTP requestDescription
aiExportTextToDocxPOST /api/2.0/ai/text-to-docxStart markdown export

OpenAI passthrough​

MethodHTTP requestDescription
aiOpenaiChatCompletionsPOST /api/2.0/ai/openai/{profileId}/v1/chat/completionsOpenAI chat completions passthrough
aiOpenaiImagesGenerationsPOST /api/2.0/ai/openai/{profileId}/v1/images/generationsOpenAI image generation passthrough

Preferences​

MethodHTTP requestDescription
aiPreferencesClearDeepModeDELETE /api/2.0/ai/preferences/clear-deep-modeClear deep mode
aiPreferencesGetDeepModeGET /api/2.0/ai/preferences/get-deep-modeGet deep mode
aiPreferencesGetReasoningLevelGET /api/2.0/ai/preferences/get-reasoning-levelGet reasoning level
aiPreferencesGetToolPermissionModeGET /api/2.0/ai/preferences/get-tool-permission-modeGet tool permission mode
aiPreferencesIsDeepModeSetGET /api/2.0/ai/preferences/is-deep-mode-setIs deep mode set
aiPreferencesSetDeepModePUT /api/2.0/ai/preferences/set-deep-modeSet deep mode
aiPreferencesSetReasoningLevelPUT /api/2.0/ai/preferences/set-reasoning-levelSet reasoning level
aiPreferencesSetToolPermissionModePUT /api/2.0/ai/preferences/set-tool-permission-modeSet tool permission mode

Profiles​

MethodHTTP requestDescription
aiProfilesCreatePOST /api/2.0/ai/profiles/createCreate a provider profile
aiProfilesDeleteDELETE /api/2.0/ai/profiles/deleteDelete a provider profile
aiProfilesGetByIdGET /api/2.0/ai/profiles/get-by-idGet a provider profile
aiProfilesListGET /api/2.0/ai/profiles/listList provider profiles
aiProfilesListModelsGET /api/2.0/ai/profiles/list-modelsList models
aiProfilesListProviderModelsPOST /api/2.0/ai/profiles/list-provider-modelsList provider models
aiProfilesTestConnectionPOST /api/2.0/ai/profiles/test-connectionTest a profile's provider
aiProfilesUpdatePUT /api/2.0/ai/profiles/updateUpdate a provider profile

Prompts​

MethodHTTP requestDescription
aiPromptsCreatePOST /api/2.0/ai/prompts/createSave a prompt
aiPromptsCreateFolderPOST /api/2.0/ai/prompts/create-folderCreate folder
aiPromptsDeleteDELETE /api/2.0/ai/prompts/deleteDelete a saved prompt
aiPromptsDeleteFolderDELETE /api/2.0/ai/prompts/delete-folderDelete folder
aiPromptsExportGET /api/2.0/ai/prompts/exportExport the prompt library
aiPromptsGetByIdGET /api/2.0/ai/prompts/get-by-idGet a saved prompt
aiPromptsGetFolderByIdGET /api/2.0/ai/prompts/get-folder-by-idGet a prompt folder
aiPromptsImportBundlePOST /api/2.0/ai/prompts/import-bundleImport bundle
aiPromptsListGET /api/2.0/ai/prompts/listList saved prompts
aiPromptsListFoldersGET /api/2.0/ai/prompts/list-foldersList folders
aiPromptsMovePUT /api/2.0/ai/prompts/moveMove a prompt to a folder
aiPromptsRenameFolderPUT /api/2.0/ai/prompts/rename-folderRename folder
aiPromptsUpdatePUT /api/2.0/ai/prompts/updateUpdate a saved prompt

Settings​

MethodHTTP requestDescription
aiSettingsGetGET /api/2.0/ai/configGet AI settings
aiSettingsGetToolModeGET /api/2.0/ai/config/tool-modeGet the tool permission mode
aiSettingsGetUserGET /api/2.0/ai/config/userGet user AI settings
aiSettingsGetVectorizationGET /api/2.0/ai/config/vectorizationGet vectorization settings
aiSettingsSetToolModePUT /api/2.0/ai/config/tool-modeSet the tool permission mode
aiSettingsSetUserPUT /api/2.0/ai/config/userUpdate user AI settings
aiSettingsSetVectorizationPUT /api/2.0/ai/config/vectorizationUpdate vectorization settings

Threads​

MethodHTTP requestDescription
aiThreadsAppendUserMessagePOST /api/2.0/ai/threads/append-user-messageAppend user message
aiThreadsClearMessagesDELETE /api/2.0/ai/threads/clear-messagesClear messages
aiThreadsCreatePOST /api/2.0/ai/threads/createCreate a chat thread
aiThreadsDeleteDELETE /api/2.0/ai/threads/deleteDelete a chat thread
aiThreadsDeleteMessageDELETE /api/2.0/ai/threads/delete-messageDelete message
aiThreadsGetByIdGET /api/2.0/ai/threads/get-by-idGet a chat thread
aiThreadsGetMessageByIdGET /api/2.0/ai/threads/get-message-by-idGet one chat message
aiThreadsListGET /api/2.0/ai/threads/listList chat threads
aiThreadsOpenOrCreatePOST /api/2.0/ai/threads/open-or-createOpen or create
aiThreadsReadMessagesGET /api/2.0/ai/threads/read-messagesRead messages
aiThreadsRegenerateTitlePOST /api/2.0/ai/threads/regenerate-titleRegenerate title
aiThreadsRenamePUT /api/2.0/ai/threads/renameRename a chat thread
aiThreadsTouchPOST /api/2.0/ai/threads/touchBump a thread's activity
aiThreadsUpdateMessagePUT /api/2.0/ai/threads/update-messageUpdate message

Tools​

MethodHTTP requestDescription
aiToolsAddCustomServerPOST /api/2.0/ai/tools/add-custom-serverAdd custom server
aiToolsGetAllowAlwaysGET /api/2.0/ai/tools/get-allow-alwaysGet allow always
aiToolsGetCustomServerGET /api/2.0/ai/tools/get-custom-serverGet custom server
aiToolsGetDisabledGET /api/2.0/ai/tools/get-disabledGet disabled
aiToolsIsAllowAlwaysGET /api/2.0/ai/tools/is-allow-alwaysIs allow always
aiToolsIsToolDisabledGET /api/2.0/ai/tools/is-tool-disabledIs tool disabled
aiToolsListCustomServersGET /api/2.0/ai/tools/list-custom-serversList custom servers
aiToolsListSystemToolsGET /api/2.0/ai/tools/list-system-toolsList system tools
aiToolsRemoveCustomServerDELETE /api/2.0/ai/tools/remove-custom-serverRemove custom server
aiToolsReplaceAllCustomServersPUT /api/2.0/ai/tools/replace-all-custom-serversReplace all custom servers
aiToolsSetAllowAlwaysPUT /api/2.0/ai/tools/set-allow-alwaysSet allow always
aiToolsSetDisabledPUT /api/2.0/ai/tools/set-disabledSet disabled
aiToolsUpdateCustomServerPUT /api/2.0/ai/tools/update-custom-serverUpdate custom server

Vectorization​

MethodHTTP requestDescription
aiVectorizationStartTaskPOST /api/2.0/ai/vectorization/tasksStart a vectorization task
MethodHTTP requestDescription
aiWebSearchClearDELETE /api/2.0/ai/web-search/clearClear the web-search configuration
aiWebSearchConfigurePUT /api/2.0/ai/web-search/configureConfigure and verify web search
aiWebSearchGetActiveConfigGET /api/2.0/ai/web-search/get-active-configGet active config
aiWebSearchIsConfiguredGET /api/2.0/ai/web-search/is-configuredIs configured
aiWebSearchPassthroughContentsPOST /api/2.0/ai/websearch/v1/contentsWeb page contents passthrough
aiWebSearchPassthroughSearchPOST /api/2.0/ai/websearch/v1/searchWeb search passthrough
aiWebSearchSetActiveConfigPUT /api/2.0/ai/web-search/set-active-configSet active config
aiWebSearchTestConnectionPOST /api/2.0/ai/web-search/test-connectionTest a web-search provider

Authorization​

cookieAuth​

  • Type: API key
  • API key parameter name: asc_auth_key
  • Location:

bearerAuth​

  • Type: HTTP Bearer Token authentication

asc_auth_key​

  • Type: API key
  • API key parameter name: asc_auth_key
  • Location:

Basic​

  • Type: HTTP basic authentication

Bearer​

  • Type: HTTP Bearer Token authentication (JWT)

ApiKeyBearer​

  • Type: API key
  • API key parameter name: ApiKeyBearer
  • Location: HTTP header

OAuth2​

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL:
  • Scopes:
    • read: Read access to protected resources
    • write: Write access to protected resources

OpenId​

x-signature​

  • Type: API key
  • API key parameter name: x-signature
  • Location: