Rotate analytics site key
analytics_rotate_keyRotate an analytics property's ingest site key and return the new key once; old key stays valid until overlapExpiresAt.
Instructions
Rotate a property's ingest site key via POST /api/v1/analytics/property/key/rotate. Target with propertyId ALONE (primary), or a project reference plus expectedPropertyId (409 analytics_property_changed on mismatch). The new siteKey is shown EXACTLY ONCE; the old key keeps working through overlapExpiresAt. NOT idempotent and never auto-retried: a manual retry performs a fresh rotation (safe — install the latest returned key). Does not use credits.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| projectId | No | Numeric project id (convenience shape; do not combine with propertyId). | |
| propertyId | No | Explicit analytics property id (primary target). Pass ALONE — combining with a project reference is rejected. When omitted, pass a project reference instead; that resolves only when the project has exactly one property (409 property_scope_ambiguous otherwise). | |
| projectUuid | No | Project UUID (alternative to projectId). | |
| expectedPropertyId | No | Required with a project reference: the property id you believe is current. Omit when targeting by propertyId. |