# Batch set Cloud Phone tags

Overwrite tags on the selected resources. Requires tag-management permission and access to the targets. Tags are matched by exact name within the team: missing tags are created, existing tags are reused and their color is updated. This color change also affects other resources using the same tag. Names must be unique within the request. An empty `tags` array clears only tag assignments; tag definitions and groups are retained. Completion is synchronous and `data` is null. After a timeout, query the target resources and `/api/envtag/all` before retrying; there is no idempotency key.
Documented business errors: `15003`, `15004`, `33300`. See [Error Codes](/api-reference/getting-started/error-codes) for what each code means. Any operation can additionally return the common codes.

Endpoint: POST /api/cloudphone/setTags/batch
Version: 2026-09-05

## Request fields (application/json):

  - `ids` (array, required)
    Cloud Phone IDs. Existing accessible phones are resolved using the existing batch-phone validation; do not assume every supplied ID was updated. Query the phones to confirm assignments.

  - `tags` (array, required)
    Tags replacing all current tag assignments. An empty array clears assignments without deleting tag definitions.

  - `tags.tagName` (string, required)
    Tag name, matched exactly within the team. Duplicate names in one request are rejected.

  - `tags.tagColor` (any)
    Tag color. Omitted or blank uses red; named colors only, not hexadecimal values.

## Request examples:

  - `replace` (unknown)

  - `clear` (unknown)

## Response 200:

  - `200` (unknown)
    Success. Tag assignments have been updated synchronously; data is null.

## Response 200 fields (application/json):

  - `code` (integer)
    Example: 0

  - `msg` (string | null)

  - `requestId` (string)

  - `data` (null)

