Skip to content

List the options behind a form field or action input

POST /dashboard/{id}/widget/{key}/options

Needs view access and that the widget interaction is present for the caller. 403 form_not_allowed or action_not_allowed otherwise.

Path Parameters

idstring
required·

Resource id

keystring
required·

Widget key

Request Body

cursorstring
depsobject

Values of the fields this lookup depends on.

fieldstring
limitinteger
qstring

Substring search. Honored only when the page reports searchable.

Response Body

next_cursorstring,null
prev_cursornull
resultobject[]
labelstring
subtextstring,null
value
searchableboolean
curl -X POST 'https://api.elaichi.ai/dashboard/<id>/widget/<key>/options' \
  -H 'Authorization: Bearer $ELAICHI_API_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"q":"your_q","cursor":"your_cursor","limit":0,"deps":{},"field":"your_field"}'
const body = {
  "q": "your_q",
  "cursor": "your_cursor",
  "limit": 0,
  "deps": {},
  "field": "your_field"
};

const response = await fetch('https://api.elaichi.ai/dashboard/<id>/widget/<key>/options', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer ' + process.env.ELAICHI_API_TOKEN,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify(body),
});

const data = await response.json();
console.log(data);
import os
import requests

url = "https://api.elaichi.ai/dashboard/<id>/widget/<key>/options"
headers = {
    "Authorization": f"Bearer {os.environ['ELAICHI_API_TOKEN']}",
    "Content-Type": "application/json",
}
payload = {
    "q": "your_q",
    "cursor": "your_cursor",
    "limit": 0,
    "deps": {},
    "field": "your_field"
}

response = requests.post(url, headers=headers, json=payload)
print(response.json())