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

# Assign Patient Tags

> Assign tags to a patient. This replaces all existing tags with the provided ones.

Returns the resulting tag set, read back on the same (primary) session that
performed the write. Callers can render this directly instead of issuing a
follow-up GET: that GET is served by the read replica, which can lag behind
this commit and return the pre-save tags (making the save look like it didn't
take).



## OpenAPI

````yaml post /user/patient/{patient_id}/tags
openapi: 3.1.0
info:
  title: Decoda API
  description: External API documentation for the Decoda Health platform.
  version: '1.0'
servers: []
security: []
paths:
  /user/patient/{patient_id}/tags:
    post:
      tags:
        - provider
        - user
      summary: Assign Patient Tags
      description: >-
        Assign tags to a patient. This replaces all existing tags with the
        provided ones.
      operationId: assign_patient_tags_user_patient__patient_id__tags_post
      parameters:
        - name: TENANT
          in: header
          required: true
          schema:
            type: string
            title: Tenant
          description: The tenant you are making this request on behalf of
        - name: API-KEY
          in: header
          required: true
          schema:
            type: string
            title: Api-Key
          description: Your api key
        - name: patient_id
          in: path
          required: true
          schema:
            type: string
            title: Patient Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatientTagAssignment'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                additionalProperties:
                  type: string
                title: >-
                  Response Assign Patient Tags User Patient  Patient Id  Tags
                  Post
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    PatientTagAssignment:
      properties:
        patientId:
          type: string
          title: Patientid
          description: Patient ID to assign/unassign tags
        tagIds:
          items:
            type: string
          type: array
          title: Tagids
          description: List of patient tag IDs to assign
      type: object
      required:
        - patientId
        - tagIds
      title: PatientTagAssignment
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    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

````