---
title: "Set or replace one of my regulated entity's variables"
method: PUT
path: "/api-regulated/v1/regulated-entities/self/variables"
tags: ["RegulatedEntity"]
---

# Set or replace one of my regulated entity's variables

`PUT /api-regulated/v1/regulated-entities/self/variables`

## Request

- Base URL: `https://api.currencyguard.com`
- URL: `https://api.currencyguard.com/api-regulated/v1/regulated-entities/self/variables`
- Auth: HTTP bearer

Upserts one variable by name. Replace rather than create-or-update because a caller setting a name that already exists is always the operation wanted; there is no separate create.

## Request body

- EntityVariableDTOUpsert: Set or replace one company variable.
  - `name` string, required: The variable name. Uppercase letters, digits and underscores only. Names ending in _PASSWORD, _SECRET, _TOKEN or _KEY are treated as secret and obscured on screen until revealed.
  - `value` string: The value to store.

## Response `200`

Variable stored; returns the full variable list

- EntityVariableDTO[]
  - `name` string: The variable name.
  - `value` string: The value. Returned for secret variables too — this endpoint is the one place a credential is served, and clients are expected to obscure it until the user reveals it.
  - `secret` boolean: Whether this variable is a credential and must be obscured on screen until revealed. True for any name ending in _PASSWORD, _SECRET, _TOKEN or _KEY.

## Other responses

- `400`: Invalid variable name or value — [`http/malformed-request`](/problems/http/malformed-request/)
- `401`: Not authenticated — [`security/authentication-failed`](/problems/security/authentication-failed/)
- `403`: Not authorized - requires REGULATED role — [`security/insufficient-permissions`](/problems/security/insufficient-permissions/)
- `500`: Server error — [`server/internal-error`](/problems/server/internal-error/)

---

[API](https://skmtc.dev/currencyguard/apis/currencyguard-trading-system-api-external.md) · [All operations](https://skmtc.dev/currencyguard/apis/currencyguard-trading-system-api-external/llms.txt) · [OpenAPI document](https://skmtc.dev/currencyguard/apis/currencyguard-trading-system-api-external/revisions/a1f3f854190d?raw)
