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

# Upsert tags

> Upsert tags



## OpenAPI

````yaml /openAPI/openapi-20240301.json post /tags
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /tags:
    post:
      tags:
        - Tags
      summary: Upsert tags
      description: Upsert tags
      operationId: Upsert-tags
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertTagsRequestSchema'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    UpsertTagsRequestSchema:
      properties:
        holder:
          anyOf:
            - $ref: '#/components/schemas/TagHolder'
            - type: 'null'
          description: ''
        item_id:
          type: string
          title: Item Id
          description: ''
        tags:
          additionalProperties: true
          type: object
          title: Tags
          description: Dictionary of tags and their values
      type: object
      required:
        - item_id
        - tags
      title: UpsertTagsRequestSchema
      example:
        holder: INVOICE
        item_id: inv_123
        tags:
          department: sales
          priority: high
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TagHolder:
      type: string
      enum:
        - invoice
        - product
        - contract
        - customer
        - payment
      title: TagHolder
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````