# Bulk Assign/Remove Tags from Email Accounts

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /account/bulk-assign-tags:
    put:
      summary: Bulk Assign/Remove Tags from Email Accounts
      deprecated: false
      description: |-
        description: |
          This endpoint allows you to assign or remove tags from multiple email accounts simultaneously.
          You can either assign a tag to email accounts or remove a tag from email accounts in a single operation.
          
          **Required Fields:**
          - `ids`: Array of email account IDs to update
          - `tag_id`: ID of the tag to assign or remove
          - `action`: Whether to assign or remove the tag (ASSIGN/UNASSIGN)
          
          **Note:** This operation will affect email accounts associated with campaigns. If tags are added or removed, campaigns using those tags will automatically update their email account lists.
      tags:
        - Email Account
        - Email Accounts
        - Tags
      parameters:
        - name: x-api-key
          in: header
          description: Your PlusVibe.ai account's API Key
          required: false
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - workspace_id
                - ids
                - tag_id
                - action
              properties:
                workspace_id:
                  type: string
                  pattern: ^[0-9a-fA-F]{24}$
                  description: workspace identifier
                  examples:
                    - 507f1f77bcf86cd799439011
                ids:
                  type: array
                  description: Array of email account IDs to assign/remove tags from
                  minItems: 1
                  items:
                    type: string
                    pattern: ^[0-9a-fA-F]{24}$
                  examples:
                    - - 507f1f77bcf86cd799439012
                      - 507f1f77bcf86cd799439013
                      - 507f1f77bcf86cd799439014
                tag_id:
                  type: string
                  pattern: ^[0-9a-fA-F]{24}$
                  description: tag id
                  examples:
                    - 507f1f77bcf86cd799439015
                action:
                  type: string
                  enum:
                    - ASSIGN
                    - UNASSIGN
                  description: >
                    Action to perform on the email accounts:

                    - **ASSIGN**: Add the specified tag to the email accounts

                    - **UNASSIGN**: Remove the specified tag from the email
                    accounts
                  examples:
                    - ASSIGN
              x-apidog-orders:
                - workspace_id
                - ids
                - tag_id
                - action
            examples:
              assign_tag_multiple:
                value:
                  workspace_id: 507f1f77bcf86cd799439011
                  ids:
                    - 507f1f77bcf86cd799439012
                    - 507f1f77bcf86cd799439013
                    - 507f1f77bcf86cd799439014
                  tag_id: 507f1f77bcf86cd799439015
                  action: ASSIGN
                summary: Assign tag to multiple email accounts
                description: >-
                  Add a "VIP Clients" tag to multiple email accounts for
                  campaign organization
              unassign_tag_multiple:
                value:
                  workspace_id: 507f1f77bcf86cd799439011
                  ids:
                    - 507f1f77bcf86cd799439016
                    - 507f1f77bcf86cd799439017
                    - 507f1f77bcf86cd799439018
                  tag_id: 507f1f77bcf86cd799439019
                  action: UNASSIGN
                summary: Remove tag from multiple email accounts
                description: >-
                  Remove an outdated "Q1_Campaign" tag from multiple email
                  accounts
              assign_tag_single:
                value:
                  workspace_id: 507f1f77bcf86cd799439011
                  ids:
                    - 507f1f77bcf86cd799439020
                  tag_id: 507f1f77bcf86cd799439021
                  action: ASSIGN
                summary: Assign tag to single email account
                description: Add a "High Priority" tag to one specific email account
              unassign_tag_single:
                value:
                  workspace_id: 507f1f77bcf86cd799439011
                  ids:
                    - 507f1f77bcf86cd799439022
                  tag_id: 507f1f77bcf86cd799439023
                  action: UNASSIGN
                summary: Remove tag from single email account
                description: Remove a "Temporary" tag from one email account
      responses:
        '200':
          description: Tag assignment/removal completed successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  status:
                    type: string
                x-apidog-orders:
                  - status
              example:
                status: success
          headers: {}
          x-apidog-name: OK
      security: []
      x-apidog-folder: Email Account
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/929054/apis/api-21396110-run
components:
  schemas: {}
  securitySchemes:
    ApiKeyAuth:
      type: apikey
      in: header
      name: x-api-key
      description: |
        API key issued in the PlusVibe dashboard. The server reads it
        from the `x-api-key` header and injects it into the request as
        the `api_key` query parameter, which is why you will see
        `api_key` referenced in validation errors.
    apiKey:
      type: apikey
      in: body
      name: api_key
      description: API key passed in request body
servers:
  - url: https://api.plusvibe.ai/api/v1
    description: Prod Env
security:
  - ApiKeyAuth: []
    x-apidog:
      schemeGroups:
        - id: uS5KiuC4wfZHK42AzOfA_
          schemeIds:
            - ApiKeyAuth
      required: true
      use:
        id: uS5KiuC4wfZHK42AzOfA_
      scopes:
        uS5KiuC4wfZHK42AzOfA_:
          ApiKeyAuth: []

```
