---
title: "Update a single variable on a case instance"
method: PUT
path: "/cmmn-runtime/case-instances/{caseInstanceId}/variables/{variableName}"
tags: ["Case Instance Variables"]
---

# Update a single variable on a case instance

`PUT /cmmn-runtime/case-instances/{caseInstanceId}/variables/{variableName}`

## Request

- Base URL: `https://developer-docs.flowable.com/cmmn-api`
- URL: `https://developer-docs.flowable.com/cmmn-api/cmmn-runtime/case-instances/{caseInstanceId}/variables/{variableName}`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/docs/cmmn-runtime/case-instances/:caseInstanceId/variables/:variableName/put.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint can be used in 2 ways: By passing a JSON Body (RestVariable) or by passing a multipart/form-data Object.
Note that scope is ignored, only global variables can be set in a case instance.
NB: Swagger V2 specification doesn't support this use case that is why this endpoint might be buggy/incomplete if used with other tools.

## Path parameters

- `caseInstanceId` string, required
- `variableName` string, required

## Request body

- CaseInstanceVariableResource

## Response `200`

successful operation

- RestVariable
  - `name` string: Name of the variable
  - `type` string: Type of the variable.
  - `value` object: Value of the variable.
  - `valueUrl` string
  - `scope` string

## Other responses

- `201`: Indicates both the case instance and variable were found and variable is updated.
- `404`: Indicates the requested case instance was not found or the case instance does not have a variable with the given name. Status description contains additional information about the error.

---

[API](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api.md) - [All operations](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/revisions/afdfa1fcacd0?raw)
