Pin or unpin a chat

POST /chat/{chat_jid}/pin

Pin or unpin a chat conversation to the top of the chat list

Path parameters

application/json

Body

  • pinned boolean Required

    Whether to pin (true) or unpin (false) the chat

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
      • pinned 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}/pin
curl \
 --request POST 'http://localhost:3000/chat/6289685028129@s.whatsapp.net/pin' \
 --user "username:password" \
 --header "Content-Type: application/json" \
 --data '{"pinned":true}'
Request examples
{
  "pinned": true
}
Response examples (200)
{
  "code": "SUCCESS",
  "message": "Chat pinned successfully",
  "results": {
    "status": "success",
    "message": "Chat pinned successfully",
    "chat_jid": "6289685028129@s.whatsapp.net",
    "pinned": 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": {}
}