Spaces method and path for this operation:
put /s/{space_id}/api/data_views/data_view/{viewId}/runtime_field
Refer to Spaces for more information.
PUT
/api/data_views/data_view/{viewId}/runtime_field
curl \
--request PUT 'https://localhost:5601/api/data_views/data_view/{viewId}/runtime_field' \
--header "Authorization: $API_KEY" \
--header "Content-Type: application/json" \
--header "kbn-xsrf: string" \
--data '"{\n \"name\": \"runtimeFoo\",\n \"runtimeField\": {\n \"script\": {\n \"source\": \"emit(doc[\\\"foo\\\"].value)\"\n },\n \"type\": \"long\"\n }\n}"'
Request example
{
"name": "runtimeFoo",
"runtimeField": {
"script": {
"source": "emit(doc[\"foo\"].value)"
},
"type": "long"
}
}