---
title: "Update a runtime field"
method: POST
path: "/api/data_views/data_view/{viewId}/runtime_field/{fieldName}"
tags: ["data views"]
---

# Update a runtime field

`POST /api/data_views/data_view/{viewId}/runtime_field/{fieldName}`

**Spaces method and path for this operation:**

<div><span class="operation-verb post">post</span>&nbsp;<span class="operation-path">/s/{space_id}/api/data_views/data_view/{viewId}/runtime_field/{fieldName}</span></div>

Refer to [Spaces](https://www.elastic.co/docs/deploy-manage/manage-spaces) for more information.

Update an existing runtime field in a data view. Only the fields provided in the request body are updated.

## Path parameters

- `fieldName` string, required
- `viewId` string, required

## Request body

- object
  - `runtimeField` object, required — The runtime field definition object. You can update following fields: - `type` - `script`

## Response `200`

Indicates a successful call.

## Other responses

- `400` — Bad request

---

[API](https://skmtc.dev/elastic/apis/kibana-apis.md) · [All operations](https://skmtc.dev/elastic/apis/kibana-apis/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/elastic/kibana-apis/revisions/6fcca8783738/schema)
