Skip to main content
Use vzaps.chatwoot to connect a VZaps instance to Chatwoot. Common fields on every call:
FieldTypeRequiredDescription
instanceIdstringYesInstance ID.
instanceTokenstringYesInstance token.

chatwoot.get(instanceId, options?)

Reads the current configuration, including webhookUrl and tokenMasked when applicable.
const chatwoot = await vzaps.chatwoot.get('VZ...', {
  instanceToken: 'instance-token',
});

console.dir(chatwoot, { depth: null });
Return: Chatwoot config (enabled, url, accountId, webhookUrl, tokenMasked, etc.).

chatwoot.set(request)

Creates or updates the instance Chatwoot integration.
const saved = await vzaps.chatwoot.set({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  enabled: true,
  url: 'https://app.chatwoot.com',
  accountId: '1',
  token: 'chatwoot-api-token',
  nameInbox: 'WhatsApp VZaps',
  signMsg: true,
  signDelimiter: '\n',
  number: '5511999999999',
  reopenConversation: true,
  conversationPending: false,
  importContacts: true,
  importMessages: true,
  daysLimitImportMessages: 30,
  autoCreate: true,
  organization: 'My company',
  logo: '',
  ignoreGroups: false,
  ignoreJids: [],
});

console.dir(saved, { depth: null });
Return: saved config (includes webhookUrl when generated). Main payload fields:
FieldTypeRequiredDescription
enabledbooleanYesEnables or disables the integration.
urlstringYesChatwoot base URL.
accountIdstringYesNumeric account ID.
tokenstringYesChatwoot API token.
nameInboxstringNoAPI inbox name.
autoCreatebooleanNoAuto-create inbox and webhook.
importContactsbooleanNoImport contacts in the initial flow.
importMessagesbooleanNoImport messages in the initial flow.
daysLimitImportMessagesnumberNoMessage import window in days. Minimum 1.
ignoreGroupsbooleanNoIgnore group messages.
ignoreJidsarrayNoJIDs to ignore.
Copy webhookUrl from the response into the Chatwoot API inbox when autoCreate does not apply it automatically.

chatwoot.delete(instanceId, options?)

Removes the Chatwoot integration from the instance.
await vzaps.chatwoot.delete('VZ...', {
  instanceToken: 'instance-token',
});
Return: integration removal confirmation.

chatwoot.triggerImport(request)

Triggers a manual import of contacts, messages, or both. Import contacts:
await vzaps.chatwoot.triggerImport({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  what: 'contacts',
});
Return: import job confirmation (contacts, messages, or all). Import messages:
await vzaps.chatwoot.triggerImport({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  what: 'messages',
});
Import all:
await vzaps.chatwoot.triggerImport({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  what: 'all',
});
Accepted values for what: contacts, messages, all.