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

# Editar Dispositivo

## Descrição

Este endpoint permite editar as informações de um dispositivo, como o nome e o URL do webhook. O ID ou nome do dispositivo é fornecido para identificar qual dispositivo será editado.

### Parâmetros

<ParamField body="authkey" type="string" required>
  Chave de autenticação do usuário.
</ParamField>

<ParamField body="message" type="string" required>
  ID ou nome do dispositivo a ser editado.
</ParamField>

<ParamField body="webhook" type="string">
  Novo URL do webhook a ser associado ao dispositivo.
</ParamField>

<ParamField body="nome" type="string">
  Novo nome do dispositivo.
</ParamField>

<ParamField body="editeDispositivo" type="string" required>
  Deve ser "true" para indicar que o dispositivo será editado.
</ParamField>

<ParamField body="self_events" type="boolean">
  Ativa eventos do próprio número (webhook\_me).
</ParamField>

<ParamField body="chat_enabled" type="boolean">
  Ativa o webhook para conversas privadas.
</ParamField>

<ParamField body="chat_text" type="boolean">
  Filtro para mensagens de texto em chats.
</ParamField>

<ParamField body="chat_media" type="boolean">
  Filtro para mídias em chats.
</ParamField>

<ParamField body="chat_contact" type="boolean">
  Filtro para contatos em chats.
</ParamField>

<ParamField body="group_enabled" type="boolean">
  Ativa o webhook para grupos.
</ParamField>

<ParamField body="group_text" type="boolean">
  Filtro para mensagens de texto em grupos.
</ParamField>

<ParamField body="group_media" type="boolean">
  Filtro para mídias em grupos.
</ParamField>

<ParamField body="group_contact" type="boolean">
  Filtro para contatos em grupos.
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST [https://chatbot.menuia.com/api/developer](https://chatbot.menuia.com/api/developer) \
    -H "Content-Type: application/json" \
    -d '{
      "authkey": "SUA_AUTHKEY_AQUI",
      "message": "ID ou Nome do Dispositivo",
      "webhook": "[https://exemplo.com/novo_webhook](https://exemplo.com/novo_webhook)",
      "nome": "Novo Nome do Dispositivo",
      "self_events": 1,
      "chat_enabled": 1,
      "chat_text": 1,
      "chat_media": 1,
      "chat_contact": 1,
      "group_enabled": 1,
      "group_text": 1,
      "group_media": 1,
      "group_contact": 1,
      "editeDispositivo": "true"
    }'
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('[https://chatbot.menuia.com/api/developer](https://chatbot.menuia.com/api/developer)', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      authkey: 'SUA_AUTHKEY_AQUI',
      message: 'ID ou Nome do Dispositivo',
      webhook: '[https://exemplo.com/novo_webhook](https://exemplo.com/novo_webhook)',
      nome: 'Novo Nome do Dispositivo',
      editeDispositivo: 'true',
      self_events: true,
      chat_enabled: true,
      chat_text: true,
      chat_media: true,
      chat_contact: true,
      group_enabled: true,
      group_text: true,
      group_media: true,
      group_contact: true
    })
  });
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      '[https://chatbot.menuia.com/api/developer](https://chatbot.menuia.com/api/developer)',
      json={
          'authkey': 'SUA_AUTHKEY_AQUI',
          'message': 'ID ou Nome do Dispositivo',
          'webhook': '[https://exemplo.com/novo_webhook](https://exemplo.com/novo_webhook)',
          'nome': 'Novo Nome do Dispositivo',
          'editeDispositivo': 'true',
          'self_events': True,
          'chat_enabled': True,
          'chat_text': True,
          'chat_media': True,
          'chat_contact': True,
          'group_enabled': True,
          'group_text': True,
          'group_media': True,
          'group_contact': True
      }
  )
  ```

  ```php PHP theme={null}
  $response = Http::post('[https://chatbot.menuia.com/api/developer](https://chatbot.menuia.com/api/developer)', [
      'authkey' => 'SUA_AUTHKEY_AQUI',
      'message' => 'ID ou Nome do Dispositivo',
      'webhook' => '[https://exemplo.com/novo_webhook](https://exemplo.com/novo_webhook)',
      'nome' => 'Novo Nome do Dispositivo',
      'editeDispositivo' => 'true',
      'self_events' => true,
      'chat_enabled' => true,
      'chat_text' => true,
      'chat_media' => true,
      'chat_contact' => true,
      'group_enabled' => true,
      'group_text' => true,
      'group_media' => true,
      'group_contact' => true
  ]);
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Sucesso theme={null}
  {
    "status": 200,
    "message": "Dispositivo editado com sucesso."
  }
  ```

  ```json 401 - Erro de validação theme={null}
  {
    "status": 401,
    "message": "validation.required"
  }
  ```

  ```json 404 - Dispositivo não encontrado theme={null}
  {
    "status": 404,
    "message": "Nenhum dispositivo encontrado."
  }
  ```
</ResponseExample>
