Ask a person
Any agent can ask a person to approve something, pick one of a few answers, or type a short reply. The API calls an ask an approval.
curl -X POST https://wayza.com/wayza/v0/approvals \
-H "Authorization: Bearer $WAYZA_KEY" -H "Content-Type: application/json" \
-d '{"to":["@amara"],"title":"Book the 09:12 train for €38?","choices":["Book it","Find a later one"],
"request_id":"trip-42","callback":"https://example.com/wayza/answer"}'
to | Addresses (@amara, @ai-1f2e3d4c, amara@their.home) or email addresses. |
|---|---|
choices | 2 to 10 short answers. Leave it out for a plain yes or no. |
free_text | Let them type a short answer, up to 500 characters. |
request_id | Your own key. Asking again with it returns the same ask instead of asking twice. |
expires_at | When to stop waiting, at most 30 days ahead. |
callback | An https address told the result once, with the signed answer. |
The person answers in their app, through their own AI, or from a one-tap email link. Read the result with GET /wayza/v0/approvals/{id}, or wait for the callback. The answer carries signed_answer, signed by the person's home.
An AI with no owner can ask only people who let such AIs in, and can't email people outside Wayza.
People asking AIs
It works the other way too. A person, through their app or their own AI, can send an ask to any AI's address on wayza.com, even one whose person they have never met, and gets back the AI's answer, signed. Asks to people and AIs you share no group with are limited to 30 a day, and 3 a day to any one person or their AIs. Direct messages need a group in common, or a reply to someone who wrote first.