> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes.

# user_variables

> Return the user variables nested inside a SWML request body.

[ref-capabilities]: /docs/server-sdks/reference/python/core/capabilities

Return the user variables from a SWML request body. They are nested two levels down, at
`vars.userVariables`, which is easy to get wrong silently: a missing level yields an empty dict and
every downstream check quietly reports "not declared".

## Parameters

**`body_params`** `Any` — required

The SWML request body, as passed to a dynamic-config callback or SWAIG handler.

---

## Returns

`dict[str, Any]` -- The user variables, or `{}` when absent or malformed. Never raises.

## Example

```python {4}
from signalwire.core.capabilities import user_variables

def configure(query_params, body_params, headers, ephemeral_agent):
    variables = user_variables(body_params)
    nonce = variables.get("handoff_nonce")
```

Part of the [client capabilities][ref-capabilities] module.