---
title: "These commands allow the creation of a new variable, or changing an existing value."
method: PUT
path: "/mimic/agent/{agentNum}/store/set/{var}/{persist}"
tags: ["Agent"]
---

# These commands allow the creation of a new variable, or changing an existing value.

`PUT /mimic/agent/{agentNum}/store/set/{var}/{persist}`

The append sub-command will append the value to an existing variable, or create a new one. The set sub-command will overwrite an existing variable, or create a new one. The optional persist flag can be used to indicate if the variable is to be persistent as described above. By default a value of '0' will be implied for the persist flag. To avoid mistakes, for existing variables the persist flag can only be set. If you want to reset it, you first need to unset the variable.

## Path parameters

- `agentNum` integer, required
- `var` string, required
- `persist` integer, required

## Request body

- string

## Response `200`

successful operation

- string

## Other responses

- `400` — Invalid agent number value

---

[API](https://skmtc.dev/gambitcomm/apis/mimic-rest-api.md) · [All operations](https://skmtc.dev/gambitcomm/apis/mimic-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gambitcomm/mimic-rest-api/revisions/eb67c54e9ec9/schema)
