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

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.kosli.com/feedback

```json
{
  "path": "/api-reference/tags/update-tags",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Update tags

> Patch tags for resource.



## OpenAPI

````yaml https://app.kosli.com/api/v2/openapi.json patch /tags/{org}/{resource_type}/{resource_id}
openapi: 3.1.0
info:
  title: Kosli API
  summary: The API for communicating with Kosli
  description: >

    # Authentication 


    When making requests against Kosli API, you can authenticate your requests
    using a bearer token. 

    Set the bearer token in the request Authorization header to a valid API
    key. 

    API Keys can be personal or for service accounts. Check the [service
    accounts
    documentation](https://docs.kosli.com/getting_started/service-accounts/) for
    details. 


    ## Curl example


    ```shell

    curl -H "Authorization: Bearer <<your-api-key>>"
    https://app.kosli.com/api/v2/environments/<<your-org-name>>

    ```
  version: '2.0'
servers:
  - url: https://app.kosli.com/api/v2
    description: EU
  - url: https://app.us.kosli.com/api/v2
    description: US
security:
  - HTTPBearer: []
paths:
  /tags/{org}/{resource_type}/{resource_id}:
    patch:
      tags:
        - Tags
      summary: Update tags
      description: Patch tags for resource.
      operationId: patch_tags_tags__org___resource_type___resource_id__patch
      parameters:
        - name: resource_type
          in: path
          required: true
          schema:
            type: string
            title: Resource Type
        - name: resource_id
          in: path
          required: true
          schema:
            type: string
            title: Resource Id
        - name: org
          in: path
          required: true
          schema:
            type: string
            title: Org
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TagPatchInput'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '400':
          description: Invalid Resource Type
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__BadRequestResponse___locals___BadRequestResponseModel__2
        '404':
          description: Resource Not Found
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__34
      security:
        - HTTPBearer: []
        - HTTPBasic: []
components:
  schemas:
    TagPatchInput:
      properties:
        set_tags:
          anyOf:
            - patternProperties:
                ^[a-zA-Z0-9][a-zA-Z0-9\-_\.~]*$:
                  type: string
              type: object
            - type: 'null'
          title: Set Tags
          description: Dictionary of key-value tags to be added or updated
        remove_tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Remove Tags
          description: List of tag keys to be removed
      additionalProperties: false
      type: object
      title: TagPatchInput
      examples:
        - remove_tags:
            - key_to_delete
          set_tags:
            key1: value1
    fastapi_app__errors__BadRequestResponse___locals___BadRequestResponseModel__2:
      properties:
        message:
          type: string
          title: Message
          description: Error message
        errors:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Errors
          description: Validation errors by field
      type: object
      required:
        - message
      title: BadRequestResponseModel
      examples:
        - message: Input payload validation failed
    fastapi_app__errors__NotFoundResponse___locals___NotFoundResponseModel__34:
      properties:
        message:
          type: string
          title: Message
          description: Error message
        errors:
          anyOf:
            - additionalProperties:
                type: string
              type: object
            - type: 'null'
          title: Errors
          description: Validation errors by field
      type: object
      required:
        - message
      title: NotFoundResponseModel
      description: Resource not found
      examples:
        - message: Resource not found
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````