ConfigUpdate a tag template

Update a tag template

Partial update of one of this location's own templates. The type rule is checked on the stored row after the change, so switching type needs the matching src or code in the same request. When the template is assigned, the edge config is rebuilt and kv_sync reports it; otherwise kv_sync is not_assigned. Agency key (ak_) required.

curl -X PATCH "https://mythic-analytics.gulp.workers.dev/client/v1/config/tag-templates/123e4567-e89b-12d3-a456-426614174000?location_id=example_string" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "name": "John Doe",
  "type": "url",
  "src": "example_string",
  "code": "example_string",
  "description": "example_string",
  "trigger_rules": {
    "version": 1,
    "operator": "AND",
    "rules": [
      {
        "type": "url_pattern",
        "operator": "contains",
        "value": "/checkout"
      }
    ]
  }
}'
{
  "success": true,
  "data": {
    "id": "123e4567-e89b-12d3-a456-426614174000",
    "owner": "mythic",
    "managed": true,
    "name": "Hotjar",
    "type": "url",
    "src": "https://static.hotjar.com/c/hotjar-1234567.js?sv=6",
    "code": "example_string",
    "description": "example_string",
    "trigger_rules": {
      "version": 1,
      "operator": "AND",
      "rules": [
        {
          "type": "url_pattern",
          "operator": "contains",
          "value": "/checkout"
        }
      ]
    },
    "created_at": "2024-12-25T10:00:00Z",
    "updated_at": "2024-12-25T10:00:00Z"
  },
  "kv_sync": "synced"
}
PATCH
/client/v1/config/tag-templates/{id}
PATCH
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

Agency key (ak_) or location secret key (sk_). Writes require an agency key. Keys are server-side credentials — this surface serves no CORS headers on purpose. Scoped keys (mcp_) are accepted too and need the tags, snippets or transformers family the route belongs to. See Using an mcp_ key over HTTP.

Agency key (ak_) or location secret key (sk_). Writes require an agency key. Keys are server-side credentials — this surface serves no CORS headers on purpose. Scoped keys (mcp_) are accepted too and need the tags, snippets or transformers family the route belongs to. See Using an mcp_ key over HTTP.
path
idstring
Required

Tag template UUID.

Format: uuid
query
location_idstring

Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_.

Content-Typestring
Required

The media type of the request body

Options: application/json
namestring
Max length: 200
typestring
Options: url, inline
codestring
Max length: 65536
descriptionstring
Max length: 2000
trigger_rulesobject

Optional page/condition rules controlling where the tag or snippet fires. Omitted or null means everywhere.

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. Agency key (ak_) or location secret key (sk_). Writes require an agency key. Keys are server-side credentials — this surface serves no CORS headers on purpose. Scoped keys (mcp_) are accepted too and need the tags, snippets or transformers family the route belongs to. See Using an mcp_ key over HTTP.

Path Parameters

idstring
Required

Tag template UUID.

Query Parameters

location_idstring

Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_.

Body

application/json
typestring
Allowed values:urlinline
trigger_rulesobject

Optional page/condition rules controlling where the tag or snippet fires. Omitted or null means everywhere.

Example:
{"version":1,"operator":"AND","rules":[{"type":"url_pattern","operator":"contains","value":"/checkout"}]}

Responses

successboolean
dataobject
kv_syncstring

synced, failed: \<reason\>, or not_assigned when no assignment uses the template.