Skip to main content
POST/global-variables/

Create global variable

You can create a global variable. It’s possible to use it as a snippet tag across many email templates, chat messages, etc.

AttributesTypeRequiredDescription
authorintegernoA unique identifier of an agent who created a global variable. A visible author.
integer_contentintegernoAn integer value of a global variable.
namestringyesA global variable name.
text_contentstringnoA text value of a global variable. Can be used to store HTML code, string, or JSON.
languagestringnoISO 639-1 code of the language.
parentintegernoAn id of the parent global variable.
custom_idstringnoThe unique identifier for the global variable which is provided by the client.

Request​

curl -X POST -H "Authorization: Token <your_64_char_api_key>"
-H "Accept: */*; version=2" -H "Content-Type: application/json" -d '{
"name": "Some global variable"
"text_content": "January Promotions"
"author": 1
}' "https://<your_app_subdomain>.user.com/api/public/global-variables/"

Response​

{
"id": 1,
"name": "Promotion Title",
"name_std": "promotion_title",
"language": null,
"integer_content": "",
"text_content": "January Promotions",
"author": 116,
"created_at":"2019-01-24T09:00:15.800900Z",
"updated_at":"2019-01-24T09:00:15.801042Z",
"author": 1,
"parent": null
},