> ## 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.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://developers.fireblocks.com/feedback

```json
{
  "path": "/api-reference/vaults/attach-or-detach-tags-from-vault-accounts",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Attach or detach tags from vault accounts

> Attach or detach one or more tags from the requested vault accounts.
Endpoint Permission: For protected tags: Owner, Admin, Non-Signing Admin. For non protected tags: Owner, Admin, Non-Signing Admin, Signer, Editor, Approver.



## OpenAPI

````yaml https://docs.fireblocks.com/api/v1/swagger.yaml post /vault/accounts/attached_tags
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:
  /vault/accounts/attached_tags:
    post:
      tags:
        - Vaults
      summary: Attach or detach tags from vault accounts
      description: >-
        Attach or detach one or more tags from the requested vault accounts.

        Endpoint Permission: For protected tags: Owner, Admin, Non-Signing
        Admin. For non protected tags: Owner, Admin, Non-Signing Admin, Signer,
        Editor, Approver.
      operationId: attachOrDetachTagsFromVaultAccounts
      parameters:
        - $ref: '#/components/parameters/X-Idempotency-Key'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VaultAccountsTagAttachmentOperationsRequest'
      responses:
        '200':
          description: Tags were attached/detached successfully
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/VaultAccountsTagAttachmentOperationsResponse
        '400':
          description: |
            - Invalid request parameters.
            - Same tag ID is provided in both tagIdsToAttach and tagIdsToDetach.
            - Vault accounts are archived.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
        '404':
          description: |
            - Tags with the requested ID not found.
            - Vault accounts with the requested ID not found.
          headers:
            X-Request-ID:
              $ref: '#/components/headers/X-Request-ID'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorSchema'
      x-codeSamples:
        - lang: TypeScript
          source: >-
            const response:
            Promise<FireblocksResponse<VaultAccountsTagAttachmentOperationsResponse>>
            =
            fireblocks.vaults.attachOrDetachTagsFromVaultAccounts(vaultsApiAttachOrDetachTagsFromVaultAccountsRequest);
        - lang: Java
          source: >-
            CompletableFuture<ApiResponse<VaultAccountsTagAttachmentOperationsResponse>>
            response =
            fireblocks.vaults().attachOrDetachTagsFromVaultAccounts(vaultAccountsTagAttachmentOperationsRequest,
            idempotencyKey);
        - lang: Python
          source: >-
            response =
            fireblocks.vaults.attach_or_detach_tags_from_vault_accounts(vault_accounts_tag_attachment_operations_request,
            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:
    VaultAccountsTagAttachmentOperationsRequest:
      type: object
      properties:
        vaultAccountIds:
          description: The IDs of the vault accounts to attach tags to
          example:
            - '0'
            - '1'
          type: array
          minItems: 1
          maxItems: 100
          items:
            type: string
            format: numeric
        tagIdsToAttach:
          description: The IDs of the tags to attach
          example:
            - df4c0987-30da-4976-8dcf-bc2dd41ae331
            - a1b2c3d4-e5f6-7890-abcd-ef1234567890
          type: array
          minItems: 1
          maxItems: 20
          items:
            type: string
            format: uuid
        tagIdsToDetach:
          description: The IDs of the tags to detach
          example:
            - df4c0987-30da-4976-8dcf-bc2dd41ae331
            - a1b2c3d4-e5f6-7890-abcd-ef1234567890
          type: array
          minItems: 1
          maxItems: 20
          items:
            type: string
            format: uuid
      required:
        - vaultAccountIds
    VaultAccountsTagAttachmentOperationsResponse:
      type: object
      properties:
        appliedOperations:
          description: The operations that were applied
          type: array
          items:
            $ref: '#/components/schemas/VaultAccountTagAttachmentOperation'
        pendingOperations:
          description: The operations that are pending
          type: array
          items:
            $ref: '#/components/schemas/VaultAccountTagAttachmentPendingOperation'
        rejectedOperations:
          description: The operations that were rejected
          type: array
          items:
            $ref: '#/components/schemas/VaultAccountTagAttachmentRejectedOperation'
    ErrorSchema:
      type: object
      properties:
        message:
          type: string
        code:
          type: number
    VaultAccountTagAttachmentOperation:
      type: object
      properties:
        vaultAccountId:
          description: The ID of the vault account
          example: '1'
          type: string
          format: numeric
        tagId:
          description: Tag ID
          example: f0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
          type: string
          format: uuid
        action:
          $ref: '#/components/schemas/TagAttachmentOperationAction'
      required:
        - vaultAccountId
        - tagId
        - action
    VaultAccountTagAttachmentPendingOperation:
      type: object
      properties:
        vaultAccountId:
          description: The ID of the vault account
          example: '1'
          type: string
          format: numeric
        tagId:
          description: Tag ID
          example: f0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
          type: string
          format: uuid
        action:
          $ref: '#/components/schemas/TagAttachmentOperationAction'
        approvalRequestId:
          description: Pending approval request ID
          example: '12345'
          type: string
      required:
        - vaultAccountId
        - tagId
        - action
        - approvalRequestId
    VaultAccountTagAttachmentRejectedOperation:
      type: object
      properties:
        vaultAccountId:
          description: The ID of the vault account
          example: '1'
          type: string
          format: numeric
        tagId:
          description: Tag ID
          example: f0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11
          type: string
          format: uuid
        action:
          $ref: '#/components/schemas/TagAttachmentOperationAction'
        reason:
          description: Reason for rejection
          type: string
          enum:
            - CAPACITY_EXCEEDED
            - ATTACHMENT_ALREADY_EXISTS
            - ATTACHMENT_DOES_NOT_EXIST
            - PENDING_REQUEST_EXISTS
      required:
        - vaultAccountId
        - tagId
        - action
        - reason
    TagAttachmentOperationAction:
      type: string
      enum:
        - ATTACH
        - DETACH
  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

````