Skip to main content

Overview

Service address, protocol conventions, and endpoint list of the Managed Agents API, a smart agent hosting runtime provided by Bailian.

Before calling, configure Authentication. For error handling, see Error Codes.

Prerequisites

  1. Enable Bailian and create an API Key.
  2. Obtain your Workspace ID: Find it in the dropdown menu at the top-right corner of the Bailian console — it looks like {workspace_id}.

Endpoint

The base API URL is constructed from your workspace ID and region:
https://{workspace_id}.{region}.maas.aliyuncs.com/api/v1/agentstudio
  • workspace_id: Your workspace ID
  • region: Region ID — currently only cn-beijing is supported.

SDKs

In addition to direct REST API calls, you can integrate using Python or Java SDKs. The Managed Agents module requires:
  • Python SDK v1.26.2 or later
  • Java SDK v2.22.24 or later
If you have an older version installed, re-run the installation command to upgrade. Session-level agent configuration overrides (agent object and patch) and session-level MCP request headers (mcp_configs) require Python SDK v1.27.7 or later and Java SDK v2.23.2 or later. Direct REST calls are not affected by this requirement.
pip install dashscope

Requests and Responses

  • Request bodies are JSON-formatted with Content-Type: application/json.
  • Every response includes an x-request-id header that helps locate the specific request.
  • List endpoints support pagination:
    • limit: Number of items per page (default: 20; maximum: 100)
    • page: Page number (omit for first page; use next_page from previous response for subsequent pages).
      If the response does not contain next_page, you’ve reached the last page.

Available APIs

ResourceEndpointPurpose
AgentPOST /agentsCreate an Agent
GET /agents/{agent_id}Retrieve an Agent
GET /agentsList Agents
POST /agents/{agent_id}Update an Agent (auto-generates a new version number)
POST /agents/{agent_id}/archiveArchive an Agent
EnvironmentPOST /environmentsCreate an Environment
GET /environments/{environment_id}Retrieve an Environment
GET /environmentsList Environments
POST /environments/{environment_id}Update an Environment
DELETE /environments/{environment_id}Delete an Environment
POST /environments/{environment_id}/archiveArchive an Environment
Session & EventPOST /sessionsCreate a Session
GET /sessions/{session_id}Retrieve a Session
GET /sessionsList Sessions
POST /sessions/{session_id}Update a Session (e.g., rename)
DELETE /sessions/{session_id}Delete a Session
POST /sessions/{session_id}/archiveArchive a Session
POST /sessions/{session_id}/eventsSend an Event (e.g., user message or tool response to the Agent)
GET /sessions/{session_id}/eventsList event history; subscribe to SSE event stream (for streaming output)
FilePOST /filesUpload a File (multipart/form-data)
GET /files/{file_id}Retrieve File metadata
GET /filesList Files
DELETE /files/{file_id}Delete a File
Memory StorePOST /memory_storesCreate a Memory Store
GET /memory_storesList Memory Stores
GET /memory_stores/{memory_store_id}Get a Memory Store
POST /memory_stores/{memory_store_id}Update a Memory Store
POST /memory_stores/{memory_store_id}/archiveArchive a Memory Store
POST /memory_stores/{memory_store_id}/memoriesCreate a Memory (memory file)
GET /memory_stores/{memory_store_id}/memoriesList Memories
GET /memory_stores/{memory_store_id}/memories/{memory_id}Get a Memory
POST /memory_stores/{memory_store_id}/memories/{memory_id}Update a Memory
DELETE /memory_stores/{memory_store_id}/memories/{memory_id}Delete a Memory
GET /memory_stores/{memory_store_id}/memory_versionsList Memory Versions (history)
GET /memory_stores/{memory_store_id}/memory_versions/{memory_version_id}Get a Memory Version
POST /memory_stores/{memory_store_id}/memory_versions/{memory_version_id}/redactRedact a Memory Version body
SkillPOST /skillsCreate a Skill
GET /skills/{skill_id}Retrieve a Skill
GET /skillsList Skills
DELETE /skills/{skill_id}Delete a Skill
POST /skills/{skill_id}/versionsUpload a new version of a Skill
GET /skills/{skill_id}/versions/{version}Retrieve a specific Skill version
GET /skills/{skill_id}/versionsList all versions of a Skill
GET /skills/{skill_id}/versions/{version}/contentDownload a Skill package
VaultPOST /vaultsCreate a Vault
GET /vaults/{vault_id}Retrieve a Vault
GET /vaultsList Vaults
POST /vaults/{vault_id}Update a Vault
DELETE /vaults/{vault_id}Delete a Vault
POST /vaults/{vault_id}/archiveArchive a Vault
CredentialPOST /vaults/{vault_id}/credentialsCreate a Credential
GET /vaults/{vault_id}/credentials/{credential_id}Retrieve a Credential
GET /vaults/{vault_id}/credentialsList Credentials
POST /vaults/{vault_id}/credentials/{credential_id}Update a Credential
DELETE /vaults/{vault_id}/credentials/{credential_id}Delete a Credential
POST /vaults/{vault_id}/credentials/{credential_id}/archiveArchive a Credential
WebhookPOST /webhook_endpointsCreate a Webhook
GET /webhook_endpoints/{id}Retrieve a Webhook
GET /webhook_endpointsList Webhooks
PUT /webhook_endpoints/{id}Update a Webhook
DELETE /webhook_endpoints/{id}Delete a Webhook
POST /webhook_endpoints/{id}/enableEnable a Webhook
POST /webhook_endpoints/{id}/disableDisable a Webhook
POST /webhook_endpoints/{id}/testTest a Webhook
POST /webhook_endpoints/{id}/reset_secretReset the signing secret
GET /webhook_endpoints/{id}/eventsList Webhook events