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

# Attach or detach labels to/from UTXOs

> Attach or detach labels to/from UTXOs in a vault account. Labels can be used for organizing and filtering UTXOs.
Labels are applied additively — `labelsToAttach` adds to the existing label set and `labelsToDetach` removes from it. Neither operation replaces the full set.
**Note:** These endpoints are currently in beta and might be subject to changes.
Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor.



## OpenAPI

````yaml https://docs.fireblocks.com/api/v1/swagger.yaml patch /utxo_management/{vaultAccountId}/{assetId}/labels
openapi: 3.0.0
info:
  title: Fireblocks API
  description: >
    Fireblocks provides a suite of applications to manage digital asset
    operations and a complete development platform to build your business on the
    blockchain.


    - Visit our website for more information: [Fireblocks
    Website](https://fireblocks.com)

    - Visit our developer docs: [Fireblocks
    DevPortal](https://developers.fireblocks.com)
  version: 1.6.2
  contact:
    email: developers@fireblocks.com
servers:
  - url: https://api.fireblocks.io/v1
    description: Fireblocks Production Environment Base URL
  - url: https://sandbox-api.fireblocks.io/v1
    description: Fireblocks Sandbox Environment Base URL
security: []
paths:
  /utxo_management/{vaultAccountId}/{assetId}/labels:
    patch:
      tags:
        - UTXO Management (Beta)
      summary: Attach or detach labels to/from UTXOs
      description: >-
        Attach or detach labels to/from UTXOs in a vault account. Labels can be
        used for organizing and filtering UTXOs.

        Labels are applied additively — `labelsToAttach` adds to the existing
        label set and `labelsToDetach` removes from it. Neither operation
        replaces the full set.

        **Note:** These endpoints are currently in beta and might be subject to
        changes.

        Endpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor.
      operationId: updateUtxoLabels
      parameters:
        - in: path
          name: vaultAccountId
          required: true
          description: The ID of the vault account
          schema:
            type: string
            format: numeric
            x-fb-entity: vault_account
        - in: path
          name: assetId
          required: true
          description: The ID of the asset
          schema:
            type: string
            x-fb-entity: asset
        - $ref: '#/components/parameters/X-Idempotency-Key'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AttachDetachUtxoLabelsRequest'
      responses:
        '200':
          description: UTXOs with updated labels
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AttachDetachUtxoLabelsResponse'
        default:
          $ref: '#/components/responses/Error'
      x-codeSamples:
        - lang: TypeScript
          source: >-
            const response:
            Promise<FireblocksResponse<AttachDetachUtxoLabelsResponse>> =
            fireblocks.uTXOManagementBeta.updateUtxoLabels(uTXOManagementBetaApiUpdateUtxoLabelsRequest);
        - lang: Java
          source: >-
            CompletableFuture<ApiResponse<AttachDetachUtxoLabelsResponse>>
            response =
            fireblocks.uTXOManagementBeta().updateUtxoLabels(attachDetachUtxoLabelsRequest,
            vaultAccountId, assetId, idempotencyKey);
        - lang: Python
          source: >-
            response =
            fireblocks.u_t_x_o_management_beta.update_utxo_labels(attach_detach_utxo_labels_request,
            vault_account_id, asset_id, idempotency_key);
components:
  parameters:
    X-Idempotency-Key:
      name: Idempotency-Key
      in: header
      description: >-
        A unique identifier for the request. If the request is sent multiple
        times with the same idempotency key, the server will return the same
        response as the first request. The idempotency key is valid for 24
        hours.
      required: false
      schema:
        type: string
  schemas:
    AttachDetachUtxoLabelsRequest:
      type: object
      properties:
        utxoIdentifiers:
          description: List of UTXO identifiers to apply label changes to
          type: array
          minItems: 1
          maxItems: 200
          items:
            $ref: '#/components/schemas/UtxoIdentifier'
        labelsToAttach:
          description: >-
            Labels to attach to the specified UTXOs. At least one of
            labelsToAttach or labelsToDetach must be provided.
          example:
            - cold-storage
            - vip
          type: array
          minItems: 1
          maxItems: 5
          items:
            type: string
            maxLength: 30
            pattern: ^[a-z0-9][a-z0-9_-]*$
        labelsToDetach:
          description: >-
            Labels to detach from the specified UTXOs. At least one of
            labelsToAttach or labelsToDetach must be provided.
          example:
            - deprecated
          type: array
          minItems: 1
          maxItems: 5
          items:
            type: string
            maxLength: 30
            pattern: ^[a-z0-9][a-z0-9_-]*$
      required:
        - utxoIdentifiers
    AttachDetachUtxoLabelsResponse:
      type: object
      properties:
        utxos:
          type: array
          description: Modified UTXOs with updated labels
          items:
            $ref: '#/components/schemas/UtxoOutput'
    UtxoIdentifier:
      type: object
      description: >-
        Identifies a UTXO by either a Fireblocks transaction ID (targets all
        outputs of that transaction)

        or a specific on-chain UTXO (txHash + vout). Exactly one of these two
        forms must be provided.
      properties:
        txId:
          type: string
          description: Fireblocks transaction ID
          example: b70701f4-d7b1-4795-a8ee-b09cdb5b850e
        txHash:
          type: string
          description: On-chain transaction hash
          example: b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c
        vout:
          type: integer
          description: Output index
          example: 0
    UtxoOutput:
      type: object
      required:
        - input
        - utxoId
        - address
        - amount
        - status
      properties:
        input:
          $ref: '#/components/schemas/UtxoInput-2'
        utxoId:
          type: string
          description: The unique UTXO identifier
          example: '123456'
        address:
          type: string
          description: The address holding this UTXO
          example: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa
        amount:
          type: string
          description: The UTXO amount in the asset's native unit
          example: '0.00150000'
        confirmations:
          type: integer
          description: Number of confirmations
          example: 6
        status:
          type: string
          description: The UTXO status
          example: AVAILABLE
          enum:
            - PENDING
            - AVAILABLE
            - FROZEN
            - SELECTED
        isChange:
          type: boolean
          description: Whether this is a change output
          example: false
        isCoinbase:
          type: boolean
          description: Whether this is a coinbase output
          example: false
        fbTxId:
          type: string
          description: The Fireblocks transaction ID that created this UTXO
          example: b70701f4-d7b1-4795-a8ee-b09cdb5b850e
        createdByHash:
          type: string
          description: The on-chain block hash where this UTXO was created
          example: 000000000000000000024bead8df69990852c202db0e0097c1a12ea637d7e96d
        spentByFbTxId:
          type: array
          description: Fireblocks transaction IDs that selected/spent this UTXO
          example:
            - b70701f4-d7b1-4795-a8ee-b09cdb5b850e
          items:
            type: string
        createdByHeight:
          type: integer
          description: The block height at which this UTXO was created
          example: 800100
        createdAt:
          type: string
          format: date-time
          description: The timestamp when this UTXO was created
          example: '2025-01-16T15:45:00Z'
        updatedAt:
          type: string
          format: date-time
          description: The timestamp when this UTXO was last updated
          example: '2025-01-16T15:45:00Z'
        labels:
          type: array
          description: Labels attached to this UTXO
          example:
            - cold-storage
            - vip
          items:
            type: string
    ErrorSchema:
      type: object
      properties:
        message:
          type: string
        code:
          type: number
    UtxoInput-2:
      type: object
      properties:
        txHash:
          type: string
          description: The transaction hash
          example: b34f0c3ce612f1e5a5c19d6b1e6b5e3e7f1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c
        index:
          type: integer
          description: The output index (vout)
          example: 0
  headers:
    X-Request-ID:
      schema:
        type: string
      description: >-
        Unique ID correlated to the API request. Please provide it in any
        support ticket you create or on Github issues related to Fireblocks SDKs
  responses:
    Error:
      description: Error Response
      headers:
        X-Request-ID:
          $ref: '#/components/headers/X-Request-ID'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorSchema'

````