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.

Attributes

Optional unless marked required

authorinteger
A unique identifier of an agent who created a global variable. A visible author.
integer_contentinteger
An integer value of a global variable.
namestringrequired
A global variable name.
text_contentstring
A text value of a global variable. Can be used to store HTML code, string, or JSON.
languagestring
ISO 639-1 code of the language.
parentinteger
An id of the parent global variable.
custom_idstring
The unique identifier for the global variable which is provided by the client.

Request​

curl -X POST "https://<your_app_subdomain>.user.com/api/public/global-variables/" \
-H "Authorization: Token <your_64_char_api_key>" \
-H "Accept: */*; version=2" \
-H "Content-Type: application/json" \
-d '{
"name": "Promo banner text",
"custom_id": "promo-banner",
"text_content": "Free shipping on orders over 50 EUR."
}'

Response examples​

{
"id": 6,
"custom_id": "promo-banner",
"name": "Promo banner text",
"name_std": "20261110_0936_promo_banner_text",
"author": null,
"parent": null,
"text_content": "Free shipping on orders over 50 EUR.",
"integer_content": null,
"float_content": null,
"language": null,
"created_at": "2026-11-10T08:36:54.885824Z",
"updated_at": "2026-11-10T08:36:54.885835Z"
}

Response fields​

Fields returned in the 201 Created response body.

idinteger
A unique identifier for the global variable which is given by User automatically.
custom_idstring
The unique identifier for the global variable which is provided by the client.
namestring
A global variable name.
name_stdstring
A standarize global variable name.
authorintegernullable
A unique identifier of an agent who created a global variable. A visible author.
parentintegernullable
An id of the parent global variable.
text_contentstring
A text value of a global variable. Can be used to store HTML code, string, or JSON.
integer_contentintegernullable
An integer value of a global variable.
float_contentstringnullable
Decimal value of the variable as a string with five decimal places; null unless the variable holds a decimal number.
languagestringnullable
ISO 639-1 code of the language.
created_atstring (date-time)
A creation date of a global variable.
updated_atstring (date-time)
A date of last global variable update.
note

Errors that can come from any endpoint (401, 429, 500, 502, 504) are described in HTTP response codes.