Label or unlabel a chat

POST /chat/{chat_jid}/label

Apply or remove a label from a chat conversation

Path parameters

application/json

Body

  • label_id string Required

    Unique identifier for the label

  • label_name string Required

    Display name for the label

  • labeled boolean Required

    Whether to apply (true) or remove (false) the label

Responses

  • 200 application/json

    OK

    Hide response attributes Show response attributes object
    • code string
    • message string
    • results object
      Hide results attributes Show results attributes object
      • status string
      • message string
      • chat_jid string
      • label_id string
      • labeled boolean
  • 400 application/json

    Bad Request

    Hide response attributes Show response attributes object
    • code string

      HTTP Status Code

    • message string

      Detail error message

    • results object

      additional data

  • 401 application/json

    Unauthorized

    Hide response attributes Show response attributes object
    • code string

      HTTP Status Code

    • message string

      Detail error message

    • results object

      additional data

  • 404 application/json

    Chat Not Found

    Hide response attributes Show response attributes object
    • code string

      HTTP Status Code

    • message string

      Detail error message

    • results object

      additional data

  • 500 application/json

    Internal Server Error

    Hide response attributes Show response attributes object
    • code string

      SYSTEM_CODE_ERROR

    • message string

      Detail error message

    • results object

      additional data

POST /chat/{chat_jid}/label
curl \
 --request POST 'http://localhost:3000/chat/6289685028129@s.whatsapp.net/label' \
 --user "username:password" \
 --header "Content-Type: application/json" \
 --data '{"label_id":"label_123","label_name":"Important","labeled":true}'
Request examples
{
  "label_id": "label_123",
  "label_name": "Important",
  "labeled": true
}
Response examples (200)
{
  "code": "SUCCESS",
  "message": "Chat labeled successfully with label 'Important'",
  "results": {
    "status": "success",
    "message": "Chat labeled successfully with label 'Important'",
    "chat_jid": "6289685028129@s.whatsapp.net",
    "label_id": "label_123",
    "labeled": true
  }
}
Response examples (400)
{
  "code": 400,
  "message": "field cannot be blank",
  "results": {}
}
Response examples (401)
{
  "code": 401,
  "message": "Unauthorized access",
  "results": {}
}
Response examples (404)
{
  "code": 404,
  "message": "Chat not found",
  "results": {}
}
Response examples (500)
{
  "code": "INTERNAL_SERVER_ERROR",
  "message": "you are not loggin",
  "results": {}
}