> This page is for API Reference & Tools.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.moveworks.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.moveworks.com/_mcp/server.

# Refresh modal

POST https://api.moveworks.ai/rest/v1/conversations/{conversation_id}/responses/{response_id}/messages/{message_id}/modals/{modal_id}/refresh
Content-Type: application/json

Re-evaluates the modal's conditional field rules against the values entered so far. Call it after changing the value of a field flagged with `triggers_refresh`, then re-render the modal from the response.

The response carries every field with its state re-resolved, with one exception: choice fields omit their `options` list. Re-apply the options you received when you first retrieved the modal.

Nothing is persisted: the stored modal is never modified, and a refresh never changes the title. Send all current values, since rules are re-evaluated against the snapshot you provide and a partial map yields partially resolved state.

Reference: https://docs.moveworks.com/api-reference/conversations-api/conversations-api/modals/refresh-modal

## Authentication

- `Authorization` header (bearer token, required) — JWT bearer token authentication. Obtain an access token from the Moveworks auth endpoint and include it in the Authorization header as 'Bearer \<token>'.

## Request

### Path parameters

- `conversation_id` (string, required) — A base-62 identifier prefixed by a short resource type
- `response_id` (string, required) — A base-62 identifier prefixed by a short resource type
- `message_id` (string, required) — A base-62 identifier prefixed by a short resource type
- `modal_id` (string, required) — Opaque modal identifier, taken from the `modal_action.modal_id` of the action that surfaced this modal. Pass it back exactly as received.

### Headers

- `Assistant-Name` (string, required) — The Moveworks assistant identifier that was configured for your organization.

### Body (application/json)

This endpoint expects a RefreshModalRequest.

- `values` (map from string to ModalFieldValue, required) — All current field values, keyed by the field's `name`. Rules are re-evaluated against this snapshot, so a partial map yields partially resolved state.

## Response

### 200

Modal re-resolved successfully

- `modal_id` (string, required) — Opaque modal identifier, echoed from the `MODAL_ACTION` that surfaced this modal.
- `title` (string, required) — Modal title to display.
- `fields` (list of ModalField, required) — Fields in display order. Render them in the order returned.

## Errors

### 400 Bad Request Error

Invalid request - a submitted value does not match its field type, or names a field that is not part of this modal

- `error` (InvalidModalRequestErrorResponseError, required)

### 401 Unauthorized Error

Unauthorized - Invalid or missing authentication

- `error` (UnauthorizedErrorResponseError, required)

### 403 Forbidden Error

Forbidden - Invalid assistant

- `error` (ForbiddenErrorResponseError, required)

### 404 Not Found Error

Not found - conversation, response, message, or modal does not exist

- `error` (NotFoundErrorResponseError, required)

### 429 Too Many Requests Error

Rate limit exceeded

- `error` (RateLimitExceededErrorResponseError, required)

### 500 Internal Server Error

Internal server error

- `error` (InternalErrorResponseError, required)

## Types

### ModalFieldValue

A submitted value for a single modal field. Exactly one member is present, and it must match the field's `type`: `TEXT` uses `text`, `DATE` uses `date`, `DATETIME` uses `datetime`, `BOOLEAN` uses `bool`, `CHOICE` uses `option` when `multi` is `false` and `options` when it is `true`, and `FILE` uses `files`. A value whose member does not match the field type is rejected.

- `text` (string, optional) — `TEXT` value, in whatever language the user typed.
- `date` (date, optional) — `DATE` value as `YYYY-MM-DD`.
- `datetime` (datetime, optional) — `DATETIME` value as an RFC 3339 timestamp, in UTC or with an explicit offset.
- `bool` (boolean, optional) — `BOOLEAN` value. Submitted explicitly rather than omitted, since an untouched toggle is `false` rather than unanswered.
- `option` (string, optional) — Single-select `CHOICE` value, holding the option's `value`.
- `options` (list of string, optional) — Multi-select `CHOICE` values, each holding an option's `value`.
- `files` (list of ModalFileValue, optional) — `FILE` values. At most `max_files` entries.

### ModalField

A single field in a modal. Exactly one type-specific payload is present, named after `type`: `TEXT` populates `text`, `DATE` populates `date`, and so on.

- `type` (enum, required) — Field kind discriminator. Determines which type-specific payload is present on the field, and which value shape it accepts on submit.
  - Allowed values: `TEXT`, `DATE`, `DATETIME`, `BOOLEAN`, `CHOICE`, `FILE`, `DISPLAY`
- `name` (string, optional) — Stable submission key, unique within the modal. Opaque to clients: it may contain dots (for example `form_data.priority`) and must be echoed verbatim as the `values` map key on refresh and submit. Absent on `DISPLAY` blocks, which are never submitted.
- `label` (string, optional) — Label to display for the field.
- `description` (string, optional) — Help text describing how to fill the field.
- `required` (boolean, optional) — A value must be submitted for this field.
- `visible` (boolean, optional) — Whether to show the field to the user. Fields that resolve to hidden are neither required nor persisted.
- `read_only` (boolean, optional) — Field is display-locked: render the value but reject edits.
- `triggers_refresh` (boolean, optional) — Changing this field's value can change other fields' state. Call the refresh endpoint after the value changes, and re-render from the modal it returns. Submitting a modal whose flagged field changed without an intervening refresh can fail validation.
- `text` (ModalTextField, optional) — Free text, single-line or multiline.
- `date` (ModalDateField, optional) — Calendar date, with no time and no timezone. A `DATE` is never widened to a `DATETIME` on submit.
- `datetime` (ModalDateTimeField, optional) — An instant in time.
- `boolean` (ModalBooleanField, optional) — A toggle. It has no unanswered state, so an untouched field submits `false`.
- `choice` (ModalChoiceField, optional) — Selection from a set of options, single or multiple.
- `file` (ModalFileField, optional) — File upload, submitted by handle rather than by bytes.
- `display` (ModalDisplayField, optional) — Display-only block interleaved with the input fields. Exactly one of `text`, `image`, or `download` is present. Never required, never submitted, and never present in a `values` map.

### InvalidModalRequestErrorResponseError

- `code` (enum, required)
  - Allowed values: `INVALID_REQUEST`
- `message` (string, required)

### UnauthorizedErrorResponseError

- `code` (enum, required)
  - Allowed values: `UNAUTHORIZED`
- `message` (string, required)

### ForbiddenErrorResponseError

- `code` (enum, required)
  - Allowed values: `FORBIDDEN`
- `message` (string, required)

### NotFoundErrorResponseError

- `code` (enum, required)
  - Allowed values: `NOT_FOUND`
- `message` (string, required)

### RateLimitExceededErrorResponseError

- `code` (enum, required)
  - Allowed values: `RATE_LIMIT_EXCEEDED`
- `message` (string, required)

### InternalErrorResponseError

- `code` (enum, required)
  - Allowed values: `INTERNAL_ERROR`
- `message` (string, required)

### ModalFileValue

Reference to a file uploaded ahead of submission.

- `file_id` (string, required) — Id of a file uploaded ahead of submission. The bytes themselves never travel through the modal endpoints, and the file name and content type are resolved from the upload rather than submitted, so what gets attached is what was actually uploaded. Uploads expire roughly 24 hours after they are created, and an expired id fails submission validation.

### ModalTextField

Free text, single-line or multiline.

- `multiline` (boolean, optional) — Render as a textarea rather than a single-line input.
- `prefill` (string, optional) — Initial value, user-editable. Often drafted from the conversation, and submitted as-is if the user does not change it.

### ModalDateField

Calendar date, with no time and no timezone. A `DATE` is never widened to a `DATETIME` on submit.

- `prefill` (date, optional) — Initial calendar date as `YYYY-MM-DD`.

### ModalDateTimeField

An instant in time.

- `prefill` (datetime, optional) — Initial instant as an RFC 3339 timestamp, in UTC or with an explicit offset.

### ModalBooleanField

A toggle. It has no unanswered state, so an untouched field submits `false`.

- `prefill` (boolean, optional) — Initial toggle state.

### ModalChoiceField

Selection from a set of options, single or multiple.

- `multi` (boolean, optional) — Allow more than one selection. Single-select submits `option`, multi-select submits `options`.
- `options` (list of ModalChoiceOption, optional) — Selectable options in display order. Returned when the modal is first retrieved. The refresh endpoint omits it, so keep the options in your own state and re-apply them to the refreshed field.
- `allows_free_input` (boolean, optional) — Accept a submitted value that is not in `options`, skipping membership validation. Typical for "type to search, or enter your own".
- `prefill` (list of ModalChoiceOption, optional) — Initially selected options. Holds at most one entry when `multi` is `false`.

### ModalFileField

File upload, submitted by handle rather than by bytes.

- `max_files` (integer, required) — Maximum number of files. Submitting more fails validation.

### ModalDisplayField

Display-only block interleaved with the input fields. Exactly one of `text`, `image`, or `download` is present. Never required, never submitted, and never present in a `values` map.

- `text` (ModalDisplayTextContent, optional)
- `image` (ModalDisplayImageContent, optional)
- `download` (ModalDisplayDownloadContent, optional)

### ModalChoiceOption

- `value` (string, required) — The value to submit for this option.
- `display_value` (string, required) — Label to show the user. Never submitted.

### ModalDisplayTextContent

- `text` (string, required) — Text to display.
- `style` (enum, optional) — Rendering treatment for a display text block. `NORMAL` is regular body text and supports CommonMark, `HEADER` is a large bold heading, `SUBTLE` is a small gray caption.
  - Allowed values: `NORMAL`, `HEADER`, `SUBTLE`

### ModalDisplayImageContent

- `url` (string, required) — URL of the image to display.

### ModalDisplayDownloadContent

- `url` (string, required) — URL of the file to download.
- `text` (string, optional) — Link text to display.

## Examples

**Request**

```json
{
  "values": {
    "priority": {
      "option": "high"
    },
    "short_description": {
      "text": "Laptop will not connect to the VPN"
    }
  }
}
```

**Response**

```json
{
  "modal_id": "modal_32bt9QpLmRvXnTkWzc4Ha",
  "title": "File an IT ticket",
  "fields": [
    {
      "type": "DISPLAY",
      "visible": true,
      "display": {
        "text": {
          "text": "We will route this to the IT service desk.",
          "style": "SUBTLE"
        }
      }
    },
    {
      "type": "TEXT",
      "name": "short_description",
      "label": "Short description",
      "description": "One line summarizing the problem.",
      "required": true,
      "visible": true,
      "read_only": false,
      "triggers_refresh": false,
      "text": {
        "multiline": false,
        "prefill": "Laptop will not connect to the VPN"
      }
    },
    {
      "type": "CHOICE",
      "name": "priority",
      "label": "Priority",
      "required": true,
      "visible": true,
      "read_only": false,
      "triggers_refresh": true,
      "choice": {
        "multi": false,
        "allows_free_input": false,
        "prefill": [
          {
            "value": "high",
            "display_value": "High"
          }
        ]
      }
    },
    {
      "type": "TEXT",
      "name": "business_impact",
      "label": "Business impact",
      "description": "Required for high priority tickets.",
      "required": true,
      "visible": true,
      "read_only": false,
      "triggers_refresh": false,
      "text": {
        "multiline": true
      }
    },
    {
      "type": "FILE",
      "name": "screenshots",
      "label": "Screenshots",
      "required": false,
      "visible": true,
      "read_only": false,
      "triggers_refresh": false,
      "file": {
        "max_files": 3
      }
    }
  ]
}
```

**SDK Code**

```python Modals_refreshModal_example
import requests

url = "https://api.moveworks.ai/rest/v1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/modals/modal_32bt9QpLmRvXnTkWzc4Ha/refresh"

payload = { "values": {
        "priority": { "option": "high" },
        "short_description": { "text": "Laptop will not connect to the VPN" }
    } }
headers = {
    "Assistant-Name": "acmecorp-conversations-rest-api",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Modals_refreshModal_example
const url = 'https://api.moveworks.ai/rest/v1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/modals/modal_32bt9QpLmRvXnTkWzc4Ha/refresh';
const options = {
  method: 'POST',
  headers: {
    'Assistant-Name': 'acmecorp-conversations-rest-api',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"values":{"priority":{"option":"high"},"short_description":{"text":"Laptop will not connect to the VPN"}}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Modals_refreshModal_example
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.moveworks.ai/rest/v1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/modals/modal_32bt9QpLmRvXnTkWzc4Ha/refresh"

	payload := strings.NewReader("{\n  \"values\": {\n    \"priority\": {\n      \"option\": \"high\"\n    },\n    \"short_description\": {\n      \"text\": \"Laptop will not connect to the VPN\"\n    }\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Assistant-Name", "acmecorp-conversations-rest-api")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Modals_refreshModal_example
require 'uri'
require 'net/http'

url = URI("https://api.moveworks.ai/rest/v1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/modals/modal_32bt9QpLmRvXnTkWzc4Ha/refresh")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Assistant-Name"] = 'acmecorp-conversations-rest-api'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"values\": {\n    \"priority\": {\n      \"option\": \"high\"\n    },\n    \"short_description\": {\n      \"text\": \"Laptop will not connect to the VPN\"\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Modals_refreshModal_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.moveworks.ai/rest/v1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/modals/modal_32bt9QpLmRvXnTkWzc4Ha/refresh")
  .header("Assistant-Name", "acmecorp-conversations-rest-api")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"values\": {\n    \"priority\": {\n      \"option\": \"high\"\n    },\n    \"short_description\": {\n      \"text\": \"Laptop will not connect to the VPN\"\n    }\n  }\n}")
  .asString();
```

```php Modals_refreshModal_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.moveworks.ai/rest/v1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/modals/modal_32bt9QpLmRvXnTkWzc4Ha/refresh', [
  'body' => '{
  "values": {
    "priority": {
      "option": "high"
    },
    "short_description": {
      "text": "Laptop will not connect to the VPN"
    }
  }
}',
  'headers' => [
    'Assistant-Name' => 'acmecorp-conversations-rest-api',
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp Modals_refreshModal_example
using RestSharp;

var client = new RestClient("https://api.moveworks.ai/rest/v1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/modals/modal_32bt9QpLmRvXnTkWzc4Ha/refresh");
var request = new RestRequest(Method.POST);
request.AddHeader("Assistant-Name", "acmecorp-conversations-rest-api");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"values\": {\n    \"priority\": {\n      \"option\": \"high\"\n    },\n    \"short_description\": {\n      \"text\": \"Laptop will not connect to the VPN\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Modals_refreshModal_example
import Foundation

let headers = [
  "Assistant-Name": "acmecorp-conversations-rest-api",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["values": [
    "priority": ["option": "high"],
    "short_description": ["text": "Laptop will not connect to the VPN"]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.moveworks.ai/rest/v1/conversations/conv_32bt7BMLhLyVzTUjfi35N/responses/resp_32bt7rXXugeJjvE3pQzOk/messages/msg_32bt8vagXAoRwRLIdI2Oj/modals/modal_32bt9QpLmRvXnTkWzc4Ha/refresh")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```