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

# Apply Decision Engine Tags

> Set and unset tags on up to 100 messages. Each key and value in `set`
must be in the tag configuration. Other tags on each message stay as
they are. Only message tags are supported. Set channel tags with
PATCH /decision-engine/channels/{channelId}.



## OpenAPI

````yaml https://api.hightouch.io/api/swagger.json post /decision-engine/tags/apply
openapi: 3.0.0
info:
  title: Hightouch API
  version: 1.0.0
  description: Hightouch Public Rest API to access syncs, models, sources and destinations
  contact:
    name: Hightouch
    url: https://hightouch.com
servers:
  - url: https://api.hightouch.com/api/v1
security: []
paths:
  /decision-engine/tags/apply:
    post:
      tags:
        - AI Decisioning
      summary: Apply Decision Engine Tags
      description: |-
        Set and unset tags on up to 100 messages. Each key and value in `set`
        must be in the tag configuration. Other tags on each message stay as
        they are. Only message tags are supported. Set channel tags with
        PATCH /decision-engine/channels/{channelId}.
      operationId: ApplyTags
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DecisionEngineTagApply'
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/DecisionEngineTagApplyResponse'
                  - $ref: '#/components/schemas/DecisionEngineErrorResponse'
                  - $ref: '#/components/schemas/ValidateErrorJSON'
                  - $ref: '#/components/schemas/InternalServerError'
                nullable: true
              examples:
                Example 1:
                  value:
                    updatedMessageIds:
                      - 770e8400-e29b-41d4-a716-446655440002
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DecisionEngineErrorResponse'
        '422':
          description: Validation Failed
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/DecisionEngineErrorResponse'
                  - $ref: '#/components/schemas/ValidateErrorJSON'
      security:
        - bearerAuth: []
components:
  schemas:
    DecisionEngineTagApply:
      description: Request body for applying tags to messages
      properties:
        assignments:
          items:
            $ref: '#/components/schemas/DecisionEngineTagAssignment'
          type: array
          description: Changes to apply, at most 100 messages per request
          maxItems: 100
      required:
        - assignments
      type: object
      additionalProperties: false
    DecisionEngineTagApplyResponse:
      properties:
        updatedMessageIds:
          items:
            type: string
          type: array
          description: >-
            Messages whose tags changed. Messages that already had the requested
            tags are left out.
      required:
        - updatedMessageIds
      type: object
      additionalProperties: false
    DecisionEngineErrorResponse:
      properties:
        message:
          type: string
          description: Why the request failed.
      required:
        - message
      type: object
      additionalProperties: false
    ValidateErrorJSON:
      properties:
        message:
          type: string
          enum:
            - Validation failed
          nullable: false
        details:
          properties: {}
          additionalProperties: {}
          type: object
      required:
        - message
        - details
      type: object
      additionalProperties: false
    InternalServerError:
      type: string
      enum:
        - Internal Server Error
      nullable: false
    DecisionEngineTagAssignment:
      description: Tag changes for one message
      properties:
        messageId:
          type: string
        set:
          properties: {}
          additionalProperties:
            type: string
          type: object
          description: >-
            Tags to set, by key. Each key and value must be in the tag
            configuration.

            A message gets the tag channel = <type> from a channel that is not
            raw,

            so in such a channel its `channel` tag cannot be a channel type.
        unset:
          items:
            type: string
          type: array
          description: Tag keys to remove from the message
      required:
        - messageId
      type: object
      additionalProperties: false
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Bearer

````