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

# Replace tags

> Replace all tags on a lead



## OpenAPI

````yaml put /leads/{leadId}/tags
openapi: 3.0.1
info:
  title: AttentPublicAPI
  version: '2024-05-17T21:09:13Z'
servers:
  - url: https://api.attent.app/v1
security: []
paths:
  /leads/{leadId}/tags:
    put:
      description: Replace all tags on a lead
      parameters:
        - name: leadId
          in: path
          required: true
          schema:
            type: string
          description: The ID of the lead to update tags for
      requestBody:
        description: Array of tag IDs to set on the lead
        content:
          application/json:
            schema:
              type: object
              required:
                - tagIds
              properties:
                tagIds:
                  type: array
                  items:
                    type: string
                  description: Array of tag IDs to replace existing tags with
              example:
                tagIds:
                  - tag1
                  - tag2
                  - tag3
        required: true
      responses:
        '200':
          description: Tags successfully replaced.
          content:
            application/json:
              schema:
                type: object
                properties:
                  tags:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: The ID of the tag
                        name:
                          type: string
                          description: The name of the tag
                    description: Array of tags now assigned to the lead
                example:
                  tags:
                    - id: tag1
                      name: VIP Customer
                    - id: tag2
                      name: Interested
                    - id: tag3
                      name: Follow Up Required
        '400':
          description: Bad request - invalid tag IDs provided
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                example:
                  message: 'Invalid tag IDs: invalid-tag-1, invalid-tag-2'
        '403':
          $ref: '#/components/responses/403'
        '404':
          description: Lead not found
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                example:
                  message: Lead not found
        '500':
          $ref: '#/components/responses/500'
      security:
        - api_key: []
components:
  responses:
    '403':
      description: Forbidden API key
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            example:
              message: Forbidden
    '500':
      description: Internal Server Error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
            example:
              message: Internal Server Error
  securitySchemes:
    api_key:
      type: apiKey
      name: x-api-key
      in: header

````