> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hybridbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 标签

> 管理资源标签和标签分配。

# 标签

管理资源标签和标签分配。

<script src="/locale-bridge.js" />

示例使用 A2A 代码模式。MCP 通过 `execute` 工具公开相同的代码模式。

## 函数

### `tags.add`

```text theme={null}
tags.add(account_id: str, tag_name: str, color_hex?: str, description?: str | null) -> Tag
```

标签: `tags.add`.

| 属性        | 值                                            | 属性       | 值            |
| --------- | -------------------------------------------- | -------- | ------------ |
| 所需权限      | `tag.manage`                                 | 需要身份验证   | `是`          |
| 执行模式      | `sync`                                       | 能力       | `tag.manage` |
| 资源类型      | `account`                                    | 资源 ID 字段 | `account_id` |
| 公共 API 路由 | `POST /v1/public/accounts/{account_id}/tags` |          |              |

<AccordionGroup>
  <Accordion title="参数">
    | 名称            | 类型            | 必需 |
    | ------------- | ------------- | -- |
    | `account_id`  | `str`         | 是  |
    | `tag_name`    | `str`         | 是  |
    | `color_hex`   | `str`         | 否  |
    | `description` | `str \| null` | 否  |
  </Accordion>

  <Accordion title="返回值">
    | 字段            | 类型            | 必需 |
    | ------------- | ------------- | -- |
    | `color_hex`   | `str`         | 是  |
    | `id`          | `str`         | 是  |
    | `name`        | `str`         | 是  |
    | `created_at`  | `str \| null` | 否  |
    | `description` | `str \| null` | 否  |
    | `updated_at`  | `str \| null` | 否  |
  </Accordion>

  <Accordion title="A2A 示例">
    请求:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "tags.add(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", tag_name=\"<string>\", color_hex=\"<string>\", description=\"<string>\")"
    }
    ```

    响应:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": "<string>"
      },
      "responses": [
        {
          "index": 0,
          "function": "tags.add",
          "status": "completed",
          "result": "<string>"
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="MCP 示例">
    请求:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "tags.add(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", tag_name=\"<string>\", color_hex=\"<string>\", description=\"<string>\")"
        }
      }
    }
    ```

    响应:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": \"<string>\"\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"tags.add\",\n      \"status\": \"completed\",\n      \"result\": \"<string>\"\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### `tags.delete`

```text theme={null}
tags.delete(account_id: str, tag_id: str) -> {}
```

标签: `tags.delete`.

| 属性        | 值                                                       | 属性       | 值            |
| --------- | ------------------------------------------------------- | -------- | ------------ |
| 所需权限      | `tag.manage`                                            | 需要身份验证   | `是`          |
| 执行模式      | `sync`                                                  | 能力       | `tag.manage` |
| 资源类型      | `account`                                               | 资源 ID 字段 | `account_id` |
| 公共 API 路由 | `DELETE /v1/public/accounts/{account_id}/tags/{tag_id}` |          |              |

<AccordionGroup>
  <Accordion title="参数">
    | 名称           | 类型    | 必需 |
    | ------------ | ----- | -- |
    | `account_id` | `str` | 是  |
    | `tag_id`     | `str` | 是  |
  </Accordion>

  <Accordion title="返回值">
    | 字段       | 类型   | 必需 |
    | -------- | ---- | -- |
    | `result` | `{}` | 是  |
  </Accordion>

  <Accordion title="A2A 示例">
    请求:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "tags.delete(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", tag_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\")"
    }
    ```

    响应:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": {}
      },
      "responses": [
        {
          "index": 0,
          "function": "tags.delete",
          "status": "completed",
          "result": {}
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="MCP 示例">
    请求:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "tags.delete(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", tag_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\")"
        }
      }
    }
    ```

    响应:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": {}\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"tags.delete\",\n      \"status\": \"completed\",\n      \"result\": {}\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### `tags.domains.assign`

```text theme={null}
tags.domains.assign(account_id: str, tag_id: str, domain_ids: [str]) -> Tag
```

标签: `tags.domains.assign`.

| 属性        | 值                                                                    | 属性       | 值            |
| --------- | -------------------------------------------------------------------- | -------- | ------------ |
| 所需权限      | `tag.manage`                                                         | 需要身份验证   | `是`          |
| 执行模式      | `sync`                                                               | 能力       | `tag.manage` |
| 资源类型      | `account`                                                            | 资源 ID 字段 | `account_id` |
| 公共 API 路由 | `POST /v1/public/accounts/{account_id}/tags/{tag_id}/domains/assign` |          |              |

<AccordionGroup>
  <Accordion title="参数">
    | 名称           | 类型      | 必需 |
    | ------------ | ------- | -- |
    | `account_id` | `str`   | 是  |
    | `tag_id`     | `str`   | 是  |
    | `domain_ids` | `[str]` | 是  |
  </Accordion>

  <Accordion title="返回值">
    | 字段           | 类型      | 必需 |
    | ------------ | ------- | -- |
    | `domain_ids` | `[str]` | 是  |
    | `tag_id`     | `str`   | 是  |
  </Accordion>

  <Accordion title="A2A 示例">
    请求:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "tags.domains.assign(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", tag_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", domain_ids=\"example.com\")"
    }
    ```

    响应:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": {
          "domain_ids": [
            "<string>"
          ],
          "tag_id": "<string>"
        }
      },
      "responses": [
        {
          "index": 0,
          "function": "tags.domains.assign",
          "status": "completed",
          "result": {
            "domain_ids": [
              "<string>"
            ],
            "tag_id": "<string>"
          }
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="MCP 示例">
    请求:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "tags.domains.assign(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", tag_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", domain_ids=\"example.com\")"
        }
      }
    }
    ```

    响应:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": {\n      \"domain_ids\": [\n        \"<string>\"\n      ],\n      \"tag_id\": \"<string>\"\n    }\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"tags.domains.assign\",\n      \"status\": \"completed\",\n      \"result\": {\n        \"domain_ids\": [\n          \"<string>\"\n        ],\n        \"tag_id\": \"<string>\"\n      }\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### `tags.domains.unassign`

```text theme={null}
tags.domains.unassign(account_id: str, tag_id: str, domain_ids: [str]) -> {}
```

标签: `tags.domains.unassign`.

| 属性        | 值                                                                      | 属性       | 值            |
| --------- | ---------------------------------------------------------------------- | -------- | ------------ |
| 所需权限      | `tag.manage`                                                           | 需要身份验证   | `是`          |
| 执行模式      | `sync`                                                                 | 能力       | `tag.manage` |
| 资源类型      | `account`                                                              | 资源 ID 字段 | `account_id` |
| 公共 API 路由 | `POST /v1/public/accounts/{account_id}/tags/{tag_id}/domains/unassign` |          |              |

<AccordionGroup>
  <Accordion title="参数">
    | 名称           | 类型      | 必需 |
    | ------------ | ------- | -- |
    | `account_id` | `str`   | 是  |
    | `tag_id`     | `str`   | 是  |
    | `domain_ids` | `[str]` | 是  |
  </Accordion>

  <Accordion title="返回值">
    | 字段       | 类型   | 必需 |
    | -------- | ---- | -- |
    | `result` | `{}` | 是  |
  </Accordion>

  <Accordion title="A2A 示例">
    请求:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "tags.domains.unassign(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", tag_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", domain_ids=\"example.com\")"
    }
    ```

    响应:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": {}
      },
      "responses": [
        {
          "index": 0,
          "function": "tags.domains.unassign",
          "status": "completed",
          "result": {}
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="MCP 示例">
    请求:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "tags.domains.unassign(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", tag_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", domain_ids=\"example.com\")"
        }
      }
    }
    ```

    响应:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": {}\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"tags.domains.unassign\",\n      \"status\": \"completed\",\n      \"result\": {}\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### `tags.list`

```text theme={null}
tags.list(account_id: str, page?: int, page_size?: int) -> Page[Tag]
```

标签: `tags.list`.

| 属性        | 值                                           | 属性       | 值            |
| --------- | ------------------------------------------- | -------- | ------------ |
| 所需权限      | `tag.view`                                  | 需要身份验证   | `是`          |
| 执行模式      | `sync`                                      | 能力       | `tag.view`   |
| 资源类型      | `account`                                   | 资源 ID 字段 | `account_id` |
| 公共 API 路由 | `GET /v1/public/accounts/{account_id}/tags` |          |              |

<AccordionGroup>
  <Accordion title="参数">
    | 名称           | 类型    | 必需 |
    | ------------ | ----- | -- |
    | `account_id` | `str` | 是  |
    | `page`       | `int` | 否  |
    | `page_size`  | `int` | 否  |
  </Accordion>

  <Accordion title="返回值">
    | 字段          | 类型                                                                                                                                  | 必需 |
    | ----------- | ----------------------------------------------------------------------------------------------------------------------------------- | -- |
    | `items`     | `[{"color_hex": str, "id": str, "name": str, "created_at"?: str \| null, "description"?: str \| null, "updated_at"?: str \| null}]` | 是  |
    | `page`      | `int`                                                                                                                               | 是  |
    | `page_size` | `int`                                                                                                                               | 是  |
    | `total`     | `int`                                                                                                                               | 是  |
  </Accordion>

  <Accordion title="A2A 示例">
    请求:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "tags.list(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", page=123, page_size=123)"
    }
    ```

    响应:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": "<string>"
      },
      "responses": [
        {
          "index": 0,
          "function": "tags.list",
          "status": "completed",
          "result": "<string>"
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="MCP 示例">
    请求:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "tags.list(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", page=123, page_size=123)"
        }
      }
    }
    ```

    响应:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": \"<string>\"\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"tags.list\",\n      \"status\": \"completed\",\n      \"result\": \"<string>\"\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>

### `tags.update`

```text theme={null}
tags.update(account_id: str, tag_id: str, color_hex?: str | null, description?: str | null, tag_name?: str | null) -> Tag
```

标签: `tags.update`.

| 属性        | 值                                                      | 属性       | 值            |
| --------- | ------------------------------------------------------ | -------- | ------------ |
| 所需权限      | `tag.manage`                                           | 需要身份验证   | `是`          |
| 执行模式      | `sync`                                                 | 能力       | `tag.manage` |
| 资源类型      | `account`                                              | 资源 ID 字段 | `account_id` |
| 公共 API 路由 | `PATCH /v1/public/accounts/{account_id}/tags/{tag_id}` |          |              |

<AccordionGroup>
  <Accordion title="参数">
    | 名称            | 类型            | 必需 |
    | ------------- | ------------- | -- |
    | `account_id`  | `str`         | 是  |
    | `tag_id`      | `str`         | 是  |
    | `color_hex`   | `str \| null` | 否  |
    | `description` | `str \| null` | 否  |
    | `tag_name`    | `str \| null` | 否  |
  </Accordion>

  <Accordion title="返回值">
    | 字段            | 类型            | 必需 |
    | ------------- | ------------- | -- |
    | `color_hex`   | `str`         | 是  |
    | `id`          | `str`         | 是  |
    | `name`        | `str`         | 是  |
    | `created_at`  | `str \| null` | 否  |
    | `description` | `str \| null` | 否  |
    | `updated_at`  | `str \| null` | 否  |
  </Accordion>

  <Accordion title="A2A 示例">
    请求:

    ```json theme={null}
    {
      "request_id": "example",
      "session_id": "session_123",
      "code": "tags.update(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", tag_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", color_hex=\"<string>\", description=\"<string>\", tag_name=\"<string>\")"
    }
    ```

    响应:

    ```json theme={null}
    {
      "request_id": "example",
      "status": "completed",
      "result": {
        "last_value": "<string>"
      },
      "responses": [
        {
          "index": 0,
          "function": "tags.update",
          "status": "completed",
          "result": "<string>"
        }
      ],
      "complexity_score": 1
    }
    ```
  </Accordion>

  <Accordion title="MCP 示例">
    请求:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "method": "tools/call",
      "params": {
        "name": "hybridbox_execute",
        "arguments": {
          "code": "tags.update(account_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", tag_id=\"3c90c3cc-0d44-4b50-8888-8dd25736052a\", color_hex=\"<string>\", description=\"<string>\", tag_name=\"<string>\")"
        }
      }
    }
    ```

    响应:

    ```json theme={null}
    {
      "jsonrpc": "2.0",
      "id": "example",
      "result": {
        "content": [
          {
            "type": "text",
            "text": "{\n  \"request_id\": \"example\",\n  \"status\": \"completed\",\n  \"result\": {\n    \"last_value\": \"<string>\"\n  },\n  \"responses\": [\n    {\n      \"index\": 0,\n      \"function\": \"tags.update\",\n      \"status\": \"completed\",\n      \"result\": \"<string>\"\n    }\n  ],\n  \"complexity_score\": 1\n}"
          }
        ],
        "isError": false
      }
    }
    ```
  </Accordion>
</AccordionGroup>
