<span id="更新智能体团队"></span>

# Update an agent team

```{raw} html
<div class="mo-api-page-show-toc" aria-hidden="true"></div>
```

Change a team's name or description and validate its profile version.


```http
PATCH https://api.moi.matrixorigin.cn/v5/workspaces/{workspace_id}/agent-teams/{team_id}
```

<span id="调用前准备"></span>

## Before you call this API

Set `BASE_URL` to the product API prefix `https://api.moi.matrixorigin.cn/v5`; use the corresponding product API URL for a dedicated deployment.

[Prepare product identity and object identifiers in the same environment](objects.md#prepare).

<span id="请求"></span>

## Request

:::::::{div} mo-api-tabs
::::::{tab-set}
:::::{tab-item} Request example

```bash
curl --request PATCH \
  "$BASE_URL/workspaces/$WORKSPACE_ID/agent-teams/$TEAM_ID" \
  --header "X-API-Key: $MOI_KEY" \
  --header "X-Workspace-ID: $WORKSPACE_ID" \
  --header "Content-Type: application/json" \
  --data '{"description":"","expected_version":1}'
```

:::::
:::::{tab-item} Parameters

| Parameter | Location | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `workspace_id` | Path | string | Yes | Current workspace ID; keep the product identity and headers in the same environment. |
| `team_id` | Path | string | Yes | Team ID from the team list or creation response. |
| `name` | Body | string or null | No | New name; if supplied, must be nonempty after trimming whitespace. |
| `description` | Body | string or null | No | New description; an empty string clears it. |
| `expected_version` | Body | integer | Yes | Current team version, a positive integer. |

Supply at least name or description. Omission or null retains the old value; description="" clears it. A blank name is rejected. Use team version. Concurrent membership changes can also cause conflicts; reread the current object.

:::::
::::::
:::::::

<span id="成功响应"></span>

## Successful response

:::::::{div} mo-api-tabs mo-api-response-tabs
::::::{tab-set}
:::::{tab-item} Response example

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

:::::
:::::{tab-item} Fields

| Field | Type | Description |
| --- | --- | --- |
| `code` | integer | 0 on success. |
| `data` | object | [Corresponding response object](objects.md#responses). |

HTTP 200. Returns the [corresponding object](objects.md#responses). Confirm writes with the corresponding read action.

:::::
::::::
:::::::

<span id="错误响应"></span>

## Error responses

[Errors and concurrency handling](lifecycle.md#errors) distinguishes parameter, version, member/session state, and admission failures.
