--- title: "Custom Variable" slug: "server-api-livechat-custom-variable" updated: 2022-06-16T06:10:19Z published: 2022-06-16T06:10:19Z canonical: "developer.comm100.com/server-api-livechat-custom-variable" --- > ## Documentation Index > Fetch the complete documentation index at: https://developer.comm100.com/llms.txt > Use this file to discover all available pages before exploring further. # Custom Variable ## Custom Variable You need the Manage Custom Variables to manage Custom Variables. - `Custom Variables` - Custom Variables Manage - `GET livechat/customVariables` - [Get the list of Custom Variables](/docs/server-api-livechat-custom-variable#get-the-list-of-custom-variables) - `GET livechat/customVariables/{id}` - [Get a single Custom Variable](/docs/server-api-livechat-custom-variable#get-a-single-custom-variable) - `POST livechat/customVariables` - [Create a new Custom Variable](/docs/server-api-livechat-custom-variable#create-a-new-custom-variable) - `PUT livechat/customVariables/{id}` - [Update the Custom Variable](/docs/server-api-livechat-custom-variable#update-the-custom-variable) - `DELETE livechat/customVariables/{id}` - [Remove the Custom Variable](/docs/server-api-livechat-custom-variable#remove-the-custom-variable) ### Custom Variable JSON Format Custom Variable is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `id` | guid | Id of the custom variable. | | `name` | string | Name of the custom variable. | | `value` | string | Value of the custom variable. | | `hyperlink` | string | Hyperlink of the custom variable. | | `type` | string | Allowed values are "text", "integer", "decimal". | ### Get the list of Custom Variables `GET livechat/customVariables` - #### Parameters: No Parameters - #### Response: An array of [Custom Variable](/docs/server-api-livechat-custom-variable#custom-variable-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/customVariables \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` [ { "id": "6BB15329-7C46-EB11-8100-00155D081D0B", "name": "c_v_name", "value": "c_v_value", "hyperlink": "{!Visitor.IP}", "type": "text" } ] ``` ### Get a single Custom Variable `GET livechat/customVariables/{id}` - #### Parameters: No Parameters - #### Response: [Custom Variable](/docs/server-api-livechat-custom-variable#custom-variable-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/customVariables/6BB15329-7C46-EB11-8100-00155D081D0B \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` { "id": "6BB15329-7C46-EB11-8100-00155D081D0B", "name": "c_v_name", "value": "c_v_value", "hyperlink": "{!Visitor.IP}", "type": "text" } ``` ### Create a new Custom Variable `POST livechat/customVariables` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `name` | string | body | yes | Name of the custom variable. | | `value` | string | body | no | Value of the custom variable. | | `hyperlink` | string | body | no | Hyperlink of the custom variable. | | `type` | string | body | yes | Allowed values are "text", "integer", "decimal". | - #### Response: [Custom Variable](/docs/server-api-livechat-custom-variable#custom-variable-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/customVariables \ -X 'POST' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"name":"c_v_name","value":"c_v_value","hyperlink":"{!Visitor.IP}","type":"text"}' ``` Response: HTTP/1.1 201 Created ``` { "id": "6BB15329-7C46-EB11-8100-00155D081D0B", "name": "c_v_name", "value": "c_v_value", "hyperlink": "{!Visitor.IP}", "type": "text" } ``` ### Update the Custom Variable `PUT livechat/customVariables/{id}` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `name` | string | body | yes | Name of the custom variable. | | `value` | string | body | no | Value of the custom variable. | | `hyperlink` | string | body | no | Hyperlink of the custom variable. | | `type` | string | body | yes | Allowed values are "text", "integer", "decimal". | - #### Response: [Custom Variable](/docs/server-api-livechat-custom-variable#custom-variable-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/customVariables/6BB15329-7C46-EB11-8100-00155D081D0B \ -X 'PUT' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"name":"c_v_name","value":"c_v_value","hyperlink":"{!Visitor.IP}","type":"text"}' ``` Response: HTTP/1.1 200 OK ``` { "id": "6BB15329-7C46-EB11-8100-00155D081D0B", "name": "c_v_name", "value": "c_v_value", "hyperlink": "{!Visitor.IP}", "type": "text" } ``` ### Remove the Custom Variable `DELETE livechat/customVariables/{id}` - #### Parameters: No Parameters - #### Response: No Content - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/customVariables/6BB15329-7C46-EB11-8100-00155D081D0B \ -X 'DELETE' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 204 No Content