Interface DataExchangeRequest

The body Wabery POSTs to your data_exchange_url. WhatsApp's decrypted payload (action, screen, data) merged with the session identity Wabery knows. The identity fields are authoritative (set after merging WhatsApp's payload).

interface DataExchangeRequest {
    action: DataExchangeAction;
    agent_id: string;
    changed_field?: null | string;
    contact_id: null | string;
    contact_reference: null | string;
    data?: Record<string, unknown>;
    flow_id: string;
    flow_token: string;
    from: null | string;
    organization_id: string;
    screen?: string;
    triggered_by?: null | "footer" | "field_change";
    [key: string]: unknown;
}

Indexable

  • [key: string]: unknown

Properties

agent_id: string
changed_field?: null | string

For triggered_by: "field_change", the name of the field that changed.

contact_id: null | string
contact_reference: null | string

Your own id for this person (the contact's referenceId / externalId).

data?: Record<string, unknown>

Values already chosen on the current screen (internal __wabery_* markers stripped).

flow_id: string
flow_token: string

Identifies this send. Echo it in a SUCCESS reply, or leave it out and Wabery adds it.

from: null | string

The person's phone number in E.164 format, e.g. +15551234567.

organization_id: string
screen?: string

Current screen id.

triggered_by?: null | "footer" | "field_change"

What fired this exchange, so branching is deterministic instead of inferred: "footer" when the user advanced the screen, "field_change" when a refreshOnSelect field changed. null for INIT, BACK, and hand-written Flow JSON.