Skip to main content
PATCH
https://api.enviaai.app
/
v1
/
instances
/
{instanceId}
Atualizar Instância
curl --request PATCH \
  --url https://api.enviaai.app/v1/instances/{instanceId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "webhookUrl": "<string>",
  "webhookEvents": [
    {}
  ],
  "settings": {},
  "settings.autoRead": true,
  "settings.autoTyping": true
}
'
{
  "success": true,
  "data": {
    "id": "inst_abc123",
    "name": "Vendas SP",
    "webhookUrl": "https://myapp.com/webhooks/whatsapp",
    "settings": {
      "autoRead": true,
      "autoTyping": true
    }
  }
}

Path Parameters

instanceId
string
required
ID da instância

Request Body

name
string
Novo nome da instância
webhookUrl
string
URL do webhook
webhookEvents
array
Eventos para enviar ao webhook
settings
object
Configurações da instância
settings.autoRead
boolean
Marcar mensagens como lidas automaticamente
settings.autoTyping
boolean
Mostrar “digitando…” antes de enviar

Exemplo

const updated = await client.instances.update('inst_abc123', {
  name: 'Vendas SP',
  webhookUrl: 'https://myapp.com/webhooks/whatsapp',
  webhookEvents: ['message.received', 'message.sent'],
  settings: {
    autoRead: true,
    autoTyping: true
  }
});
{
  "success": true,
  "data": {
    "id": "inst_abc123",
    "name": "Vendas SP",
    "webhookUrl": "https://myapp.com/webhooks/whatsapp",
    "settings": {
      "autoRead": true,
      "autoTyping": true
    }
  }
}

Erros

CódigoDescrição
instance_not_foundInstância não existe
invalid_webhook_urlURL do webhook inválida