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

# Update Contacts Tags

> Allows you to update tags to multiple contacts at once, you can add or remove tags from the contacts



## OpenAPI

````yaml /api-reference/contacts/openapi.json post /contacts/bulk/tags/update/{type}
openapi: 3.0.0
info:
  title: Contacts API
  description: Documentation for Contacts API
  version: '1.0'
  contact: {}
servers:
  - url: https://services.leadconnectorhq.com
security: []
tags:
  - name: Contacts
    description: Documentation for Contacts API
  - name: Tasks
    description: Documentation for Contacts API
  - name: Appointments
    description: Documentation for Contacts API
  - name: Tags
    description: Documentation for Contacts API
  - name: Notes
    description: Documentation for Contacts API
  - name: Campaigns
    description: Documentation for Contacts API
  - name: Workflow
    description: Documentation for Contacts API
  - name: Bulk
    description: Documentation for Contacts API
  - name: Search
    description: Documentation for Contacts API
  - name: Followers
    description: Documentation for Contacts API
paths:
  /contacts/bulk/tags/update/{type}:
    post:
      tags:
        - Bulk
      summary: Update Contacts Tags
      description: >-
        Allows you to update tags to multiple contacts at once, you can add or
        remove tags from the contacts
      operationId: create-association
      parameters:
        - name: Version
          in: header
          description: API Version
          required: true
          schema:
            type: string
            enum:
              - '2021-07-28'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTagsDTO'
      responses:
        '201':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateTagsResponseDTO'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestDTO'
        '422':
          description: Unprocessable Entity
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnprocessableDTO'
components:
  schemas:
    UpdateTagsDTO:
      type: object
      properties:
        contacts:
          description: list of contact ids to be processed
          example:
            - qFSqySFkVvNzOSqgGqFi
            - abcdef
            - qFSqySFkVvNzOSqgGqFi
            - 3ualbhnV7j3n3a9r2moD
          type: array
          items:
            type: string
        tags:
          description: list of tags to be added or removed
          example:
            - tag-1
            - tag-2
          type: array
          items:
            type: string
        locationId:
          type: string
          description: location id from where the bulk request is executed
          example: asdrwHvLUxlfw5SqKVCN
        removeAllTags:
          type: boolean
          description: >-
            Option to implement remove all tags. if true, all tags will be
            removed from the contacts. Can only be used with remove type.
          example: 'false'
      required:
        - contacts
        - tags
        - locationId
    UpdateTagsResponseDTO:
      type: object
      properties:
        succeded:
          type: boolean
          description: Indicates if the operation was successful
          example: true
        errorCount:
          type: number
          description: Number of errors encountered during the operation
          example: 0
        responses:
          description: Responses for each contact processed
          example:
            - contactId: qFSqySFkVvNzOSqgGqFi
              message: Tags updated
              type: success
              oldTags:
                - tag-1
                - tag-2
              tagsAdded: []
              tagsRemoved: []
            - contactId: abcdef
              message: contact id is not a valid firebase id
              type: error
            - contactId: qFSqySFkVvNzOSqgGqFi
              message: contact is deleted
              type: error
            - contactId: 3ualbhnV7j3n3a9r2moD
              message: contact does not belong to location
              type: error
          type: array
          items:
            type: string
      required:
        - succeded
        - errorCount
        - responses
    BadRequestDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 400
        message:
          type: string
          example: Bad Request
      required:
        - statusCode
        - message
    UnprocessableDTO:
      type: object
      properties:
        statusCode:
          type: number
          example: 422
        message:
          type: array
          items:
            type: string
          example:
            - Unprocessable Entity
        error:
          type: string
          example: Unprocessable Entity
      required:
        - statusCode
        - message
        - error

````