open-wa
DocsAPI reference

Return types

Named data models used by client method results.

Return types

These are TypeScript data shapes, not class instances. Follow a type from a method to inspect its fields. unknown marks a provider-controlled value that needs narrowing; it does not promise an undocumented shape.

ChatId

Opaque conversation identifier. Use the exact value returned by a message event or chat lookup.

Type declaration
type ChatId = string

Chat

Serialized chat returned by chat lookups and listings. Its id is an opaque ChatId; additional WhatsApp Web fields may be present.

Type declaration
type Chat = { id: ChatId; name?: string; formattedTitle?: string; isGroup: boolean; contact: Contact | null; groupMetadata?: GroupMetadata | null; presence?: Record<string, unknown> | null; t?: number; unreadCount?: number; lastReceivedKey?: unknown; msgs?: unknown[] | null; isReadOnly?: boolean; muteExpiration?: number; notSpam?: boolean; pin?: number; ack?: unknown }

Related types: ChatId, Contact, GroupMetadata

FieldTypeRequired
idChatId — ChatIdYes
namestringNo
formattedTitlestringNo
isGroupbooleanYes
contactContact | null — ContactYes
groupMetadataGroupMetadata | null — GroupMetadataNo
presenceRecord<string, unknown> | nullNo
tnumberNo
unreadCountnumberNo
lastReceivedKeyunknownNo
msgsunknown[] | nullNo
isReadOnlybooleanNo
muteExpirationnumberNo
notSpambooleanNo
pinnumberNo
ackunknownNo

Additional provider fields may be present; narrow them before use.

ContactId

Opaque WhatsApp contact identifier. Preserve the exact value returned by the API.

Type declaration
type ContactId = string

Contact

Type declaration
type Contact = { id: ContactId; name?: string; shortName?: string; pushname?: string; formattedName?: string; isBusiness?: boolean; isEnterprise?: boolean; isMe?: boolean; isMyContact?: boolean; isPSA?: boolean; isUser?: boolean; isWAContact?: boolean; labels?: string[]; msgs?: unknown[] | null; profilePicThumbObj?: { eurl?: string; id?: Id; img?: string; imgFull?: string; tag?: string }; statusMute?: boolean; type?: string; verifiedLevel?: number; verifiedName?: string; isOnline?: boolean; lastSeen?: number }

Related types: ContactId, Id

FieldTypeRequired
idContactId — ContactIdYes
namestringNo
shortNamestringNo
pushnamestringNo
formattedNamestringNo
isBusinessbooleanNo
isEnterprisebooleanNo
isMebooleanNo
isMyContactbooleanNo
isPSAbooleanNo
isUserbooleanNo
isWAContactbooleanNo
labelsstring[]No
msgsunknown[] | nullNo
profilePicThumbObj{ eurl?: string; id?: Id; img?: string; imgFull?: string; tag?: string } — IdNo
statusMutebooleanNo
typestringNo
verifiedLevelnumberNo
verifiedNamestringNo
isOnlinebooleanNo
lastSeennumberNo

Additional provider fields may be present; narrow them before use.

DataURL

Type declaration
type DataURL = `data:${string};base64,${string}`

GroupChatId

Opaque group conversation identifier returned by a group lookup or join method.

Type declaration
type GroupChatId = string

GroupId

Identifier for a WhatsApp group. Use the value returned by the API.

Type declaration
type GroupId = string

GroupMetadata

Serialized group metadata returned by group lookups. Additional WhatsApp Web fields may be present.

Type declaration
type GroupMetadata = { id: GroupId; subject: string; creation: number; owner?: ContactId; desc?: string; descTime?: number; descOwner?: ContactId; restrict?: boolean; announce?: boolean; participants: { id: ContactId; isAdmin: boolean; isSuperAdmin?: boolean }[] }

Related types: ContactId, GroupId

FieldTypeRequired
idGroupId — GroupIdYes
subjectstringYes
creationnumberYes
ownerContactId — ContactIdNo
descstringNo
descTimenumberNo
descOwnerContactId — ContactIdNo
restrictbooleanNo
announcebooleanNo
participants{ id: ContactId; isAdmin: boolean; isSuperAdmin?: boolean }[] — ContactIdYes

Additional provider fields may be present; narrow them before use.

Id

Type declaration
type Id = { server: string; user: string; _serialized: string }
FieldTypeRequired
serverstringYes
userstringYes
_serializedstringYes

Additional provider fields may be present; narrow them before use.

Location

Type declaration
type Location = { lat: number; lng: number; name?: string; address?: string; url?: string }
FieldTypeRequired
latnumberYes
lngnumberYes
namestringNo
addressstringNo
urlstringNo

Additional provider fields may be present; narrow them before use.

MessageIdReturn

A message ID as a string or an object containing the serialized ID. Validate it before passing it to another method.

Type declaration
type MessageIdReturn = MessageId | SerializedMessageId

Related types: MessageId, SerializedMessageId

MessageId

Message identifier returned by a send method or message event.

Type declaration
type MessageId = string

Message

Type declaration
type Message = { id: MessageId; body: string; type: "chat" | "audio" | "ptt" | "image" | "video" | "document" | "sticker" | "location" | "vcard" | "multi_vcard" | "revoked" | "order" | "buttons_response" | "list_response" | "unknown"; t: number; notifyName?: string; from: ChatId; to: ChatId; self: "in" | "out"; ack: "ACK_PENDING" | "ACK_SERVER" | "ACK_DEVICE" | "ACK_READ" | "ACK_PLAYED" | -1 | "ACK_ERROR" | 0 | 1 | 2 | 3 | 4; invis?: boolean; isNewMsg?: boolean; star?: boolean; recvFresh?: boolean; broadcast?: boolean; isForwarded?: boolean; labels?: string[]; mentionedJidList?: ContactId[]; caption?: string; sender: Contact; timestamp: number; content: string; isGroupMsg: boolean; isMMS?: boolean; isMedia: boolean; isNotification: boolean; isPSA?: boolean; fromMe: boolean; chat: Chat; chatId: ChatId; author?: string; clientUrl?: string; deprecatedMms3Url?: string; isQuotedMsgAvailable: boolean; quotedMsg?: unknown; quotedMsgObj?: unknown; senderId?: string }

Related types: ChatId, Chat, ContactId, Contact, MessageId

FieldTypeRequired
idMessageId — MessageIdYes
bodystringYes
type"chat" | "audio" | "ptt" | "image" | "video" | "document" | "sticker" | "location" | "vcard" | "multi_vcard" | "revoked" | "order" | "buttons_response" | "list_response" | "unknown"Yes
tnumberYes
notifyNamestringNo
fromChatId — ChatIdYes
toChatId — ChatIdYes
self"in" | "out"Yes
ack"ACK_PENDING" | "ACK_SERVER" | "ACK_DEVICE" | "ACK_READ" | "ACK_PLAYED" | -1 | "ACK_ERROR" | 0 | 1 | 2 | 3 | 4Yes
invisbooleanNo
isNewMsgbooleanNo
starbooleanNo
recvFreshbooleanNo
broadcastbooleanNo
isForwardedbooleanNo
labelsstring[]No
mentionedJidListContactId[] — ContactIdNo
captionstringNo
senderContact — ContactYes
timestampnumberYes
contentstringYes
isGroupMsgbooleanYes
isMMSbooleanNo
isMediabooleanYes
isNotificationbooleanYes
isPSAbooleanNo
fromMebooleanYes
chatChat — ChatYes
chatIdChatId — ChatIdYes
authorstringNo
clientUrlstringNo
deprecatedMms3UrlstringNo
isQuotedMsgAvailablebooleanYes
quotedMsgunknownNo
quotedMsgObjunknownNo
senderIdstringNo

Additional provider fields may be present; narrow them before use.

SerializedMessageId

Type declaration
type SerializedMessageId = { _serialized: string }
FieldTypeRequired
_serializedstringYes

Additional provider fields may be present; narrow them before use.

BusinessProfile

Type declaration
type BusinessProfile = { id: ContactId; tag?: string; description?: string; categories?: { id: string; localized_display_name: string }[]; profileOptions?: { commerceExperience: "catalog" | "none" | "shop"; cartEnabled: boolean }; email?: string; website?: string[]; businessHours?: { config: Record<string, { mode: "specific_hours" | "open_24h" | "appointment_only"; hours: number[][] }>; timezone: string }; catalogStatus?: string; address?: string; fbPage?: unknown; igProfessional?: unknown; isProfileLinked?: boolean; coverPhoto?: { id: string; url: string }; latitude?: number; longitude?: number }

Related types: ContactId

FieldTypeRequired
idContactId — ContactIdYes
tagstringNo
descriptionstringNo
categories{ id: string; localized_display_name: string }[]No
profileOptions{ commerceExperience: "catalog" | "none" | "shop"; cartEnabled: boolean }No
emailstringNo
websitestring[]No
businessHours{ config: Record<string, { mode: "specific_hours" | "open_24h" | "appointment_only"; hours: number[][] }>; timezone: string }No
catalogStatusstringNo
addressstringNo
fbPageunknownNo
igProfessionalunknownNo
isProfileLinkedbooleanNo
coverPhoto{ id: string; url: string }No
latitudenumberNo
longitudenumberNo

Additional provider fields may be present; narrow them before use.

CartItem

Type declaration
type CartItem = { id: string; name: string; qty: number; thumbnailId: string; thumbnailUrl: string }
FieldTypeRequired
idstringYes
namestringYes
qtynumberYes
thumbnailIdstringYes
thumbnailUrlstringYes

Additional provider fields may be present; narrow them before use.

CommonGroup

Type declaration
type CommonGroup = { id: GroupId; title: string }

Related types: GroupId

FieldTypeRequired
idGroupId — GroupIdYes
titlestringYes

Additional provider fields may be present; narrow them before use.

CommunityAdminIds

Type declaration
type CommunityAdminIds = { id: GroupChatId; admins: ContactId[]; subgroup: boolean }

Related types: ContactId, GroupChatId

FieldTypeRequired
idGroupChatId — GroupChatIdYes
adminsContactId[] — ContactIdYes
subgroupbooleanYes

Additional provider fields may be present; narrow them before use.

CommunityAdmins

Type declaration
type CommunityAdmins = { id: GroupChatId; admins: Contact[]; subgroup: boolean }

Related types: Contact, GroupChatId

FieldTypeRequired
idGroupChatId — GroupChatIdYes
adminsContact[] — ContactYes
subgroupbooleanYes

Additional provider fields may be present; narrow them before use.

CommunityMetadata

Type declaration
type CommunityMetadata = { id: GroupId; subject: string; creation: number; owner?: ContactId; desc?: string; descTime?: number; descOwner?: ContactId; restrict?: boolean; announce?: boolean; participants: { id: ContactId; isAdmin: boolean; isSuperAdmin?: boolean }[]; subGroups: GroupMetadata[] }

Related types: ContactId, GroupId, GroupMetadata

FieldTypeRequired
idGroupId — GroupIdYes
subjectstringYes
creationnumberYes
ownerContactId — ContactIdNo
descstringNo
descTimenumberNo
descOwnerContactId — ContactIdNo
restrictbooleanNo
announcebooleanNo
participants{ id: ContactId; isAdmin: boolean; isSuperAdmin?: boolean }[] — ContactIdYes
subGroupsGroupMetadata[] — GroupMetadataYes

Additional provider fields may be present; narrow them before use.

CommunityParticipantIds

Type declaration
type CommunityParticipantIds = { id: GroupChatId; participants: ContactId[]; subgroup: boolean }

Related types: ContactId, GroupChatId

FieldTypeRequired
idGroupChatId — GroupChatIdYes
participantsContactId[] — ContactIdYes
subgroupbooleanYes

Additional provider fields may be present; narrow them before use.

CommunityParticipants

Type declaration
type CommunityParticipants = { id: GroupChatId; participants: Contact[]; subgroup: boolean }

Related types: Contact, GroupChatId

FieldTypeRequired
idGroupChatId — GroupChatIdYes
participantsContact[] — ContactYes
subgroupbooleanYes

Additional provider fields may be present; narrow them before use.

ContactStatus

Type declaration
type ContactStatus = { id: string; status: string }
FieldTypeRequired
idstringYes
statusstringYes

Additional provider fields may be present; narrow them before use.

FeatureFlags

WhatsApp feature flags keyed by name. Values are provider-defined and must be narrowed before use.

Type declaration
type FeatureFlags = Record<string, unknown>

GroupCreationResult

Type declaration
type GroupCreationResult = { gid: GroupId | Id; status?: number; participants?: Record<string, { code: number; invite_code?: string; invite_code_exp?: string }> | Record<string, unknown>[] }

Related types: GroupId, Id

FieldTypeRequired
gidGroupId | Id — GroupId, IdYes
statusnumberNo
participantsRecord<string, { code: number; invite_code?: string; invite_code_exp?: string }> | Record<string, unknown>[]No

Additional provider fields may be present; narrow them before use.

HealthCheck

Browser health diagnostics. This is not the Easy API /health HTTP envelope.

Type declaration
type HealthCheck = { queuedMessages?: number; state?: string; isPhoneDisconnected?: boolean; isHere?: boolean; wapiInjected?: boolean; online?: boolean; tryingToReachPhone?: boolean; retryingIn?: number; batteryLow?: boolean }
FieldTypeRequired
queuedMessagesnumberNo
statestringNo
isPhoneDisconnectedbooleanNo
isHerebooleanNo
wapiInjectedbooleanNo
onlinebooleanNo
tryingToReachPhonebooleanNo
retryingInnumberNo
batteryLowbooleanNo

Additional provider fields may be present; narrow them before use.

HostAccount

Host account attributes plus the current account ID. Additional WhatsApp Web attributes vary by version.

Type declaration
type HostAccount = { me: Id | ContactId }

Related types: ContactId, Id

FieldTypeRequired
meId | ContactId — ContactId, IdYes

Additional provider fields may be present; narrow them before use.

LLMMessage

Type declaration
type LLMMessage = { role: "user" | "assistant"; content: string }
FieldTypeRequired
role"user" | "assistant"Yes
contentstringYes

Additional provider fields may be present; narrow them before use.

Label

Type declaration
type Label = { id: string; name: string; items: ({ type: "Chat" | "Contact" | "Message"; id: string })[] }

Related types: Chat, Contact, Message

FieldTypeRequired
idstringYes
namestringYes
items({ type: "Chat" | "Contact" | "Message"; id: string })[] — Chat, Contact, MessageYes

Additional provider fields may be present; narrow them before use.

LicenseType

Type declaration
type LicenseType = "CUSTOM" | "B2B_RESTRICTED_VOLUME_LICENSE" | "Insiders Program" | "Text Story License Key" | "Image Story License Key" | "Video Story License Key" | "Premium License Key" | "NONE"

Related types: Story

MessageInfo

Type declaration
type MessageInfo = { id: MessageId; deliveryRemaining: number; playedRemaining: number; readRemaining: number; delivery: MessageInteraction[]; read: MessageInteraction[]; played: MessageInteraction[] }

Related types: MessageId, MessageInteraction

FieldTypeRequired
idMessageId — MessageIdYes
deliveryRemainingnumberYes
playedRemainingnumberYes
readRemainingnumberYes
deliveryMessageInteraction[] — MessageInteractionYes
readMessageInteraction[] — MessageInteractionYes
playedMessageInteraction[] — MessageInteractionYes

Additional provider fields may be present; narrow them before use.

MessageInteraction

Type declaration
type MessageInteraction = { id: ContactId; t: number }

Related types: ContactId

FieldTypeRequired
idContactId — ContactIdYes
tnumberYes

Additional provider fields may be present; narrow them before use.

NumberCheck

Type declaration
type NumberCheck = { id: Id | ContactId; status?: unknown; isBusiness?: boolean; canReceiveMessage: boolean; numberExists?: boolean }

Related types: ContactId, Id

FieldTypeRequired
idId | ContactId — ContactId, IdYes
statusunknownNo
isBusinessbooleanNo
canReceiveMessagebooleanYes
numberExistsbooleanNo

Additional provider fields may be present; narrow them before use.

NumberProfile

Provisional number profile based on the public Contact fields. Fields are optional and additional provider fields are unknown. The licensed getNumberProfile payload has not been verified against this model.

Type declaration
type NumberProfile = { id?: ContactId; name?: string | undefined; shortName?: string | undefined; pushname?: string | undefined; formattedName?: string | undefined; isBusiness?: boolean | undefined; isEnterprise?: boolean | undefined; isMe?: boolean | undefined; isMyContact?: boolean | undefined; isPSA?: boolean | undefined; isUser?: boolean | undefined; isWAContact?: boolean | undefined; labels?: string[] | undefined; msgs?: unknown[] | null | undefined; profilePicThumbObj?: { eurl?: string; id?: Id; img?: string; imgFull?: string; tag?: string } | undefined; statusMute?: boolean | undefined; type?: string | undefined; verifiedLevel?: number | undefined; verifiedName?: string | undefined; isOnline?: boolean | undefined; lastSeen?: number | undefined }

Related types: ContactId, Id

FieldTypeRequired
idContactId — ContactIdNo
namestring | undefinedNo
shortNamestring | undefinedNo
pushnamestring | undefinedNo
formattedNamestring | undefinedNo
isBusinessboolean | undefinedNo
isEnterpriseboolean | undefinedNo
isMeboolean | undefinedNo
isMyContactboolean | undefinedNo
isPSAboolean | undefinedNo
isUserboolean | undefinedNo
isWAContactboolean | undefinedNo
labelsstring[] | undefinedNo
msgsunknown[] | null | undefinedNo
profilePicThumbObj{ eurl?: string; id?: Id; img?: string; imgFull?: string; tag?: string } | undefined — IdNo
statusMuteboolean | undefinedNo
typestring | undefinedNo
verifiedLevelnumber | undefinedNo
verifiedNamestring | undefinedNo
isOnlineboolean | undefinedNo
lastSeennumber | undefinedNo

Additional provider fields may be present; narrow them before use.

Order

Type declaration
type Order = { id: string; createdAt: number; currency: string; products: CartItem[]; sellerJid: string; subtotal: string; total: string; message?: Message }

Related types: Message, CartItem

FieldTypeRequired
idstringYes
createdAtnumberYes
currencystringYes
productsCartItem[] — CartItemYes
sellerJidstringYes
subtotalstringYes
totalstringYes
messageMessage — MessageNo

Additional provider fields may be present; narrow them before use.

ProcessStats

Process diagnostics keyed by process ID. The provider controls each entry; no stable entry shape is guaranteed.

Type declaration
type ProcessStats = Record<string, unknown>

Product

Type declaration
type Product = { id: string; currency: string; name?: string; description?: string; isHidden?: boolean; catalogWid?: string; url?: string; availability?: number | "unknown"; reviewStatus?: "NO_REVIEW" | "PENDING" | "REJECTED" | "APPROVED" | "OUTDATED"; imageCdnUrl?: string; imageCount?: number; additionalImageCdnUrl?: string[]; priceAmount1000?: number; retailerId?: string; t?: number }
FieldTypeRequired
idstringYes
currencystringYes
namestringNo
descriptionstringNo
isHiddenbooleanNo
catalogWidstringNo
urlstringNo
availabilitynumber | "unknown"No
reviewStatus"NO_REVIEW" | "PENDING" | "REJECTED" | "APPROVED" | "OUTDATED"No
imageCdnUrlstringNo
imageCountnumberNo
additionalImageCdnUrlstring[]No
priceAmount1000numberNo
retailerIdstringNo
tnumberNo

Additional provider fields may be present; narrow them before use.

Story

Message-shaped status entry, based on the legacy story API. Chat and sender may be absent or null. The licensed getStories payload has not been verified against this model.

Type declaration
type Story = { id: MessageId; body: string; type: "chat" | "audio" | "ptt" | "image" | "video" | "document" | "sticker" | "location" | "vcard" | "multi_vcard" | "revoked" | "order" | "buttons_response" | "list_response" | "unknown"; t: number; notifyName?: string; from: ChatId; to: ChatId; self: "in" | "out"; ack: "ACK_PENDING" | "ACK_SERVER" | "ACK_DEVICE" | "ACK_READ" | "ACK_PLAYED" | -1 | "ACK_ERROR" | 0 | 1 | 2 | 3 | 4; invis?: boolean; isNewMsg?: boolean; star?: boolean; recvFresh?: boolean; broadcast?: boolean; isForwarded?: boolean; labels?: string[]; mentionedJidList?: ContactId[]; caption?: string; timestamp: number; content: string; isGroupMsg: boolean; isMMS?: boolean; isMedia: boolean; isNotification: boolean; isPSA?: boolean; fromMe: boolean; chatId: ChatId; author?: string; clientUrl?: string; deprecatedMms3Url?: string; isQuotedMsgAvailable: boolean; quotedMsg?: unknown; quotedMsgObj?: unknown; senderId?: string; chat?: Chat | null; sender?: Contact | null }

Related types: ChatId, Chat, ContactId, Contact, MessageId

FieldTypeRequired
idMessageId — MessageIdYes
bodystringYes
type"chat" | "audio" | "ptt" | "image" | "video" | "document" | "sticker" | "location" | "vcard" | "multi_vcard" | "revoked" | "order" | "buttons_response" | "list_response" | "unknown"Yes
tnumberYes
notifyNamestringNo
fromChatId — ChatIdYes
toChatId — ChatIdYes
self"in" | "out"Yes
ack"ACK_PENDING" | "ACK_SERVER" | "ACK_DEVICE" | "ACK_READ" | "ACK_PLAYED" | -1 | "ACK_ERROR" | 0 | 1 | 2 | 3 | 4Yes
invisbooleanNo
isNewMsgbooleanNo
starbooleanNo
recvFreshbooleanNo
broadcastbooleanNo
isForwardedbooleanNo
labelsstring[]No
mentionedJidListContactId[] — ContactIdNo
captionstringNo
timestampnumberYes
contentstringYes
isGroupMsgbooleanYes
isMMSbooleanNo
isMediabooleanYes
isNotificationbooleanYes
isPSAbooleanNo
fromMebooleanYes
chatIdChatId — ChatIdYes
authorstringNo
clientUrlstringNo
deprecatedMms3UrlstringNo
isQuotedMsgAvailablebooleanYes
quotedMsgunknownNo
quotedMsgObjunknownNo
senderIdstringNo
chatChat | null — ChatNo
senderContact | null — ContactNo

Additional provider fields may be present; narrow them before use.

BookingContent

Type declaration
type BookingContent = { version?: 1; body: string; footer?: string; type: "booking"; title?: string; buttonLabel?: string; booking: { startAt: string; endAt?: string; location?: string; url?: string; managementUrl?: string; phoneNumber?: string; email?: string; description?: string; labels?: { language?: string; meetingType?: string; detailsTitle?: string; addToCalendar?: string; viewOnMap?: string; manageBooking?: string } }; actions?: (LinkAction | CallAction | CopyAction)[] }

Related types: CallAction, CopyAction, LinkAction

FieldTypeRequired
version1No
bodystringYes
footerstringNo
type"booking"Yes
titlestringNo
buttonLabelstringNo
booking{ startAt: string; endAt?: string; location?: string; url?: string; managementUrl?: string; phoneNumber?: string; email?: string; description?: string; labels?: { language?: string; meetingType?: string; detailsTitle?: string; addToCalendar?: string; viewOnMap?: string; manageBooking?: string } }Yes
actions(LinkAction | CallAction | CopyAction)[] — CallAction, CopyAction, LinkActionNo

Additional provider fields may be present; narrow them before use.

ButtonsContent

Type declaration
type ButtonsContent = { version?: 1; body: string; footer?: string; type: "buttons"; header?: InteractiveHeader; actions: InteractiveAction[] }

Related types: InteractiveAction, InteractiveHeader

FieldTypeRequired
version1No
bodystringYes
footerstringNo
type"buttons"Yes
headerInteractiveHeader — InteractiveHeaderNo
actionsInteractiveAction[] — InteractiveActionYes

Additional provider fields may be present; narrow them before use.

CallAction

Type declaration
type CallAction = { type: "call"; label: string; phoneNumber: string }
FieldTypeRequired
type"call"Yes
labelstringYes
phoneNumberstringYes

Additional provider fields may be present; narrow them before use.

CarouselCard

Type declaration
type CarouselCard = { body: string; header: { type: "image"; source: string; filename?: string; title?: string }; actions: InteractiveAction[] }

Related types: InteractiveAction

FieldTypeRequired
bodystringYes
header{ type: "image"; source: string; filename?: string; title?: string }Yes
actionsInteractiveAction[] — InteractiveActionYes

Additional provider fields may be present; narrow them before use.

CarouselContent

Type declaration
type CarouselContent = { version?: 1; body: string; footer?: string; type: "carousel"; cards: CarouselCard[] }

Related types: CarouselCard

FieldTypeRequired
version1No
bodystringYes
footerstringNo
type"carousel"Yes
cardsCarouselCard[] — CarouselCardYes

Additional provider fields may be present; narrow them before use.

CopyAction

Type declaration
type CopyAction = { type: "copy"; label: string; code: string }
FieldTypeRequired
type"copy"Yes
labelstringYes
codestringYes

Additional provider fields may be present; narrow them before use.

FormContent

Type declaration
type FormContent = { version?: 1; body: string; footer?: string; type: "form"; title?: string; questions: FormQuestion[] }

Related types: FormQuestion

FieldTypeRequired
version1No
bodystringYes
footerstringNo
type"form"Yes
titlestringNo
questionsFormQuestion[] — FormQuestionYes

Additional provider fields may be present; narrow them before use.

FormQuestion

Type declaration
type FormQuestion = { type: "singleSelect" | "multiSelect"; id: string; label: string; options: { id: string; label: string }[]; allowCustomAnswer?: boolean }
FieldTypeRequired
type"singleSelect" | "multiSelect"Yes
idstringYes
labelstringYes
options{ id: string; label: string }[]Yes
allowCustomAnswerbooleanNo

Additional provider fields may be present; narrow them before use.

FormResponse

Type declaration
type FormResponse = { messageId: string; chatId: string; senderId: string; originalMessageId?: string; timestamp?: number; raw: JsonObject; type: "form"; answers: Record<string, string | string[]> }

Related types: JsonObject

FieldTypeRequired
messageIdstringYes
chatIdstringYes
senderIdstringYes
originalMessageIdstringNo
timestampnumberNo
rawJsonObject — JsonObjectYes
type"form"Yes
answersRecord<string, string | string[]>Yes

Additional provider fields may be present; narrow them before use.

InteractiveAction

Type declaration
type InteractiveAction = ReplyAction | LinkAction | CallAction | CopyAction

Related types: CallAction, CopyAction, LinkAction, ReplyAction

InteractiveContent

Type declaration
type InteractiveContent = ButtonsContent | ListContent | FormContent | CarouselContent | BookingContent | NativeContent

Related types: BookingContent, ButtonsContent, CarouselContent, FormContent, ListContent, NativeContent

InteractiveHeader

Type declaration
type InteractiveHeader = { type: "text"; text: string } | { type: "image"; source: string; filename?: string; title?: string } | { type: "video"; source: string; filename?: string; title?: string } | { type: "document"; source: string; filename?: string; title?: string }

InteractiveResponse

Type declaration
type InteractiveResponse = FormResponse | { messageId: string; chatId: string; senderId: string; originalMessageId?: string; timestamp?: number; raw: JsonObject; type: "reply"; id: string; label?: string } | { messageId: string; chatId: string; senderId: string; originalMessageId?: string; timestamp?: number; raw: JsonObject; type: "list"; id: string; label?: string } | { messageId: string; chatId: string; senderId: string; originalMessageId?: string; timestamp?: number; raw: JsonObject; type: "native"; name: string; parameters?: JsonValue; parseError?: string }

Related types: FormResponse, JsonObject, JsonValue

JsonObject

Type declaration
type JsonObject = Record<string, JsonValue>

Related types: JsonValue

JsonValue

Type declaration
type JsonValue = null | boolean | number | string | JsonValue[] | Record<string, JsonValue>

LinkAction

Type declaration
type LinkAction = { type: "url"; label: string; url: string }
FieldTypeRequired
type"url"Yes
labelstringYes
urlstringYes

Additional provider fields may be present; narrow them before use.

ListContent

Type declaration
type ListContent = { version?: 1; body: string; footer?: string; type: "list"; title?: string; buttonLabel?: string; sections: { title?: string; rows: ListRow[] }[] }

Related types: ListRow

FieldTypeRequired
version1No
bodystringYes
footerstringNo
type"list"Yes
titlestringNo
buttonLabelstringNo
sections{ title?: string; rows: ListRow[] }[] — ListRowYes

Additional provider fields may be present; narrow them before use.

ListRow

Type declaration
type ListRow = { id: string; title: string; description?: string }
FieldTypeRequired
idstringYes
titlestringYes
descriptionstringNo

Additional provider fields may be present; narrow them before use.

NativeAction

Type declaration
type NativeAction = { name: string; parameters?: JsonObject }

Related types: JsonObject

FieldTypeRequired
namestringYes
parametersJsonObject — JsonObjectNo

Additional provider fields may be present; narrow them before use.

NativeContent

Advanced extension for new native action types; parameters are passed through without claiming recipient support

Type declaration
type NativeContent = { version?: 1; body: string; footer?: string; type: "native"; header?: InteractiveHeader; actions: NativeAction[]; parameters?: JsonObject }

Related types: InteractiveHeader, JsonObject, NativeAction

FieldTypeRequired
version1No
bodystringYes
footerstringNo
type"native"Yes
headerInteractiveHeader — InteractiveHeaderNo
actionsNativeAction[] — NativeActionYes
parametersJsonObject — JsonObjectNo

Additional provider fields may be present; narrow them before use.

ReplyAction

Type declaration
type ReplyAction = { type: "reply"; id: string; label: string }
FieldTypeRequired
type"reply"Yes
idstringYes
labelstringYes

Additional provider fields may be present; narrow them before use.

Was this helpful?

Your answer includes the page path and docs version.

On this page