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

# Sync tags with media. Tags without ID will be created on the fly.



## OpenAPI

````yaml /openapi/chat-client.yaml post /media/{mediaId}/tags
openapi: 3.0.3
info:
  version: 1.0.0
  title: HealviChat Client API
servers:
  - url: https://{tenant_domain}/third-party/v1
    variables:
      tenant_domain:
        default: your-tenant.onhealvi.com
        description: Your tenant domain
security:
  - bearerAuth: []
paths:
  /media/{mediaId}/tags:
    post:
      tags:
        - media
      summary: Sync tags with media. Tags without ID will be created on the fly.
      parameters:
        - in: path
          name: mediaId
          schema:
            type: integer
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                tags:
                  description: >
                    Array of tag objects. It will automatically determine which
                    IDs to attach or detach.

                    An object should contain either an ID or a title. If an ID
                    is supplied, the existing tag

                    will be attached to the media. If the ID is missing or null,
                    a tag with that title

                    will be created and attached.
                  type: array
                  items:
                    type: object
                    properties:
                      id:
                        type: integer
                        nullable: true
                      title:
                        type: string
                        nullable: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Tag'
components:
  schemas:
    Tag:
      description: |
        Used to further categorize profiles.
      type: object
      properties:
        id:
          type: integer
        title:
          description: Title of tag.
          type: string
        color_hex:
          description: >-
            Optional color of tag. Null value should be displayed with a default
            color.
          type: string
          nullable: true
        created_at:
          description: Datetime when tag was created.
          type: string
          format: date-time
          nullable: true
          example: '2023-01-01T12:00:00Z'
        updated_at:
          description: Datetime when tag was last updated.
          type: string
          format: date-time
          nullable: true
          example: '2023-01-01T12:00:00Z'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````