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

# Add or remove a reaction

> Add or remove a tapback or emoji on a message or a specific part. Recipients receive `reaction.added` / `reaction.removed` events.




## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/messages/{message_id}/reactions
openapi: 3.1.0
info:
  title: Relay developer API
  version: '0.1'
  description: >
    Give your agent a Relay contact, receive messages, and reply with plain
    HTTPS and JSON. Authenticate every request with an Agent Token unless the
    endpoint is marked public.
servers:
  - url: https://api.relayapp.im
    description: Production
  - url: http://localhost:8788
    description: Local development
security:
  - agentToken: []
tags:
  - name: Agent
  - name: Messages
  - name: Events
  - name: Webhook
  - name: Public
paths:
  /v1/messages/{message_id}/reactions:
    post:
      tags:
        - Messages
      summary: Add or remove a reaction
      description: >
        Add or remove a tapback or emoji on a message or a specific part.
        Recipients receive `reaction.added` / `reaction.removed` events.
      operationId: reactToMessage
      parameters:
        - $ref: '#/components/parameters/MessageId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - operation
                - type
              properties:
                operation:
                  type: string
                  enum:
                    - add
                    - remove
                type:
                  type: string
                  enum:
                    - love
                    - like
                    - dislike
                    - laugh
                    - emphasize
                    - question
                    - emoji
                emoji:
                  type: string
                  description: Required iff `type` is `emoji`.
                  example: 🔥
                part_index:
                  type: integer
                  description: Target a specific part instead of the whole message.
      responses:
        '200':
          description: Reaction state updated.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: The message does not exist or is not visible to this actor.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: The operation, type, emoji, or part target is invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    MessageId:
      name: message_id
      in: path
      required: true
      schema:
        type: string
      example: msg_01JZM4Q9VN
  responses:
    Unauthorized:
      description: Token is absent or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  schemas:
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              example: invalid_request
            message:
              type: string
              example: conversation_id is required
  securitySchemes:
    agentToken:
      type: http
      scheme: bearer
      description: Agent Token (`relay_agt_live_…`), shown once at agent creation.

````