Forms API
Warning
This API is in alpha preview, and may be changed or removed in the future.
Progressive disclosure of form fields and validation of form data is supported by our Forms Interaction API.
The Transport Demo Agent illustrates how to use this feature;
please click on the Code tab to see this Agent's YAML code, and note its JSON Schema embedded in output.schema.properties.
Create an API Key to use the Forms _Preview_ API, e.g. with curl:
curl --no-progress-meter -X 'POST' 'https://api.aish.li/v1/form?agent=demo%2Ftransport' \
-H 'X-API-Key: sk_...' \
| jq .
returns:
{
"sessionID": "uXxvDmOLaYkGU0qIMpd359Q",
"mapForm": {
"nextQuestion": "Do you need a ride? Just let me know your origin, destination, day and time you're interested in!\n",
"isFormComplete": false
}
}
You can then use the returned sessionID to submit the user's input and progressively validate or disclose remaining fields, e.g.:
curl --no-progress-meter -X 'POST' \
'https://api.aish.li/v1/form/uXxvDmOLaYkGU0qIMpd359Q?agent=demo%2Ftransport' \
-H 'X-API-Key: sk_...' \
-d 'John Doe, from Novello to Barolo' \
| jq .
which will return:
{
"sessionID": "uXxvDmOLaYkGU0qIMpd359Q",
"mapForm": {
"data": {
"origin_longitude": 7.9258,
"origin_date_time": "2026-09-26T15:09Z",
"destination_latitude": 44.6104,
"origin": "Novello",
"name": "John Doe",
"destination": "Barolo",
"destination_longitude": 7.9414,
"origin_latitude": 44.5894
},
"isFormComplete": true
}
}