Unkey · Schema

V2KeysRerollKeyResponseData

API KeysRate LimitingAuthenticationDeveloper PlatformAccess ControlIdentityAnalytics

Properties

Name Type Description
keyId string The unique identifier for the newly created key. This is NOT the actual API key token, but a reference ID for management operations. Store this ID to: - Update or revoke the key later - Track the key
key string The newly generated API key token (the actual secret that authenticates requests). **SECURITY CRITICAL:** - This is the only time you'll receive the complete key - Unkey stores only a hashed version (
View JSON Schema on GitHub

JSON Schema

unkey-v2keysrerollkeyresponsedata-schema.json Raw ↑
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/V2KeysRerollKeyResponseData",
  "title": "V2KeysRerollKeyResponseData",
  "type": "object",
  "properties": {
    "keyId": {
      "type": "string",
      "description": "The unique identifier for the newly created key.\n\nThis is NOT the actual API key token, but a reference ID for management operations.\nStore this ID to:\n- Update or revoke the key later\n- Track the key in your database\n- Display in admin dashboards (safe to log)\n\nNote: This is a new ID - the original key retains its own ID.\n",
      "example": "key_2cGKbMxRyIzhCxo1Idjz8q"
    },
    "key": {
      "type": "string",
      "description": "The newly generated API key token (the actual secret that authenticates requests).\n\n**SECURITY CRITICAL:**\n- This is the only time you'll receive the complete key\n- Unkey stores only a hashed version (unless the original key was created with `recoverable=true`)\n- Never log, store, or expose this value in your systems\n- Transmit directly to the end user via secure channels only\n- If lost and not recoverable, you must reroll or create a new key\n\nThe key format follows: `[prefix]_[random_bytes]`\n- Prefix is extracted from the original key or uses API default\n- Random bytes follow API configuration (default: 16 bytes)\n\nThis is NOT the keyId - it's the actual secret token used for authentication.\n",
      "example": "prod_2cGKbMxRjIzhCxo1IdjH3arELti7Sdyc8w6XYbvtcyuBowPT"
    }
  },
  "required": [
    "keyId",
    "key"
  ]
}