Skip to main content
Use vzaps.typebots to integrate TypeBot flows with a VZaps instance. Common fields on every call:
FieldTypeRequiredDescription
instanceIdstringYesInstance ID.
instanceTokenstringYesInstance token.

typebots.list(instanceId, options?)

Lists TypeBots configured on the instance.
const typebots = await vzaps.typebots.list('VZ...', {
  instanceToken: 'instance-token',
});

console.dir(typebots, { depth: null });
Return: array of TypeBot configs for the instance (IDs, triggers, priority, etc.).

typebots.create(request)

Creates a TypeBot configuration.
const created = await vzaps.typebots.create({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  enabled: true,
  description: 'Welcome flow',
  typebotUrl: 'https://typebot.io',
  publicId: 'my-public-flow',
  triggerType: 'keyword',
  triggerValue: 'hello',
  priority: 10,
  expireInMinutes: 30,
  keywordFinish: 'exit',
  defaultDelayMs: 800,
  unknownMessage: 'Sorry, I did not understand. Can you rephrase?',
  transcribeAudio: true,
  listenFromMe: false,
  stopBotFromMe: true,
  keepOpen: false,
  debounceMs: 1500,
  ignoreGroups: false,
});

console.dir(created, { depth: null });
Return: created config, including typebotId for later updates. Main payload fields:
FieldTypeRequiredDescription
enabledbooleanYesEnables or disables trigger evaluation.
descriptionstringYesDisplay name for the configuration.
typebotUrlstringYesTypeBot base URL.
publicIdstringYesPublic flow identifier.
triggerTypestringYesall, keyword, contains, starts_with, regex, advanced, or none.
triggerValuestringConditionalTrigger text or regex.
triggerOperatorstringConditionalUsed when triggerType is advanced.
prioritynumberYesEvaluation order. Higher value first.
expireInMinutesnumberYesSession expiry after inactivity. 0 means no expiry.

typebots.update(request)

Updates an existing TypeBot. Pass typebotId from create or list.
await vzaps.typebots.update({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  typebotId: '550e8400-e29b-41d4-a716-446655440000',
  enabled: true,
  description: 'Updated welcome flow',
  triggerType: 'contains',
  triggerValue: 'help',
  priority: 20,
  expireInMinutes: 60,
});
Return: updated config or { status: "ok" }.

typebots.delete(request)

Removes the configuration and its sessions.
await vzaps.typebots.delete({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  typebotId: '550e8400-e29b-41d4-a716-446655440000',
});
Return: deletion confirmation ({ status: "ok" } or equivalent message).

typebots.startSession(request)

Starts a session manually with a contact. By publicId:
await vzaps.typebots.startSession({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  publicId: 'support',
  phone: '5511999999999',
  pushName: 'Customer',
  message: 'I need help',
});
Return: started session (session UUID, contact, opened status). By typebotId:
await vzaps.typebots.startSession({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  typebotId: '550e8400-e29b-41d4-a716-446655440000',
  phone: '5511999999999',
  message: 'I need help',
});
FieldTypeRequiredDescription
publicIdstringConditionalPublic flow identifier. Use publicId or typebotId.
typebotIdstringConditionalInternal TypeBot ID.
phonestringYesContact phone.
messagestringYesInitial message sent to the flow.
pushNamestringNoContact display name.

typebots.listSessions(instanceId, options?)

Lists active and closed sessions.
const sessions = await vzaps.typebots.listSessions('VZ...', {
  instanceToken: 'instance-token',
});

console.dir(sessions, { depth: null });
Return: session list (opened, paused, closed) per contact/flow.

typebots.pauseSession(request)

Pauses an open session. Pass the session UUID in session.
await vzaps.typebots.pauseSession({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  session: '550e8400-e29b-41d4-a716-446655440001',
});
Return: session with paused status.

typebots.closeSession(request)

Closes a session manually. By session UUID:
await vzaps.typebots.closeSession({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  session: '550e8400-e29b-41d4-a716-446655440001',
});
Return: closed session or confirmation by phone number. By contact phone (closes all active sessions for that number):
await vzaps.typebots.closeSession({
  instanceId: 'VZ...',
  instanceToken: 'instance-token',
  session: '5511999999999',
});