Keys

Rotate the public key

Mints a new public collection key. The key it replaces stays accepted for 24 hours so pages cached with the old snippet keep working; a key that was already retiring is revoked, so at most two keys are ever accepted. Public keys are not secrets and can only ever ask to record for their own site. With an Idempotency-Key, a retry rotates once and returns the first answer; a partner integration's managed key must send one. Needs analytics.sites.write.

post/v1/sites/{siteId}/keys/rotate

Request

  • Base URL: https://api.ironfang.com/analytics
  • URL: https://api.ironfang.com/analytics/v1/sites/{siteId}/keys/rotate
  • Auth: one of:
    • HTTP bearer
    • HTTP bearer

Headers

Idempotency-Keystring

Makes the request safe to retry: the same key with the same request returns the first answer for 24 hours. Generate one per logical change. Required when the caller is a partner integration's managed key.

Response

The site with its keys after rotation, or the stored answer to a retry

Example response

{
  "origins": [
    {
      "dns_record": {
        "name": "_ironfang-analytics.shop.example.com"
      },
      "origin": "https://shop.example.com"
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.