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

# Label a message

> Applies a label to a specific message in a chat.



## OpenAPI

````yaml /en/api-reference/openapi.json post /labels/assign-message
openapi: 3.1.0
info:
  title: Zapfy API
  description: >-
    Multi-tenant WhatsApp API. Send messages and manage webhooks through a
    single surface.
  version: 1.0.0
servers:
  - url: https://api.zapfy.io/v1
security:
  - accountToken: []
paths:
  /labels/assign-message:
    post:
      tags:
        - Labels
      summary: Label a message
      description: Applies a label to a specific message in a chat.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MessageLabelBody'
      responses:
        '200':
          $ref: '#/components/responses/ActionDone'
        '400':
          $ref: '#/components/responses/Error'
        '401':
          $ref: '#/components/responses/Error'
        '403':
          $ref: '#/components/responses/Error'
        '502':
          $ref: '#/components/responses/Error'
      security:
        - instanceToken: []
components:
  schemas:
    MessageLabelBody:
      type: object
      required:
        - to
        - labelId
        - messageId
      properties:
        to:
          $ref: '#/components/schemas/Recipient'
          description: Chat that holds the message.
        labelId:
          $ref: '#/components/schemas/LabelId'
          description: Label to apply or remove.
        messageId:
          type: string
          example: 3EB0C767D26A1D8E5F1A
          description: Message to (un)label (id returned by a send).
    Recipient:
      type: string
      description: >-
        Recipient: a phone in E.164 (with or without `+`, spaces or formatting,
        e.g. `5511999998888` or `+55 11 99999-8888`) or a group id. To send to a
        group, use the group id (from `GET /groups`).
      example: '5511999998888'
    LabelId:
      type: string
      description: Label id (returned by GET /labels; generated by the API on create).
      example: '1'
    SuccessResult:
      type: object
      properties:
        success:
          type: boolean
          example: true
          description: Always `true` when the action completed.
  responses:
    ActionDone:
      description: Action performed.
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/SuccessResult'
    Error:
      description: Error.
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: Instance not found
  securitySchemes:
    accountToken:
      type: http
      scheme: bearer
      description: Account token (`zpfy_acct_...`) — manages instances and webhooks.
    instanceToken:
      type: http
      scheme: bearer
      description: Instance token (`zpfy_inst_...`) — sends messages.

````