--- title: "Conversion Action" slug: "server-api-livechat-conversion-action" updated: 2023-12-05T10:23:14Z published: 2023-12-05T10:23:14Z canonical: "developer.comm100.com/server-api-livechat-conversion-action" --- > ## 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. # Conversion Action ## Conversion Action You need the Manage Settings permission to Manage Conversion. - `Conversion Actions` - Conversion Actions Manage - `GET livechat/conversionActions` - [Get the list of Conversion Actions](/docs/server-api-livechat-conversion-action#get-the-list-of-conversion-actions) - `GET livechat/conversionActions/{id}` - [Get a single Conversion Action](/docs/server-api-livechat-conversion-action#get-a-single-conversion-action) - `POST livechat/conversionActions` - [Create a new Conversion Action](/docs/server-api-livechat-conversion-action#create-a-new-conversion-action) - `PUT livechat/conversionActions/{id}` - [Update the Conversion Action](/docs/server-api-livechat-conversion-action#update-the-conversion-action) - `DELETE livechat/conversionActions/{id}` - [Remove the Conversion Action](/docs/server-api-livechat-conversion-action#remove-the-conversion-action) - `Post livechat/conversionActions/achieved` - [Mark API Conversion Successful](/docs/server-api-livechat-conversion-action#mark-api-conversion-successful) ### Conversion Action JSON Format Conversion Action is represented as simple flat JSON objects with the following keys: | Name | Type | Description | | --- | --- | --- | | `id` | guid | Id of the conversion. | | `name` | string | Name of the conversion. | | `isEnabled` | bool | Whether conversion action is enabled or not. | | `type` | string | Allowed values are "URL", "customVariable", "API". | | `operator` | string | Allowed values are "is", "beginsWith", "contains", "regularExpression". | | `valueSource` | string | Allowed values are "inputAValue", "getFromCustomVariable". | | `chatAssociatedWithConversion` | string | Allowed values are "theFirstChat", "theLastChat". | | `value` | string | The value assigned for the conversion action. | | `isCaseSensitive` | bool | Whether conversion action is case sensitive or not, available when "type" is "url". | | `usedToDetermineConversionCustomVariableId` | guid | The ID of the custom variable,available when type is customVariable. | | `isValueAssignedToConversion` | bool | Whether a value is assigned for the conversion action or not. | | `assignedValueFromInputting` | float | The value assigned for the conversion action. | | `assignedValueFromCustomVariableId` | guid | Value comes from the custom variable. | | `isChatInLastCertainDaysConsidered` | bool | Whether check chat in last certain days considered. | | `chatInLastDays` | integer | Chat in last days. | | `isChatWithAtLeastCertainVisitorMessagesConsidered` | bool | Whether check chat with at least certain visitor messages considered. | | `isVariableIncludedInTranscript` | bool | Whether variable is included in transcript or not. | | `visitorMessagesAtLeast` | integer | The minimum count of messages that chats will be considered. | | `appendFieldList` | string [] | The field list to append to the chat transcript when this conversion actions takes place. | ### Get the list of Conversion Actions `GET livechat/conversionActions` - #### Parameters: No Parameters - #### Response: An array of [Conversion Action](/docs/server-api-livechat-conversion-action#conversion-action-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/conversionActions \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` { "conversionActions": [ { "id": "38ae462f-7f73-454b-a6f4-b39cebace826", "name": "1123", "isEnabled": true, "type": "API", "operator": "is", "value": "", "isCaseSensitive": true, "usedToDetermineConversionCustomVariableId": "00000000-0000-0000-0000-000000000000", "isValueAssignedToConversion": false, "valueSource": "inputAValue", "assignedValueFromInputting": 4.00, "assignedValueFromCustomVariableId": "00000000-0000-0000-0000-000000000000", "chatAssociatedWithConversion": "theFirstChat", "isChatInLastCertainDaysConsidered": false, "chatInLastDays": 1, "isChatWithAtLeastCertainVisitorMessagesConsidered": false, "visitorMessagesAtLeast": 1, "isVariableIncludedInTranscript": false, "appendFieldList": [], "isDeleted": false } ], "nextPage": null, "previousPage": null, "total": 1 } ``` ### Get a single Conversion Action `GET livechat/conversionActions/{id}` - #### Parameters: No Parameters - #### Response: [Conversion Action](/docs/server-api-livechat-conversion-action#conversion-action-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/conversionActions/CEB15329-7C46-EB11-8100-00155D081D0B \ -X 'GET' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 200 OK ``` { "id": "CEB15329-7C46-EB11-8100-00155D081D0B", "name": "Carl", "isEnabled": true, "type": "", "operator": "", "valueSource": "", "chatAssociatedWithConversion": "", "value": "url", "isCaseSensitive": true, "usedToDetermineConversionCustomVariableId": "15B05329-7C46-EB11-8100-00155D081D0B", "isValueAssignedToConversion": true, "assignedValueFromInputting": 332.0, "assignedValueFromCustomVariableId": "19B05329-7C46-EB11-8100-00155D081D0B", "isChatInLastCertainDaysConsidered": false, "chatInLastDays": 1, "isChatWithAtLeastCertainVisitorMessagesConsidered": false, "isVariableIncludedInTranscript": true, "visitorMessagesAtLeast": 1, "appendFieldList": [ "" ] } ``` ### Create a new Conversion Action `POST livechat/conversionActions` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `name` | string | body | yes | Name of the conversion. | | `isEnabled` | bool | body | no | Whether conversion action is enabled or not. | | `type` | string | body | no | Allowed values are "URL", "customVariable", "API". | | `operator` | string | body | yes | Allowed values are "is", "beginsWith", "contains", "regularExpression". | | `valueSource` | string | body | no | Allowed values are "inputAValue", "getFromCustomVariable". | | `chatAssociatedWithConversion` | string | body | yes | Allowed values are "theFirstChat", "theLastChat". | | `value` | string | body | yes | The value assigned for the conversion action. | | `isCaseSensitive` | bool | body | no | Whether conversion action is case sensitive or not, available when "type" is "url". | | `usedToDetermineConversionCustomVariableId` | guid | body | yes | The ID of the custom variable,available when type is customVariable. | | `isValueAssignedToConversion` | bool | body | no | Whether a value is assigned for the conversion action or not. | | `assignedValueFromInputting` | float | body | no | The value assigned for the conversion action. | | `assignedValueFromCustomVariableId` | guid | body | yes | Value comes from the custom variable. | | `isChatInLastCertainDaysConsidered` | bool | body | no | Whether check chat in last certain days considered. | | `chatInLastDays` | integer | body | no | Chat in last days. | | `isChatWithAtLeastCertainVisitorMessagesConsidered` | bool | body | no | Whether check chat with at least certain visitor messages considered. | | `isVariableIncludedInTranscript` | bool | body | no | Whether variable is included in transcript or not. | | `visitorMessagesAtLeast` | integer | body | no | The minimum count of messages that chats will be considered. | | `appendFieldList` | string [] | body | no | The field list to append to the chat transcript when this conversion actions takes place. | - #### Response: [Conversion Action](/docs/server-api-livechat-conversion-action#conversion-action-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/conversionActions \ -X 'POST' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"name": "1000","isEnabled": true,"type": "API","operator": "is","value": "","isCaseSensitive": true,"usedToDetermineConversionCustomVariableId": "00000000-0000-0000-0000-000000000000","isValueAssignedToConversion": false,"valueSource": "inputAValue","assignedValueFromInputting": 4.00,"assignedValueFromCustomVariableId": "00000000-0000-0000-0000-000000000000","chatAssociatedWithConversion": "theFirstChat","isChatInLastCertainDaysConsidered": false,"chatInLastDays": 1,"isChatWithAtLeastCertainVisitorMessagesConsidered": false,"visitorMessagesAtLeast": 1,"isVariableIncludedInTranscript": false,"appendFieldList": [],"isDeleted": false}' ``` Response: HTTP/1.1 201 Created ``` { "id": "6f4abec8-8e62-412d-9c8f-823f2221814b", "name": "1000", "isEnabled": true, "type": "API", "operator": "is", "value": "", "isCaseSensitive": true, "usedToDetermineConversionCustomVariableId": "00000000-0000-0000-0000-000000000000", "isValueAssignedToConversion": false, "valueSource": "inputAValue", "assignedValueFromInputting": 4.00, "assignedValueFromCustomVariableId": "00000000-0000-0000-0000-000000000000", "chatAssociatedWithConversion": "theFirstChat", "isChatInLastCertainDaysConsidered": false, "chatInLastDays": 1, "isChatWithAtLeastCertainVisitorMessagesConsidered": false, "visitorMessagesAtLeast": 1, "isVariableIncludedInTranscript": false, "appendFieldList": [], "isDeleted": false } ``` ### Update the Conversion Action `PUT livechat/conversionActions/{id}` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `name` | string | body | yes | Name of the conversion. | | `isEnabled` | bool | body | no | Whether conversion action is enabled or not. | | `type` | string | body | no | Allowed values are "URL", "customVariable", "API". | | `operator` | string | body | yes | Allowed values are "is", "beginsWith", "contains", "regularExpression". | | `valueSource` | string | body | no | Allowed values are "inputAValue", "getFromCustomVariable". | | `chatAssociatedWithConversion` | string | body | yes | Allowed values are "theFirstChat", "theLastChat". | | `value` | string | body | yes | The value assigned for the conversion action. | | `isCaseSensitive` | bool | body | no | Whether conversion action is case sensitive or not, available when "type" is "url". | | `usedToDetermineConversionCustomVariableId` | guid | body | yes | The ID of the custom variable,available when type is customVariable. | | `isValueAssignedToConversion` | bool | body | no | Whether a value is assigned for the conversion action or not. | | `assignedValueFromInputting` | float | body | no | The value assigned for the conversion action. | | `assignedValueFromCustomVariableId` | guid | body | yes | Value comes from the custom variable. | | `isChatInLastCertainDaysConsidered` | bool | body | no | Whether check chat in last certain days considered. | | `chatInLastDays` | integer | body | no | Chat in last days. | | `isChatWithAtLeastCertainVisitorMessagesConsidered` | bool | body | no | Whether check chat with at least certain visitor messages considered. | | `isVariableIncludedInTranscript` | bool | body | no | Whether variable is included in transcript or not. | | `visitorMessagesAtLeast` | integer | body | no | The minimum count of messages that chats will be considered. | | `appendFieldList` | string [] | body | no | The field list to append to the chat transcript when this conversion actions takes place. | - #### Response: [Conversion Action](/docs/server-api-livechat-conversion-action#conversion-action-json-format) - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/conversionActions/CEB15329-7C46-EB11-8100-00155D081D0B \ -X 'PUT' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"name": "testapi","isEnabled": false,"type": "URL","usedToDetermineConversionCustomVariableId": "a42fc7da-26e7-403f-8370-306fd005d478","operator": "is","value": "12","isCaseSensitive": true,"isValueAssignedToConversion": false,"valueSource": "inputAValue","chatAssociatedWithConversion": "theFirstChat","isChatInLastCertainDaysConsidered": false,"chatInLastDays": 1,"isChatWithAtLeastCertainVisitorMessagesConsidered": false,"visitorMessagesAtLeast": 1,"isVariableIncludedInTranscript": false,"appendFieldList": [],"id": "5d9918c4-6b23-4889-b16d-947778a5cf4f","assignedValueFromInputting": 1,"assignedValueFromCustomVariableId": "00000000-0000-0000-0000-000000000000","isDeleted": false}' ``` Response: HTTP/1.1 200 OK ``` { "id": "5d9918c4-6b23-4889-b16d-947778a5cf4f", "name": "testapi", "isEnabled": false, "type": "URL", "operator": "is", "value": "12", "isCaseSensitive": true, "usedToDetermineConversionCustomVariableId": "a42fc7da-26e7-403f-8370-306fd005d478", "isValueAssignedToConversion": false, "valueSource": "inputAValue", "assignedValueFromInputting": 1.00, "assignedValueFromCustomVariableId": "00000000-0000-0000-0000-000000000000", "chatAssociatedWithConversion": "theFirstChat", "isChatInLastCertainDaysConsidered": false, "chatInLastDays": 1, "isChatWithAtLeastCertainVisitorMessagesConsidered": false, "visitorMessagesAtLeast": 1, "isVariableIncludedInTranscript": false, "appendFieldList": [], "isDeleted": false } ``` ### Remove the Conversion Action `DELETE livechat/conversionActions/{id}` - #### Parameters: No Parameters - #### Response: No Content - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/conversionActions/CEB15329-7C46-EB11-8100-00155D081D0B \ -X 'DELETE' \ -H 'Authorization: Bearer {access_token}' \ ``` Response: HTTP/1.1 204 No Content ### Mark API Conversion Successful `POST livechat/conversionActions/achieved` - #### Parameters: | Name | Type | in | Required | Description | | --- | --- | --- | --- | --- | | `name` | string | body | yes | Name of the conversion. | | `visitorGuid` | guid | body | yes | Identifier of visitor, visitor must be online. | | `value` | double | body | no | The value assigned for the conversion action. | - #### Response: No Content - #### Example Sample Request: ``` curl https://api11.comm100.io/v4/livechat/conversionActions/achieved \ -X 'POST' \ -H 'Authorization: Bearer {access_token}' \ -H 'Content-Type: application/json' \ -D '{"name": "xxxxx","value": 0,"visitorGuid":"00000000-0000-0000-0000-000000000000": }' ``` Response: HTTP/1.1 200 OK