Custom Variables
Custom Variables are created by the Custom Variable effect and can be used to store arbitrary data.
GET/custom-variables
List all custom variables
Lists all custom variables in the system.
Request
GET
/custom-variablescurl http://localhost:7472/api/v1/custom-variables
Response
[
{
"name": "var1",
"data": "some data",
"ttl": 3600
},
{
"name": "var2",
"data": "more data",
"ttl": 0
}
]
GET/custom-variables/:variableName
Retrieve a custom variable
Fetches the value of a specific custom variable by its variableName
.
URL parameters
- Name
variableName
- Type
- string
- Description
The name of the custom variable to retrieve.
Request
GET
/custom-variables/:variableNamecurl http://localhost:7472/api/v1/custom-variables/var1
Response
{
"name": "var1",
"data": "some data",
"ttl": 3600
}
POST/custom-variables/:variableName
Set a custom variable
Sets a custom variable by its variableName
URL parameters
- Name
variableName
- Type
- string
- Description
The name of the custom variable to set.
Request Body (JSON)
- Name
data
- Type
- any
- Description
The new value for the variable.
- Name
ttl
- Type
- number
- Description
Optional time-to-live for the variable in seconds. Set to 0 for no expiration.
Request
POST
/custom-variables/:variableNamecurl -X POST http://localhost:7472/api/v1/custom-variables/var1 -d '{"data": "new value", "ttl": 3600}'
Response
{
"status": "success"
}