RevoplyAIDocs
Flow triggers

Sending requests

The request a flow trigger accepts, the path syntax for mapping fields, and how phone numbers and languages are read.

The request

PartRule
Method and URLPOST to the flow's URL, https://api.revoplyai.com/hooks/rvh_…
Content-Typeapplication/json (or any +json type); anything else is 415 unsupported_media_type
BodyAny JSON, up to 64 KB (65,536 bytes); larger is 413 payload_too_large
Idempotency-KeyOptional, strongly recommended: your id for the event, up to 200 characters. See Idempotency
AuthenticationNone besides the URL: its token is the credential

Send the JSON your system already produces. The flow's trigger settings say where in it to find the customer's phone number, name and language, and which values to keep.

curl --silent --show-error "$REVOPLY_HOOK_URL" \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: order-10482-shipped' \
  --data '{
    "order": { "id": "10482", "status": "shipped" },
    "customer": { "name": "نورة العتيبي", "phone": "+966501234567" }
  }' \
  --write-out '\nHTTP %{http_code}\n'

Paths

A path names one value in your JSON: property names joined by dots, and array positions in square brackets.

PathReads
customer.phone{"customer": {"phone": "+966501234567"}}
items[0].nameThe name of the first item in items
$.order.idorder.id; a leading $ or $. is ignored
[0].idThe id of the first element when the body is an array
order-id, العميل.الجوالKeys with dashes or Arabic letters, as written
  • Property names are taken literally: any character except ., [, ] and spaces. There is no quoting, so a key that contains a dot cannot be reached.
  • No wildcards, filters or slices. A path is at most 200 characters and 12 steps.
  • A string is read as it is; a number or true/false as JSON writes it; an object or an array as compact JSON. A missing value or null counts as empty. Spaces around a value are removed.

What the trigger reads

SettingRequiredRead as
Customer's phone numberYesA phone number; see below. Missing or unreadable: 422 invalid_phone
Customer's nameNoUp to 200 characters; used for a contact we create
Customer's languageNoar or en; see below
Values to keepNoUp to 10, each up to 1,000 characters, as variables for the flow's steps

Phone numbers

Send numbers in E.164, such as +966501234567. We also read:

  • spaces, dashes, brackets and Arabic-Indic digits (٠٥٠١٢٣٤٥٦٧), which are ignored or converted;
  • 00 in place of +: 00966501234567;
  • the country code without +: 966501234567;
  • a stray 0 after the country code of the countries listed below: +9660501234567.

A number without its country code, such as 0501234567, is read as a mobile number in the country of the flow's WhatsApp number, and only when that country is Saudi Arabia, the United Arab Emirates, Kuwait, Qatar, Bahrain, Oman or Egypt. Anywhere else it is refused with 422 invalid_phone rather than guessed: a number placed in the wrong country would send your message to a stranger.

Language

The run uses this language. Values starting with ar (ar, ar-SA), and arabic, عربي or العربية, mean Arabic; values starting with en, and english, mean English; letter case is ignored. Anything else, or no value, falls back to the language on the customer's contact.

The last request

The builder keeps the last request each URL received, so you can map fields by tapping them. It keeps the body's shape, not all of it: long lists are cut to their first 3 items and long strings to their first 200 characters. It is kept for 30 days after it arrived. Every new request with a JSON body replaces it, even one refused for another reason, such as a flow that is switched off or a phone number that cannot be read.

On this page