# 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. POST /global-variables/

Attributes Type Required Description
author integer no A unique identifier of an agent who created a global variable. A visible author.
integer_content integer no An integer value of a global variable.
name string yes A global variable name.
text_content string no A text value of a global variable. Can be used to store HTML code, string, or JSON.

# Request

  • CURL
  • JavaScript
  • PHP
  • Python
curl -X POST -H "Authorization: Token <your_64_char_api_key>" -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": 3589,
  "name": "Some global variable",
  "name_std": "some_global_variable",
  "integer_content": "",
  "text_content": "January Promotions",
  "author": 1
  "created_at":"2020-01-24T09:00:15.800900Z",
  "updated_at":"2020-01-24T09:00:15.801042Z",
}