Skip to main content
Managed Agent API

Overview

The Managed Agents API is the agent runtime hosted by Model Studio: sessions, sandboxes, tool execution, and event streams are all managed by the platform.

Before calling, configure Authentication. For error handling, see Errors.

Prerequisites

  1. Activate Bailian and create an API Key.
  2. Get the workspace ID: open the dropdown in the upper-right corner of the Model Studio console. The ID looks like ws_xxxxxxxxxxxx.

Endpoint

The API base URL is composed from the workspace and region:
https://{workspace_id}.{region}.maas.aliyuncs.com/api/v1/agentstudio
  • workspace_id: workspace ID, for example ws_xxxxxxxxxxxx
  • region: region ID. Only cn-beijing is supported.

SDK

In addition to calling the REST API directly, you can integrate with the Python or Java SDK. The Managed Agents module requires Python SDK v1.26.2 or later, and Java SDK v2.22.24 or later. If you have an older version installed, run the install command again to upgrade.
pip install dashscope

Requests and responses

  • Request bodies are JSON with Content-Type: application/json.
  • Every response carries an x-request-id header that helps locate the specific request.
  • List endpoints support pagination: limit (default 20, max 100) and page (omit on the first request; subsequent requests pass the next_page value returned by the previous response). When the response no longer contains next_page, you have reached the last page.

Available APIs

Resource

Endpoint

Purpose

Agent

POST /agents

Create an agent

GET /agents/{agent_id}

Get an agent

GET /agents

List agents

POST /agents/{agent_id}

Update an agent (auto-increments the version)

POST /agents/{agent_id}/archive

Archive an agent

Environment

POST /environments

Create an environment

GET /environments/{environment_id}

Get an environment

GET /environments

List environments

POST /environments/{environment_id}

Update an environment

DELETE /environments/{environment_id}

Delete an environment

POST /environments/{environment_id}/archive

Archive an environment

Session and Event

POST /sessions

Create a session

GET /sessions/{session_id}

Get a session

GET /sessions

List sessions

POST /sessions/{session_id}

Update a session (for example, rename)

DELETE /sessions/{session_id}

Delete a session

POST /sessions/{session_id}/archive

Archive a session

POST /sessions/{session_id}/events

Send an event (deliver a user message or tool receipt to the agent)

GET /sessions/{session_id}/events

List event history; subscribe to the SSE event stream (streaming output)

File

POST /files

Upload a file (multipart/form-data)

GET /files/{file_id}

Query file metadata

GET /files

List files

DELETE /files/{file_id}

Delete a file

Memory Store

POST /memory_stores

Create a Memory Store

GET /memory_stores

List 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}/archive

Archive a Memory Store

POST /memory_stores/{memory_store_id}/memories

Create a Memory (memory file)

GET /memory_stores/{memory_store_id}/memories

List 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_versions

List 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}/redact

Redact a Memory Version body

Skill

POST /skills

Create a skill

GET /skills/{skill_id}

Get a skill

GET /skills

List skills

DELETE /skills/{skill_id}

Delete a skill

POST /skills/{skill_id}/versions

Upload a new skill version

GET /skills/{skill_id}/versions/{version}

Get a skill version

GET /skills/{skill_id}/versions

List skill versions

GET /skills/{skill_id}/versions/{version}/content

Download a skill package

Vault

POST /vaults

Create a Vault

GET /vaults/{vault_id}

Retrieve a Vault

GET /vaults

List Vaults

POST /vaults/{vault_id}

Update a Vault

DELETE /vaults/{vault_id}

Delete a Vault

POST /vaults/{vault_id}/archive

Archive a Vault

Credential

POST /vaults/{vault_id}/credentials

Create a Credential

GET /vaults/{vault_id}/credentials/{credential_id}

Retrieve a Credential

GET /vaults/{vault_id}/credentials

List 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}/archive

Archive a Credential

Webhook

POST /webhook_endpoints

Create a Webhook

GET /webhook_endpoints/{id}

Retrieve a Webhook

GET /webhook_endpoints

List Webhooks

PUT /webhook_endpoints/{id}

Update a Webhook

DELETE /webhook_endpoints/{id}

Delete a Webhook

POST /webhook_endpoints/{id}/enable

Enable a Webhook

POST /webhook_endpoints/{id}/disable

Disable a Webhook

POST /webhook_endpoints/{id}/test

Test a Webhook

POST /webhook_endpoints/{id}/reset_secret

Reset the signing secret

GET /webhook_endpoints/{id}/events

List webhook events

Managed Agent API
Flow Agent API
Sandbox API
RAG API
Long-term Memory
ParseX API
Security API
Framework Integration