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

# Update Web Tracking Key

> Rename a key, replace its allowed origins, or revoke it

Rename a web tracking key, replace its allowed origins, or revoke it.

Requires an API key with the `integrations:manage` scope.

## Request

<ParamField path="id" type="string" required>
  Web tracking key ID.
</ParamField>

<ParamField body="name" type="string">
  New label for the key.
</ParamField>

<ParamField body="allowedOrigins" type="array">
  Replacement allowlist. This **replaces** the whole list rather than appending
  to it, so include the origins you want to keep. Pass an empty array to make
  the key unrestricted.
</ParamField>

<ParamField body="isActive" type="boolean">
  Set `false` to revoke, `true` to re-enable a revoked key.
</ParamField>

```bash theme={null}
curl -X PATCH "https://api.sequenzy.com/api/v1/web-tracking-keys/wtk_abc123" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"allowedOrigins": ["https://example.com"]}'
```

## Behavior

Revoking takes effect within about a minute and does not rotate the key value, so you can still find and remove the matching snippet from your site. Use [Delete Web Tracking Key](/api-reference/web-tracking-keys/delete) once the snippet is gone.

Fields you do not send are left unchanged. Send at least one of `name`,
`allowedOrigins`, or `isActive`.

## Responses

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "key": {
      "id": "wtk_abc123",
      "name": "Storefront",
      "publicKey": "seq_pk_hR8xQ2mK9vL4nP7wT1yZ6cB3dF5gJ0sA",
      "allowedOrigins": ["https://example.com"],
      "isActive": true,
      "unrestricted": false,
      "lastUsedAt": "2026-08-17T09:12:00.000Z",
      "createdAt": "2026-08-01T10:00:00.000Z",
      "updatedAt": "2026-08-17T10:30:00.000Z",
      "installSnippet": "<script>(function(w){var q=w.sequenzy=w.sequenzy||[];[\"identify\",\"track\",\"viewedProduct\",\"addedToCart\",\"removedFromCart\",\"viewedCart\",\"viewedCollection\",\"searched\",\"reset\"].forEach(function(m){q[m]=q[m]||function(){q.push([m].concat(Array.prototype.slice.call(arguments)));};});})(window);</script><script async src=\"https://api.sequenzy.com/sequenzy.js\" data-sequenzy-key=\"seq_pk_hR8xQ2mK9vL4nP7wT1yZ6cB3dF5gJ0sA\" data-sequenzy-company=\"comp_123\" data-sequenzy-endpoint=\"https://api.sequenzy.com\"></script>",
      "endpoint": "https://api.sequenzy.com/api/webhooks/commerce/api/comp_123/customer-events"
    }
  }
  ```

  ```json 400 theme={null}
  {
    "error": "allowedOrigins contains entries that are not valid origins: ftp://example.com. Use a scheme and host such as https://example.com, or https://*.example.com for subdomains."
  }
  ```

  ```json 401 theme={null}
  {
    "error": "Missing API key. Provide via x-api-key header or Authorization: Bearer <key>"
  }
  ```

  ```json 403 theme={null}
  {
    "error": "API key is missing required scope: integrations:manage"
  }
  ```

  ```json 404 theme={null}
  {
    "error": "Web tracking key not found"
  }
  ```
</ResponseExample>
