You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generate a new API key while preserving the configuration from an existing key.
4418
+
4419
+
This operation creates a fresh key with a new token while maintaining all settings from the original key:
4420
+
- Permissions and roles
4421
+
- Custom metadata
4422
+
- Rate limit configurations
4423
+
- Identity associations
4424
+
- Remaining credits
4425
+
- Recovery settings
4426
+
4427
+
**Key Generation:**
4428
+
- The system attempts to extract the prefix from the original key
4429
+
- If prefix extraction fails, the default API prefix is used
4430
+
- Key length follows the API's default byte configuration (or 16 bytes if not specified)
4431
+
4432
+
**Original Key Handling:**
4433
+
- The original key will be revoked after the duration specified in `expiration`
4434
+
- Set `expiration` to 0 to revoke immediately
4435
+
- This allows for graceful key rotation with an overlap period
4436
+
4437
+
Common use cases include:
4438
+
- Rotating keys for security compliance
4439
+
- Issuing replacement keys for compromised credentials
4440
+
- Creating backup keys with identical permissions
4441
+
4442
+
**Important:** Analytics and usage metrics are tracked at both the key level AND identity level. If the original key has an identity, the new key will inherit it, allowing you to track usage across both individual keys and the overall identity.
4443
+
4444
+
**Required Permissions**
4445
+
4446
+
Your root key must have:
4447
+
- `api.*.create_key` or `api.<api_id>.create_key`
4448
+
- `api.*.encrypt_key` or `api.<api_id>.encrypt_key` (only when the original key is recoverable)
0 commit comments