> ## 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.

# Bulk Assign Patient Tags

> Add tags to multiple patients without replacing existing tags.

Idempotent: (patient, tag) pairs that already exist are skipped, so callers
don't have to filter them out client-side.



## OpenAPI

````yaml post /user/patient/tags/bulk-assign
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/tags/bulk-assign:
    post:
      tags:
        - Patient Tags
      summary: Bulk Assign Patient Tags
      description: >-
        Add tags to multiple patients without replacing existing tags.


        Idempotent: (patient, tag) pairs that already exist are skipped, so
        callers

        don't have to filter them out client-side.
      operationId: bulk_assign_patient_tags_user_patient_tags_bulk_assign_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
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BulkPatientTagAssignment'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BulkPatientTagAssignmentResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    BulkPatientTagAssignment:
      properties:
        patientIds:
          items:
            type: string
          type: array
          maxItems: 5000
          title: Patientids
          description: List of patient IDs to tag
        tagIds:
          items:
            type: string
          type: array
          maxItems: 100
          title: Tagids
          description: List of patient tag IDs to add to each patient
      type: object
      required:
        - patientIds
        - tagIds
      title: BulkPatientTagAssignment
    BulkPatientTagAssignmentResponse:
      properties:
        message:
          type: string
          title: Message
          description: Human-readable summary of the bulk assignment
        assignedCount:
          type: integer
          title: Assignedcount
          description: Number of new patient/tag associations created
      type: object
      required:
        - message
        - assignedCount
      title: BulkPatientTagAssignmentResponse
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````