Skip to main content
Use client.Typebots to integrate TypeBot flows with a VZaps instance. Common fields on every call:
FieldTypeRequiredDescription
InstanceIDstringYesInstance ID.
InstanceTokenstringYesInstance token.

Typebots.List(ctx, instanceID, options)

Lists TypeBots configured on the instance.
typebots, err := client.Typebots.List(ctx, "VZ...", vzaps.InstanceOptions{
	InstanceToken: "instance-token",
})
fmt.Printf("%#v\n", typebots)
Return: array of TypeBot configs for the instance (IDs, triggers, priority, etc.).

Typebots.Create(ctx, req)

Creates a TypeBot configuration.
created, err := client.Typebots.Create(ctx, vzaps.TypebotRequest{
	InstanceScopedRequest: vzaps.InstanceScopedRequest{
		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,
})
fmt.Printf("%#v\n", created)
Return: created config, including typebot_id for later updates. Main payload fields:
Field (JSON)Go fieldRequiredDescription
enabledEnabledYesEnables or disables trigger evaluation.
descriptionDescriptionYesDisplay name for the configuration.
typebot_urlTypebotURLYesTypeBot base URL.
public_idPublicIDYesPublic flow identifier.
trigger_typeTriggerTypeYesall, keyword, contains, starts_with, regex, advanced, or none.
trigger_valueTriggerValueConditionalTrigger text or regex.
trigger_operatorTriggerOperatorConditionalUsed when TriggerType is advanced.
priorityPriorityYesEvaluation order. Higher value first.
expire_in_minutesExpireInMinutesYesSession expiry after inactivity. 0 means no expiry.

Typebots.Update(ctx, req)

Updates an existing TypeBot. Pass TypebotID from create or list.
_, err := client.Typebots.Update(ctx, vzaps.TypebotMutationRequest{
	TypebotRequest: vzaps.TypebotRequest{
		InstanceScopedRequest: vzaps.InstanceScopedRequest{
			InstanceID:    "VZ...",
			InstanceToken: "instance-token",
		},
		Enabled:         true,
		Description:     "Updated welcome flow",
		TriggerType:     "contains",
		TriggerValue:    "help",
		Priority:        20,
		ExpireInMinutes: 60,
	},
	TypebotID: "550e8400-e29b-41d4-a716-446655440000",
})
Return: updated config or { status: "ok" }.

Typebots.Delete(ctx, req)

Removes the configuration and its sessions.
_, err := client.Typebots.Delete(ctx, vzaps.TypebotMutationRequest{
	TypebotRequest: vzaps.TypebotRequest{
		InstanceScopedRequest: vzaps.InstanceScopedRequest{
			InstanceID:    "VZ...",
			InstanceToken: "instance-token",
		},
	},
	TypebotID: "550e8400-e29b-41d4-a716-446655440000",
})
Return: deletion confirmation ({ status: "ok" } or equivalent message).

Typebots.StartSession(ctx, req)

Starts a session manually with a contact. By PublicID:
_, err := client.Typebots.StartSession(ctx, vzaps.TypebotStartSessionRequest{
	InstanceScopedRequest: vzaps.InstanceScopedRequest{
		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:
_, err := client.Typebots.StartSession(ctx, vzaps.TypebotStartSessionRequest{
	InstanceScopedRequest: vzaps.InstanceScopedRequest{
		InstanceID:    "VZ...",
		InstanceToken: "instance-token",
	},
	TypebotID: "550e8400-e29b-41d4-a716-446655440000",
	Phone:     "5511999999999",
	Message:   "I need help",
})
Field (JSON)Go fieldRequiredDescription
public_idPublicIDConditionalPublic flow identifier. Use PublicID or TypebotID.
typebot_idTypebotIDConditionalInternal TypeBot ID.
phonePhoneYesContact phone.
messageMessageYesInitial message sent to the flow.
push_namePushNameNoContact display name.

Typebots.ListSessions(ctx, instanceID, options)

Lists active and closed sessions.
sessions, err := client.Typebots.ListSessions(ctx, "VZ...", vzaps.InstanceOptions{
	InstanceToken: "instance-token",
})
fmt.Printf("%#v\n", sessions)
Return: session list (opened, paused, closed) per contact/flow.

Typebots.PauseSession(ctx, req)

Pauses an open session. Pass the session UUID in Session.
_, err := client.Typebots.PauseSession(ctx, vzaps.TypebotSessionRequest{
	InstanceScopedRequest: vzaps.InstanceScopedRequest{
		InstanceID:    "VZ...",
		InstanceToken: "instance-token",
	},
	Session: "550e8400-e29b-41d4-a716-446655440001",
})
Return: session with paused status.

Typebots.CloseSession(ctx, req)

Closes a session manually. By session UUID:
_, err := client.Typebots.CloseSession(ctx, vzaps.TypebotSessionRequest{
	InstanceScopedRequest: vzaps.InstanceScopedRequest{
		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):
_, err := client.Typebots.CloseSession(ctx, vzaps.TypebotSessionRequest{
	InstanceScopedRequest: vzaps.InstanceScopedRequest{
		InstanceID:    "VZ...",
		InstanceToken: "instance-token",
	},
	Session: "5511999999999",
})