Silenciar chat

POST /chat/mute

Silencia notificações de um chat por um período específico. As opções de silenciamento são:

  • 0 - Remove o silenciamento
  • 8 - Silencia por 8 horas
  • 168 - Silencia por 1 semana (168 horas)
  • -1 - Silencia permanentemente

Autenticação

[
  {
    "token": []
  }
]
{
  "token": {
    "name": "token",
    "type": "apiKey",
    "in": "header"
  }
}

Corpo da requisição

{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "type": "object",
        "required": [
          "number",
          "muteEndTime"
        ],
        "properties": {
          "number": {
            "type": "string",
            "description": "ID do chat no formato 123456789@s.whatsapp.net ou 123456789-123456@g.us",
            "example": "5511999999999@s.whatsapp.net"
          },
          "muteEndTime": {
            "type": "integer",
            "description": "Duração do silenciamento:\n* 0 = Remove silenciamento\n* 8 = Silencia por 8 horas\n* 168 = Silencia por 1 semana\n* -1 = Silencia permanentemente\n",
            "enum": [
              0,
              8,
              168,
              -1
            ],
            "example": 8
          }
        }
      }
    }
  }
}

Respostas

{
  "200": {
    "description": "Chat silenciado com sucesso",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "response": {
              "type": "string",
              "example": "Chat mute settings updated successfully"
            }
          }
        }
      }
    }
  },
  "400": {
    "description": "Duração inválida ou formato de número incorreto"
  },
  "401": {
    "description": "Token inválido ou ausente"
  },
  "404": {
    "description": "Chat não encontrado"
  },
  "500": {
    "description": "O WhatsApp recusou a mudança.",
    "content": {
      "application/json": {
        "schema": {
          "type": "object",
          "properties": {
            "error": {
              "type": "string",
              "description": "Motivo do erro."
            }
          }
        },
        "example": {
          "error": "Error muting chat forever: ..."
        }
      }
    }
  }
}

Guias relacionados

Autenticação · Erros e retries · Server URL