Skip to main content
Use $vzaps->typeBots() to connect TypeBot flows to a VZaps instance. Common fields on all calls:
FieldTypeRequiredDescription
instanceIdstringYesInstance ID.
instanceTokenstringYesInstance token.

typeBots()->list($instanceId, $instanceToken = null)

Lists TypeBots configured on the instance.
$typebots = $vzaps->typeBots()->list('VZ...', 'instance-token');

print_r($typebots);
Return: array of TypeBot configs for the instance (IDs, triggers, priority, etc.).

typeBots()->create($request)

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

print_r($created);
Return: created config, including typebot_id for later updates. Main payload fields:
FieldTypeRequiredDescription
enabledbooleanYesEnables or disables the TypeBot during trigger evaluation.
descriptionstringYesDisplay name for identification.
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.
expireInMinutesnumberYesExpires session after inactivity. 0 means no expiration.

typeBots()->update($request)

Updates an existing TypeBot. Provide typebotId returned by create or list.
$vzaps->typeBots()->update([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'typebotId' => '550e8400-e29b-41d4-a716-446655440000',
    'enabled' => true,
    'description' => 'Updated welcome',
    'triggerType' => 'contains',
    'triggerValue' => 'help',
    'priority' => 20,
    'expireInMinutes' => 60,
]);
Return: updated config or { status: "ok" }.

typeBots()->delete($request)

Removes the configuration and associated sessions.
$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:
$vzaps->typeBots()->startSession([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'publicId' => 'support',
    'phone' => '5511999999999',
    'pushName' => 'Customer',
    'message' => 'I need support',
]);
Return: started session (session UUID, contact, opened status). By typebotId:
$vzaps->typeBots()->startSession([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'typebotId' => '550e8400-e29b-41d4-a716-446655440000',
    'phone' => '5511999999999',
    'message' => 'I need support',
]);
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, $instanceToken = null)

Lists active and closed sessions.
$sessions = $vzaps->typeBots()->listSessions('VZ...', 'instance-token');

print_r($sessions);
Return: session list (opened, paused, closed) per contact/flow.

typeBots()->pauseSession($request)

Pauses an open session. Use the session UUID in session.
$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:
$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):
$vzaps->typeBots()->closeSession([
    'instanceId' => 'VZ...',
    'instanceToken' => 'instance-token',
    'session' => '5511999999999',
]);