Create an agent team

Create an agent team with explicitly maintained members.

POST https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agent-teams

Before you call this API

Set BASE_URL to the product API prefix https://api.moi.matrixorigin.cn/v5. For private deployments, use the corresponding product API URL.

Prepare product identity and object identifiers in the same environment.

Request

curl --request POST \
  "$BASE_URL/workspaces/$WORKSPACE_ID/agent-teams" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID" \
  --header "Content-Type: application/json" \
  --data '{"name":"资料整理团队","description":"整理与核对资料","members":[{"agent_workspace_id":"workspace-example","agent_id":"agent-example"}]}'

Parameter

Location

Type

Required

Description

workspace_id

Path

string

Yes

Current Workspace ID, consistent with the product identity and request headers in the same environment.

name

Body

string

Yes

Team name.

description

Body

string

No

Team description.

members

Body

array (member references)

No

Member references; each combination must be unique.

Save id, version, and membership_version from the response. Initial members use agent definition Workspace and agent ID pairs. Omitted/null/empty members can create an empty team, but an empty team cannot submit a run. The trimmed creation name must be nonempty and at most 128 bytes.

Successful response

{
  "code": 0,
  "data": {
    "id": "team-example",
    "workspace_id": "workspace-example",
    "owner_user_id": "user-example",
    "name": "资料整理团队",
    "status": "active",
    "version": 1,
    "membership_version": 2,
    "created_at": "2026-11-12T01:00:00Z",
    "updated_at": "2026-11-12T01:00:00Z",
    "description": "整理与核对资料"
  }
}

Field

Type

Description

code

integer

0 on success.

data

object

Corresponding response object.

HTTP201. Returns the corresponding object; confirm writes with the corresponding read operation.

Error responses

Errors and concurrency handling distinguishes parameter, version, member/conversation state, and admission failures.

Last updated on