cURL
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 } } }
Atualize configurações de uma instância
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 } });
instance_not_found
invalid_webhook_url