{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nopaque-co-uk/json-schema/nopaque-co-uk-rotate-api-key-response-schema.json",
  "title": "RotateApiKeyResponse",
  "description": "Response from `POST /workspaces/{workspaceId}/api-keys/{keyId}/rotate`. A superset of\n`CreateApiKeyResponse`, so a one-time-reveal UI can render either without branching.\n**This is the only time `rawKey` is returned.**\n",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nopaque-co-uk-api-keys-api-openapi.yml#/components/schemas/RotateApiKeyResponse",
  "type": "object",
  "required": [
    "id",
    "keyPrefix",
    "label",
    "createdAt",
    "rawKey",
    "rotatedFrom",
    "predecessorExpiresAt"
  ],
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Identifier of the NEW key."
    },
    "keyPrefix": {
      "type": "string"
    },
    "label": {
      "type": "string",
      "description": "Inherited from the predecessor."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "rawKey": {
      "type": "string",
      "description": "THE FULL SECRET of the successor. Returned ONLY here. Store it immediately —\nthe platform keeps only a SHA-256 hash and cannot recover it.\n"
    },
    "rotatedFrom": {
      "type": "string",
      "format": "uuid",
      "description": "Identifier of the key this one replaces."
    },
    "predecessorExpiresAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the replaced key stops authenticating. Deploy the new secret before this.\n"
    }
  }
}