> ## Documentation Index
> Fetch the complete documentation index at: https://docs.invoca.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Invoca Tag Revisions

## Manage Invoca Tag Revisions

The Invoca Tag Revisions allow you to keep a history of changes made to your Tag configuration. Additionally, you are able to make draft revisions, allowing you to test changes before deploying them.

This API documentation helps provide necessary features to create and manage Invoca Tag Revisions.

| Property | Type | Value |
| - | - | - |
| external\_revision\_id | string (read-only) | The current recent revision id if live or nil if draft. |
| allow\_overflow | boolean (default false) | Reserve one phone number for “overflow” and apply to any additional visitors. |
| auto\_create\_local\_ringpools | boolean (default false) | Auto create a ring pool with local numbers |
| auto\_create\_toll\_free\_ringpools | boolean (default false) | Auto create a ring pool with toll free numbers |
| auto\_swap | boolean (default false) | Set to true if you want the Invoca JS to automatically detect and replace all numbers on page. This can be useful if you have a large list of phone numbers to manage, or don’t know all of the numbers listed across your site. If true, number\_selector and number\_to\_replace are not needed. |
| body | string | Response body of the JS Tag to be added to the site |
| cache\_lifetime\_days | integer (default 30) | This setting determines how long Invoca identifies a visitor to your landing page as a unique visitor. By default, your Tag’s attribution window is set to 30 days. |
| collect\_ip | boolean (default false) | If the IP address of the visiting user should be collected. |
| collect\_user\_agent | boolean (default false) | If data like browser type, operating system, device model, and software versions of the visiting user should be collected. |
| custom\_code | string | The custom code is a scoped function to insert any custom JavaScript to manipulate the options config that will be passed into the Invoca Integration. |
| custom\_data\_fields | array of objects | Marketing data fields |
| custom\_data\_fields\[].enabled | boolean | Status of the marketing data field. |
| custom\_data\_fields\[].partner\_name | string | Marketing data field name. |
| custom\_data\_fields\[].friendly\_name | string | Marketing data field friendly name. |
| custom\_data\_fields\[].attribution\_model | string | Marketing data field model type. |
| custom\_data\_fields\[].data\_source\_type | string | Data source for the marketing data field. |
| custom\_data\_fields\[].data\_source\_name | string | Friendly name for the marketing data field. |
| default\_campaign | object | Default campaign for the all numbers found except for ones in numbers\_to\_replace and numbers\_to\_not\_replace configurations. |
| default\_campaign.default\_campaign\_id | integer | Internal campaign id of the default campaign. TBD: SHOULD THIS BE UPDATED TO advertiser\_campaign\_id\_from\_network. |
| default\_campaign.default\_campaign\_name | string | Name of the default campaign |
| destination\_param | string | Destination key for dynamic routing. |
| message | string | Auto-generated or user defined note for the revision. |
| numbers\_to\_replace | array of objects | Specify which number(s) to replace and what campaign ID to use for each number. |
| numbers\_to\_replace\[].phone\_number | string | Phone number to be replaced. |
| numbers\_to\_replace\[].phone\_number\_e164 | string | E.164 version of the phone number to be replaced. |
| numbers\_to\_replace\[].advertiser\_campaign\_id | integer | Id of the advertiser campaign to be used for the above phone number. TBD: REMOVE THIS KEY |
| numbers\_to\_replace\[].advertiser\_campaign\_name | string | Name of the advertiser campaign for the above phone number. |
| numbers\_to\_replace\[].advertiser\_campaign\_id\_from\_network | string | Id of the advertiser campaign to be used for the above phone number. |
| numbers\_to\_replace\[].destinations\_enabled | boolean | If the linked advertiser campaign has destinations settings. |
| numbers\_to\_not\_replace | array of objects | Specify which number(s) to not replace. |
| numbers\_to\_not\_replace\[].phone\_number | string | Phone number to not be replaced. |
| numbers\_to\_not\_replace\[].phone\_number\_e164 | string | E.164 version of the phone number to not be replaced. |
| numbers\_to\_not\_replace\[].destinations\_enabled | boolean (read-only) | Always false. |
| organic\_sources | boolean | If you receive organic traffic to your landing page, enabling this will fill in your utm marketing parameters with a default value to record that organic attribution. |
| re\_run\_attribution\_after | integer | Number of seconds after which Invoca tag makes another attempt at capturing Marketing Data. This allows your Tag to swap in Invoca Promo Numbers immediately, but still capture parameters that may be slower to load. |
| required\_params | string | Comma-separated list of parameters required to trigger Invoca Tag. Invoca will look for these parameter names in your visitor’s browser session and will only run your tag if these parameters are present or if there is an exact match for a URL parameter in the format ‘parameter=value’. |
| reset\_cache\_on | string | This is a list of the Marketing Data parameters Invoca uses to determine attribution for your paid search ads. By default, Invoca uses “gclid”, “utm\_source”, and “utm\_medium” for this setting. If any of these parameters change in a visitor’s browser session, Invoca will reset all attribution for that site visitor. |
| wait\_for\_in\_seconds | string | Number of seconds by which to delay Invoca tag from running. This allows your Invoca Tag to run after your other vendors or user interactions, but may make the swap on your landing page to Invoca Promo Numbers visible to your visitors. |
| is\_draft\_revision | boolean (read-only) | Identifier to get to find if the revision is draft |
| is\_live\_revision | boolean (read-only) | Identifier to get to find if the revision is live |

Endpoint:

`https://invoca.net/api/2022-08-01/networks/<network_id>/js_tags/<js_tag_id>/revisions.json`

Note: when working with a Draft Revision, the `<external_revision_id>` should be set to `draft` in the URL.

> [accordion] Get all Tag Revisions
>
> #### Examples
>
> Read all Invoca Tag Revisions
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/networks/<network_id>/js_tags/<js_tag_id>/revisions.json`
>
> Response Code: 200
>
> Response Body:
>
> ```json theme={null}
> {
>   "data": [
>     {
>       "allow_overflow": false,
>       "auto_create_local_ringpools": false,
>       "auto_create_toll_free_ringpools": false,
>       "auto_swap": false,
>       "body": "(function(networkId) {\nvar automaticIntegrations = {};\n\nvar cacheLifetimeDays = 30;\n\nvar customDataWaitForConfig = [];\n\nvar customDataWaitForConfigAnonymousFunctions = [];\n\nvar defaultCampaignId = null;\n\nvar destinationSettings = {\n  paramName: null\n};\n\nvar numbersToReplace = null;\n\nvar organicSources = true;\n\nvar reRunAfter = null;\n\nvar requiredParams = null;\n\nvar resetCacheOn = ['gclid', 'utm_source', 'utm_medium'];\n\nvar waitFor = 0;\n\nvar customCodeIsSet = (function() {\n  Invoca.Client.customCode = function(options) {\n    console.log('Invoca Tag paused at 11/06/23   8:26 AM');\n  };\n\n  return true;\n})();\n\nvar generatedOptions = {\n  active:              true,\n  autoSwap:            false,\n  cookieDays:          cacheLifetimeDays,\n  country:             null,\n  dataSilo:            \"us\",\n  defaultCampaignId:   defaultCampaignId,\n  destinationSettings: destinationSettings,\n  disableUrlParams:    [],\n  doNotSwap:           [],\n  maxWaitFor:          waitFor,\n  networkId:           networkId || null,\n  numberToReplace:     numbersToReplace,\n  organicSources:      organicSources,\n  poolParams:          {},\n  reRunAfter:          reRunAfter,\n  requiredParams:      requiredParams,\n  resetCacheOn:        resetCacheOn,\n  waitForData:         customDataWaitForConfig,\n  waitForDataAnonymousFunctions:  customDataWaitForConfigAnonymousFunctions\n};\n\nInvoca.Client.startFromWizard(generatedOptions);\n\n})(26);\n",
>       "cache_lifetime_days": 30,
>       "cache_lifetime_warning": null,
>       "collect_ip": false,
>       "collect_user_agent": false,
>       "created_at": "2023-11-06T04:10:51-08:00",
>       "custom_code": "console.log('Invoca Tag paused at 11/06/23   8:26 AM');",
>       "custom_data_fields": [],
>       "default_campaign": {},
>       "destination_param": null,
>       "external_revision_id": 0,
>       "is_draft_revision": false,
>       "is_live_revision": true,
>       "js_tag_id": "0054811245",
>       "message": "Auto-generated initial revision",
>       "numbers_to_not_replace": [],
>       "numbers_to_replace": [],
>       "organic_sources": true,
>       "re_run_attribution_after": null,
>       "required_params": "",
>       "reset_cache_on": [
>         "gclid",
>         "utm_source",
>         "utm_medium"
>       ],
>       "updated_at": "2023-11-06T08:55:11-08:00",
>       "wait_for_in_seconds": 0,
>       "warning": null
>     },
>     {
>       "allow_overflow": false,
>       "auto_create_local_ringpools": false,
>       "auto_create_toll_free_ringpools": false,
>       "auto_swap": true,
>       "body": "(function(networkId) {\nvar cacheLifetimeDays = 7;\n\nvar customDataWaitForConfig = [\n  { on: function() { return Invoca.Client.parseCustomDataField(\"landing_page\", \"Unique\", \"URLParam\", \"\"); }, paramName: \"landing_page\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"line_of_business\", \"Unique\", \"URLParam\", \"\"); }, paramName: \"line_of_business\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"offer\", \"Unique\", \"URLParam\", \"\"); }, paramName: \"offer\", fallbackValue: null }\n];\n\nvar customDataWaitForConfigAnonymousFunctions = [];\n\nvar defaultCampaignId = \"84\";\n\nvar destinationSettings = {\n  paramName: null\n};\n\nvar numbersToReplace = {\n  \"44454545557\": \"83\"\n};\n\nvar organicSources = true;\n\nvar reRunAfter = 5000;\n\nvar requiredParams = {\"gclid\":\"*\",\"utm_medium\":\"*\",\"utm_source\"=\"organic\"};\n\nvar resetCacheOn = ['gclid', 'utm_source', 'utm_medium'];\n\nvar waitFor = 0;\n\nvar customCodeIsSet = (function() {\n  Invoca.Client.customCode = function(options) {\n    return options;\n  };\n\n  return true;\n})();\n\nvar generatedOptions = {\n  active:              true,\n  autoSwap:            true,\n  cookieDays:          cacheLifetimeDays,\n  country:             \"US\",\n  dataSilo:            \"us\",\n  defaultCampaignId:   defaultCampaignId,\n  destinationSettings: destinationSettings,\n  disableUrlParams:    [],\n  doNotSwap:           [\"888-676-5565\"],\n  maxWaitFor:          waitFor,\n  networkId:           networkId || null,\n  numberToReplace:     numbersToReplace,\n  organicSources:      organicSources,\n  poolParams:          {},\n  reRunAfter:          reRunAfter,\n  requiredParams:      requiredParams,\n  resetCacheOn:        resetCacheOn,\n  waitForData:         customDataWaitForConfig,\n  waitForDataAnonymousFunctions:  customDataWaitForConfigAnonymousFunctions\n};\n\nInvoca.Client.startFromWizard(generatedOptions);\n\n})(26);\n",
>       "cache_lifetime_days": 7,
>       "cache_lifetime_warning": null,
>       "collect_ip": false,
>       "collect_user_agent": false,
>       "created_at": "2023-11-06T04:10:51-08:00",
>       "custom_code": "",
>       "custom_data_fields": [
>         {
>           "enabled": true,
>           "partner_name": "landing_page",
>           "friendly_name": "Landing Page",
>           "attribution_model": "Unique",
>           "data_source_type": "URLParam",
>           "data_source_name": ""
>         },
>         {
>           "enabled": true,
>           "partner_name": "line_of_business",
>           "friendly_name": "Line of Business",
>           "attribution_model": "Unique",
>           "data_source_type": "URLParam",
>           "data_source_name": ""
>         },
>         {
>           "enabled": true,
>           "partner_name": "offer",
>           "friendly_name": "Offer",
>           "attribution_model": "Unique",
>           "data_source_type": "URLParam",
>           "data_source_name": ""
>         }
>       ],
>       "default_campaign": {
>         "default_campaign_id": 84,
>         "default_campaign_name": "Campaign for NY"
>       },
>       "destination_param": null,
>       "external_revision_id": null,
>       "is_draft_revision": true,
>       "is_live_revision": false,
>       "js_tag_id": "0054811245",
>       "message": "updated note",
>       "numbers_to_not_replace": [
>         {
>           "phone_number": "888-676-5565",
>           "phone_number_e164": "+18886765565",
>           "destinations_enabled": false
>         }
>       ],
>       "numbers_to_replace": [
>         {
>           "phone_number": "44454545557",
>           "phone_number_e164": "44454545557",
>           "advertiser_campaign_id": 83,
>           "advertiser_campaign_name": "Campaign for Manhattan",
>           "advertiser_campaign_id_from_network": "83",
>           "destinations_enabled": false
>         }
>       ],
>       "organic_sources": true,
>       "re_run_attribution_after": 5,
>       "required_params": "gclid,utm_medium,utm_source=organic",
>       "reset_cache_on": [
>         "gclid",
>         "utm_source",
>         "utm_medium"
>       ],
>       "updated_at": "2023-11-07T02:41:33-08:00",
>       "wait_for_in_seconds": 0,
>       "warning": null
>     }
>   ],
>   "requestId": null,
>   "recordsTotal": 2
>   "start": 0
> }
> ```

> [accordion] Get a Tag Revision
>
> #### Examples
>
> Read an Invoca Tag Revision
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/networks/<network_id>/js_tags/<js_tag_id>/revisions/<external_revision_id>.json`
>
> Response Code: 200
>
> Response Body:
>
> ```json theme={null}
> {
>   "allow_overflow": true,
>   "auto_create_local_ringpools": false,
>   "auto_create_toll_free_ringpools": false,
>   "auto_swap": false,
>   "body": "(function(networkId) {\nvar automaticIntegrations = {};\n\nvar cacheLifetimeDays = 30;\n\nvar customDataWaitForConfig = [];\n\nvar customDataWaitForConfigAnonymousFunctions = [];\n\nvar defaultCampaignId = null;\n\nvar destinationSettings = {\n  paramName: null\n};\n\nvar numbersToReplace = null;\n\nvar organicSources = true;\n\nvar reRunAfter = null;\n\nvar requiredParams = {\"gclid\":\"*\",\"utm_source\":\"linkedin_company\",\"utm_medium\":\"email\"};\n\nvar resetCacheOn = ['gclid', 'utm_source', 'utm_medium'];\n\nvar waitFor = 0;\n\nvar customCodeIsSet = (function() {\n  Invoca.Client.customCode = function(options) {\n    console.log('Invoca Tag paused at 11/06/23   8:26 AM');\n  };\n\n  return true;\n})();\n\nvar generatedOptions = {\n  active:              true,\n  autoSwap:            false,\n  cookieDays:          cacheLifetimeDays,\n  country:             null,\n  dataSilo:            \"us\",\n  defaultCampaignId:   defaultCampaignId,\n  destinationSettings: destinationSettings,\n  disableUrlParams:    [],\n  doNotSwap:           [],\n  maxWaitFor:          waitFor,\n  networkId:           networkId || null,\n  numberToReplace:     numbersToReplace,\n  organicSources:      organicSources,\n  poolParams:          {},\n  reRunAfter:          reRunAfter,\n  requiredParams:      requiredParams,\n  resetCacheOn:        resetCacheOn,\n  waitForData:         customDataWaitForConfig,\n  waitForDataAnonymousFunctions:  customDataWaitForConfigAnonymousFunctions\n};\n\nInvoca.Client.startFromWizard(generatedOptions);\n\n})(26);\n",
>   "cache_lifetime_days": 30,
>   "cache_lifetime_warning": null,
>   "collect_ip": false,
>   "collect_user_agent": false,
>   "created_at": "2023-11-06T04:10:51-08:00",
>   "custom_code": "console.log('Invoca Tag paused at 11/06/23   8:26 AM');",
>   "custom_data_fields": [],
>   "default_campaign": {},
>   "destination_param": null,
>   "external_revision_id": 0,
>   "is_draft_revision": false,
>   "is_live_revision": true,
>   "js_tag_id": "0054811245",
>   "message": "Auto-generated initial revision",
>   "numbers_to_replace": [],
>   "numbers_to_not_replace": [],
>   "organic_sources": true,
>   "re_run_attribution_after": null,
>   "required_params": "gclid,utm_source=linkedin_company,utm_medium=email",
>   "reset_cache_on": [
>     "gclid",
>     "utm_source",
>     "utm_medium"
>   ],
>   "updated_at": "2023-11-06T08:55:11-08:00",
>   "wait_for_in_seconds": 0,
>   "warning": null
> }
> ```

> [accordion] Create a new Tag Revision
>
> #### Examples
>
> Create a new Draft Tag Revision
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/networks/<network_id>/js_tags/<js_tag_id>/revisions.json`
>
> Format: application/json
>
> Request Body:
>
> ```json theme={null}
> {
>   "allow_overflow": false,
>   "auto_create_local_ringpools": false,
>   "auto_create_toll_free_ringpools": false,
>   "auto_swap": true,
>   "body": "(function(networkId) {\nvar cacheLifetimeDays = 30;\n\nvar customDataWaitForConfig = [\n  { on: function() { return Invoca.Client.parseCustomDataField(\"calling_page\", \"Last\", \"JavascriptDataLayer\", \"location.hostname + location.pathname\"); }, paramName: \"calling_page\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"gclid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"gclid\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"g_cid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"g_cid\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"landing_page\", \"First\", \"JavascriptDataLayer\", \"location.href\"); }, paramName: \"landing_page\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"msclkid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"msclkid\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_campaign\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_campaign\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_content\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_content\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_medium\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_medium\", fallbackValue: function() { return Invoca.PNAPI.currentPageSettings.poolParams.utm_medium || null; } },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_source\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_source\", fallbackValue: function() { return Invoca.PNAPI.currentPageSettings.poolParams.utm_source || null; } },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"wbraid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"wbraid\", fallbackValue: null }\n];\n\nvar defaultCampaignId = \"87\";\n\nvar destinationSettings = {\n  paramName: \"invoca_detected_destination\"\n};\n\nvar numbersToReplace = null;\n\nvar organicSources = true;\n\nvar reRunAfter = null;\n\nvar requiredParams = null;\n\nvar resetCacheOn = ['gclid', 'utm_source', 'utm_medium'];\n\nvar waitFor = 0;\n\nvar customCodeIsSet = (function() {\n  Invoca.Client.customCode = function(options) {\n    return options;\n  };\n\n  return true;\n})();\n\nvar generatedOptions = {\n  active:              true,\n  autoSwap:            true,\n  cookieDays:          cacheLifetimeDays,\n  country:             \"US\",\n  dataSilo:            \"us\",\n  defaultCampaignId:   defaultCampaignId,\n  destinationSettings: destinationSettings,\n  disableUrlParams:    [],\n  doNotSwap:           [],\n  maxWaitFor:          waitFor,\n  networkId:           networkId || null,\n  numberToReplace:     numbersToReplace,\n  organicSources:      organicSources,\n  poolParams:          {},\n  reRunAfter:          reRunAfter,\n  requiredParams:      requiredParams,\n  resetCacheOn:        resetCacheOn,\n  waitForData:         customDataWaitForConfig\n};\n\nInvoca.Client.startFromWizard(generatedOptions);\n\n})(29);\n",
>   "cache_lifetime_days": 30,
>   "cache_lifetime_warning": null,
>   "collect_ip": true,
>   "collect_user_agent": false,
>   "created_at": "2023-11-15T08:01:36-08:00",
>   "custom_code": "",
>   "custom_data_fields": [
>     {
>       "enabled": false,
>       "partner_name": "calling_page",
>       "friendly_name": "Calling Page",
>       "attribution_model": "Last",
>       "data_source_type": "JavascriptDataLayer",
>       "data_source_name": "location.hostname + location.pathname"
>     },
>     {
>       "enabled": false,
>       "partner_name": "gclid",
>       "friendly_name": "Google Click ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": false,
>       "partner_name": "g_cid",
>       "friendly_name": "Google Analytics Client ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "landing_page",
>       "friendly_name": "Full Landing Page URL",
>       "attribution_model": "First",
>       "data_source_type": "JavascriptDataLayer",
>       "data_source_name": "location.href"
>     },
>     {
>       "enabled": true,
>       "partner_name": "msclkid",
>       "friendly_name": "Microsoft Ads Click ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_campaign",
>       "friendly_name": "Marketing Campaign",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_content",
>       "friendly_name": "Marketing Content",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_medium",
>       "friendly_name": "Marketing Medium",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_source",
>       "friendly_name": "Marketing Source",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "wbraid",
>       "friendly_name": "Google WBRAID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     }
>   ],
>   "default_campaign": {
>     "default_campaign_id": "87",
>     "default_campaign_name": "Default: Default Call Treatment"
>   },
>   "js_tag_id": "2510358551",
>   "message": "default message",
>   "numbers_to_not_replace": [],
>   "numbers_to_replace": [],
>   "organic_sources": true,
>   "re_run_attribution_after": null,
>   "required_params": "gclid,fbclid,utm_medium=programmatic-audio",
>   "reset_cache_on": [
>     "gclid",
>     "utm_source",
>     "utm_medium"
>   ],
>   "updated_at": "2023-11-15T08:01:36-08:00",
>   "wait_for_in_seconds": 0.0,
>   "warning": null
> }
> ```
>
> Response Code: 201
>
> Response Body:
>
> ```json theme={null}
> {
>   "allow_overflow": false,
>   "auto_create_local_ringpools": false,
>   "auto_create_toll_free_ringpools": false,
>   "auto_swap": true,
>   "body": "(function(networkId) {\nvar cacheLifetimeDays = 30;\n\nvar customDataWaitForConfig = [\n  { on: function() { return Invoca.Client.parseCustomDataField(\"landing_page\", \"First\", \"JavascriptDataLayer\", \"location.href\"); }, paramName: \"landing_page\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"msclkid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"msclkid\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_campaign\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_campaign\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_content\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_content\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_medium\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_medium\", fallbackValue: function() { return Invoca.PNAPI.currentPageSettings.poolParams.utm_medium || null; } },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_source\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_source\", fallbackValue: function() { return Invoca.PNAPI.currentPageSettings.poolParams.utm_source || null; } },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"wbraid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"wbraid\", fallbackValue: null }\n];\n\nvar defaultCampaignId = null;\n\nvar destinationSettings = {\n  paramName: \"invoca_detected_destination\"\n};\n\nvar numbersToReplace = null;\n\nvar organicSources = true;\n\nvar reRunAfter = null;\n\nvar requiredParams = null;\n\nvar resetCacheOn = ['gclid', 'utm_source', 'utm_medium'];\n\nvar waitFor = 0;\n\nvar customCodeIsSet = (function() {\n  Invoca.Client.customCode = function(options) {\n    return options;\n  };\n\n  return true;\n})();\n\nvar generatedOptions = {\n  active:              true,\n  autoSwap:            true,\n  cookieDays:          cacheLifetimeDays,\n  country:             null,\n  dataSilo:            \"us\",\n  defaultCampaignId:   defaultCampaignId,\n  destinationSettings: destinationSettings,\n  disableUrlParams:    ['calling_page','gclid','g_cid'],\n  doNotSwap:           [],\n  maxWaitFor:          waitFor,\n  networkId:           networkId || null,\n  numberToReplace:     numbersToReplace,\n  organicSources:      organicSources,\n  poolParams:          {},\n  reRunAfter:          reRunAfter,\n  requiredParams:      requiredParams,\n  resetCacheOn:        resetCacheOn,\n  waitForData:         customDataWaitForConfig\n};\n\nInvoca.Client.startFromWizard(generatedOptions);\n\n})(29);\n",
>   "cache_lifetime_days": 30,
>   "cache_lifetime_warning": null,
>   "collect_ip": true,
>   "collect_user_agent": false,
>   "created_at": "2023-11-15T12:07:28-08:00",
>   "custom_code": "",
>   "custom_data_fields": [
>     {
>       "enabled": false,
>       "partner_name": "calling_page",
>       "friendly_name": "Calling Page",
>       "attribution_model": "Last",
>       "data_source_type": "JavascriptDataLayer",
>       "data_source_name": "location.hostname + location.pathname"
>     },
>     {
>       "enabled": false,
>       "partner_name": "gclid",
>       "friendly_name": "Google Click ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": false,
>       "partner_name": "g_cid",
>       "friendly_name": "Google Analytics Client ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "landing_page",
>       "friendly_name": "Full Landing Page URL",
>       "attribution_model": "First",
>       "data_source_type": "JavascriptDataLayer",
>       "data_source_name": "location.href"
>     },
>     {
>       "enabled": true,
>       "partner_name": "msclkid",
>       "friendly_name": "Microsoft Ads Click ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_campaign",
>       "friendly_name": "Marketing Campaign",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_content",
>       "friendly_name": "Marketing Content",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_medium",
>       "friendly_name": "Marketing Medium",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_source",
>       "friendly_name": "Marketing Source",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "wbraid",
>       "friendly_name": "Google WBRAID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     }
>   ],
>   "default_campaign": {},
>   "destination_param": "invoca_detected_destination",
>   "external_revision_id": null,
>   "is_draft_revision": true,
>   "is_live_revision": false,
>   "js_tag_id": "2510358551",
>   "message": "",
>   "numbers_to_not_replace": [],
>   "numbers_to_replace": [],
>   "organic_sources": true,
>   "re_run_attribution_after": null,
>   "required_params": "gclid,fbclid,utm_medium=programmatic-audio",
>   "reset_cache_on": [
>       "gclid",
>       "utm_source",
>       "utm_medium"
>   ],
>   "updated_at": "2023-11-15T12:07:28-08:00",
>   "wait_for_in_seconds": 0.0,
>   "warning": null
> }
> ```

> [accordion] Update an existing Tag Revision
>
> #### Examples
>
> Update an existing Draft Tag Revision
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/networks/<network_id>/js_tags/<js_tag_id>/revisions/draft.json`
>
> Format: application/json
>
> Request Body:
>
> ```json theme={null}
> {
>   "allow_overflow": false,
>   "auto_create_local_ringpools": false,
>   "auto_create_toll_free_ringpools": false,
>   "auto_swap": false,
>   "body": "(function(networkId) {\nvar cacheLifetimeDays = 30;\n\nvar customDataWaitForConfig = [\n  { on: function() { return Invoca.Client.parseCustomDataField(\"calling_page\", \"Last\", \"JavascriptDataLayer\", \"location.hostname + location.pathname\"); }, paramName: \"calling_page\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"gclid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"gclid\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"g_cid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"g_cid\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"landing_page\", \"First\", \"JavascriptDataLayer\", \"location.href\"); }, paramName: \"landing_page\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"msclkid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"msclkid\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_campaign\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_campaign\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_content\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_content\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_medium\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_medium\", fallbackValue: function() { return Invoca.PNAPI.currentPageSettings.poolParams.utm_medium || null; } },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_source\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_source\", fallbackValue: function() { return Invoca.PNAPI.currentPageSettings.poolParams.utm_source || null; } },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"wbraid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"wbraid\", fallbackValue: null }\n];\n\nvar defaultCampaignId = \"87\";\n\nvar destinationSettings = {\n  paramName: \"invoca_detected_destination\"\n};\n\nvar numbersToReplace = null;\n\nvar organicSources = true;\n\nvar reRunAfter = null;\n\nvar requiredParams = null;\n\nvar resetCacheOn = ['gclid', 'utm_source', 'utm_medium'];\n\nvar waitFor = 0;\n\nvar customCodeIsSet = (function() {\n  Invoca.Client.customCode = function(options) {\n    return options;\n  };\n\n  return true;\n})();\n\nvar generatedOptions = {\n  active:              true,\n  autoSwap:            true,\n  cookieDays:          cacheLifetimeDays,\n  country:             \"US\",\n  dataSilo:            \"us\",\n  defaultCampaignId:   defaultCampaignId,\n  destinationSettings: destinationSettings,\n  disableUrlParams:    [],\n  doNotSwap:           [],\n  maxWaitFor:          waitFor,\n  networkId:           networkId || null,\n  numberToReplace:     numbersToReplace,\n  organicSources:      organicSources,\n  poolParams:          {},\n  reRunAfter:          reRunAfter,\n  requiredParams:      requiredParams,\n  resetCacheOn:        resetCacheOn,\n  waitForData:         customDataWaitForConfig\n};\n\nInvoca.Client.startFromWizard(generatedOptions);\n\n})(29);\n",
>   "cache_lifetime_days": 30,
>   "cache_lifetime_warning": null,
>   "collect_ip": false,
>   "collect_user_agent": true,
>   "created_at": "2023-11-15T08:01:36-08:00",
>   "custom_code": "",
>   "custom_data_fields": [
>     {
>       "enabled": false,
>       "partner_name": "calling_page",
>       "friendly_name": "Calling Page",
>       "attribution_model": "Last",
>       "data_source_type": "JavascriptDataLayer",
>       "data_source_name": "location.hostname + location.pathname"
>     },
>     {
>       "enabled": false,
>       "partner_name": "gclid",
>       "friendly_name": "Google Click ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": false,
>       "partner_name": "g_cid",
>       "friendly_name": "Google Analytics Client ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "landing_page",
>       "friendly_name": "Full Landing Page URL",
>       "attribution_model": "First",
>       "data_source_type": "JavascriptDataLayer",
>       "data_source_name": "location.href"
>     },
>     {
>       "enabled": true,
>       "partner_name": "msclkid",
>       "friendly_name": "Microsoft Ads Click ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_campaign",
>       "friendly_name": "Marketing Campaign",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_content",
>       "friendly_name": "Marketing Content",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_medium",
>       "friendly_name": "Marketing Medium",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_source",
>       "friendly_name": "Marketing Source",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "wbraid",
>       "friendly_name": "Google WBRAID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     }
>   ],
>   "default_campaign": {
>     "default_campaign_id": "87",
>     "default_campaign_name": "Default: Default Call Treatment"
>   },
>   "js_tag_id": "2510358551",
>   "message": "Set auto-swap to false",
>   "numbers_to_not_replace": [],
>   "numbers_to_replace": [],
>   "organic_sources": true,
>   "re_run_attribution_after": null,
>   "required_params": "gclid,st-t,utm_source=Bing",
>   "reset_cache_on": [
>     "gclid",
>     "utm_source",
>     "utm_medium"
>   ],
>   "updated_at": "2023-11-15T08:01:36-08:00",
>   "wait_for_in_seconds": 0.0,
>   "warning": null
> }
> ```
>
> Response Code: 200
>
> Response Body:
>
> ```json theme={null}
> {
>   "allow_overflow": false,
>   "auto_create_local_ringpools": false,
>   "auto_create_toll_free_ringpools": false,
>   "auto_swap": false,
>   "body": "(function(networkId) {\nvar cacheLifetimeDays = 30;\n\nvar customDataWaitForConfig = [\n  { on: function() { return Invoca.Client.parseCustomDataField(\"landing_page\", \"First\", \"JavascriptDataLayer\", \"location.href\"); }, paramName: \"landing_page\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"msclkid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"msclkid\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_campaign\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_campaign\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_content\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_content\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_medium\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_medium\", fallbackValue: function() { return Invoca.PNAPI.currentPageSettings.poolParams.utm_medium || null; } },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_source\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_source\", fallbackValue: function() { return Invoca.PNAPI.currentPageSettings.poolParams.utm_source || null; } },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"wbraid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"wbraid\", fallbackValue: null }\n];\n\nvar defaultCampaignId = null;\n\nvar destinationSettings = {\n  paramName: \"invoca_detected_destination\"\n};\n\nvar numbersToReplace = null;\n\nvar organicSources = true;\n\nvar reRunAfter = null;\n\nvar requiredParams = null;\n\nvar resetCacheOn = ['gclid', 'utm_source', 'utm_medium'];\n\nvar waitFor = 0;\n\nvar customCodeIsSet = (function() {\n  Invoca.Client.customCode = function(options) {\n    return options;\n  };\n\n  return true;\n})();\n\nvar generatedOptions = {\n  active:              true,\n  autoSwap:            true,\n  cookieDays:          cacheLifetimeDays,\n  country:             null,\n  dataSilo:            \"us\",\n  defaultCampaignId:   defaultCampaignId,\n  destinationSettings: destinationSettings,\n  disableUrlParams:    ['calling_page','gclid','g_cid'],\n  doNotSwap:           [],\n  maxWaitFor:          waitFor,\n  networkId:           networkId || null,\n  numberToReplace:     numbersToReplace,\n  organicSources:      organicSources,\n  poolParams:          {},\n  reRunAfter:          reRunAfter,\n  requiredParams:      requiredParams,\n  resetCacheOn:        resetCacheOn,\n  waitForData:         customDataWaitForConfig\n};\n\nInvoca.Client.startFromWizard(generatedOptions);\n\n})(29);\n",
>   "cache_lifetime_days": 30,
>   "cache_lifetime_warning": null,
>   "collect_ip": false,
>   "collect_user_agent": true,
>   "created_at": "2023-11-15T12:07:28-08:00",
>   "custom_code": "return options;",
>   "custom_data_fields": [
>     {
>       "enabled": false,
>       "partner_name": "calling_page",
>       "friendly_name": "Calling Page",
>       "attribution_model": "Last",
>       "data_source_type": "JavascriptDataLayer",
>       "data_source_name": "location.hostname + location.pathname"
>     },
>     {
>       "enabled": false,
>       "partner_name": "gclid",
>       "friendly_name": "Google Click ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": false,
>       "partner_name": "g_cid",
>       "friendly_name": "Google Analytics Client ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "landing_page",
>       "friendly_name": "Full Landing Page URL",
>       "attribution_model": "First",
>       "data_source_type": "JavascriptDataLayer",
>       "data_source_name": "location.href"
>     },
>     {
>       "enabled": true,
>       "partner_name": "msclkid",
>       "friendly_name": "Microsoft Ads Click ID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_campaign",
>       "friendly_name": "Marketing Campaign",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_content",
>       "friendly_name": "Marketing Content",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_medium",
>       "friendly_name": "Marketing Medium",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "utm_source",
>       "friendly_name": "Marketing Source",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     },
>     {
>       "enabled": true,
>       "partner_name": "wbraid",
>       "friendly_name": "Google WBRAID",
>       "attribution_model": "Last",
>       "data_source_type": "URLParam",
>       "data_source_name": ""
>     }
>   ],
>   "default_campaign": {},
>   "destination_param": "invoca_detected_destination",
>   "external_revision_id": null,
>   "is_draft_revision": true,
>   "is_live_revision": false,
>   "js_tag_id": "2510358551",
>   "message": "Set auto-swap to false",
>   "numbers_to_not_replace": [],
>   "numbers_to_replace": [],
>   "organic_sources": true,
>   "re_run_attribution_after": null,
>   "required_params": "gclid,st-t,utm_source=Bing",
>   "reset_cache_on": [
>       "gclid",
>       "utm_source",
>       "utm_medium"
>   ],
>   "updated_at": "2023-11-15T12:07:28-08:00",
>   "wait_for_in_seconds": 0.0,
>   "warning": null
> }
> ```

> [accordion] Delete an existing Tag Revision
>
> #### Examples
>
> Delete a Draft Tag Revision
>
> Endpoint:
>
> `https://invoca.net/api/2022-08-01/networks/<network_id>/js_tags/<js_tag_id>/revisions/draft.json`
>
> Format: application/json
>
> Response Code: 200
>
> Response Body:
>
> ```json theme={null}
> {}
> ```

## Error Handling

Forbidden – 403:

### POST

`https://invoca.net/api/2022-08-01/networks/<network_id>/js_tags/<js_tag_id>/revisions.json`

Content Type: application/json

Response Code: 403

**Request Body**

```json theme={null}
{
  "cache_lifetime_days": 3000,
  "body": "(function(networkId) {\nvar cacheLifetimeDays = 30;\n\nvar customDataWaitForConfig = [\n  { on: function() { return Invoca.Client.parseCustomDataField(\"calling_page\", \"Last\", \"JavascriptDataLayer\", \"location.hostname + location.pathname\"); }, paramName: \"calling_page\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"gclid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"gclid\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"g_cid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"g_cid\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"landing_page\", \"First\", \"JavascriptDataLayer\", \"location.href\"); }, paramName: \"landing_page\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"msclkid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"msclkid\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_campaign\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_campaign\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_content\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_content\", fallbackValue: null },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_medium\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_medium\", fallbackValue: function() { return Invoca.PNAPI.currentPageSettings.poolParams.utm_medium || null; } },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"utm_source\", \"Last\", \"URLParam\", \"\"); }, paramName: \"utm_source\", fallbackValue: function() { return Invoca.PNAPI.currentPageSettings.poolParams.utm_source || null; } },\n  { on: function() { return Invoca.Client.parseCustomDataField(\"wbraid\", \"Last\", \"URLParam\", \"\"); }, paramName: \"wbraid\", fallbackValue: null }\n];\n\nvar defaultCampaignId = \"87\";\n\nvar destinationSettings = {\n  paramName: \"invoca_detected_destination\"\n};\n\nvar numbersToReplace = null;\n\nvar organicSources = true;\n\nvar reRunAfter = null;\n\nvar requiredParams = null;\n\nvar resetCacheOn = ['gclid', 'utm_source', 'utm_medium'];\n\nvar waitFor = 0;\n\nvar customCodeIsSet = (function() {\n  Invoca.Client.customCode = function(options) {\n    return options;\n  };\n\n  return true;\n})();\n\nvar generatedOptions = {\n  active:              true,\n  autoSwap:            true,\n  cookieDays:          cacheLifetimeDays,\n  country:             \"US\",\n  dataSilo:            \"us\",\n  defaultCampaignId:   defaultCampaignId,\n  destinationSettings: destinationSettings,\n  disableUrlParams:    [],\n  doNotSwap:           [],\n  maxWaitFor:          waitFor,\n  networkId:           networkId || null,\n  numberToReplace:     numbersToReplace,\n  organicSources:      organicSources,\n  poolParams:          {},\n  reRunAfter:          reRunAfter,\n  requiredParams:      requiredParams,\n  resetCacheOn:        resetCacheOn,\n  waitForData:         customDataWaitForConfig\n};\n\nInvoca.Client.startFromWizard(generatedOptions);\n\n})(29);\n",
  "cache_lifetime_warning": null,
  "collect_ip": false,
  "collect_user_agent": false,
  "created_at": "2023-11-15T08:01:36-08:00",
  "custom_code": "",
  "custom_data_fields": [],
  "default_campaign": {
    "default_campaign_id": "87",
    "default_campaign_name": "Default: Default Call Treatment"
  },
  "js_tag_id": "2510358551",
  "message": "",
  "numbers_to_not_replace": [],
  "numbers_to_replace": [],
  "organic_sources": true,
  "re_run_attribution_after": null,
  "required_params": "",
  "reset_cache_on": [
    "gclid",
    "utm_source",
    "utm_medium"
  ],
  "wait_for_in_seconds": 0.0
}
```

**Response Body**

```json theme={null}
{
  "errors": {
    "cache_lifetime_days": [
      "must be less than or equal to 30 days",
      "must be one of [1, 7, 14, 30]"
    ]
  }
}
```

### PUT

`https://invoca.net/api/2022-08-01/networks/<network_id>/js_tags/<js_tag_id>/revisions/1.json`

Content Type: application/json

Response Code: 403

**Request Body**

**Response Body**

```json theme={null}
{
  "errors": {
    "class": "RecordInvalid",
    "invalid_data": "Validation failed: This action can only be applied to the draft revision"
  }
}
```

### DELETE

`https://invoca.net/api/2022-08-01/networks/<network_id>/js_tags/<js_tag_id>/revisions/1.json`

Content Type: application/json

Response Code: 403

**Response Body**

```json theme={null}
{
  "errors": {
    "class": "RecordInvalid",
    "invalid_data": "Validation failed: This action can only be applied to the draft revision"
  }
}
```

Not Found – 404:

### GET

`https://invoca.net/api/2022-08-01/networks/<network_id>/js_tags/<js_tag_id>/revisions/<external_revision_id>.json`

Content Type: application/json

Response Code: 404

**Response Body**

```json theme={null}
{
  "errors": {
    "class": "RecordNotFound",
    "invalid_data": "Invoca Tag Revision not found with revision id: '99999'"
  }
}
```


## Related topics

- [Invoca Tags](https://docs.invoca.com/developers/api_documentation/network_integration/js_tags/index.md)
- [Invoca Tag: Access, Deploy, and Go Live](https://docs.invoca.com/s/article/tag-configuration-guide.md)
- [Validating and Troubleshooting Invoca Tags](https://docs.invoca.com/s/article/validating-troubleshooting-tags.md)
- [Can I Self-Host the Invoca Tag Library Locally?](https://docs.invoca.com/s/article/self-host-invoca-tag-library.md)
- [Invoca Tag: Advanced Settings & Attribution Reference](https://docs.invoca.com/s/article/tag-advanced-settings-reference.md)
