{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/knoxcall/json-schema/knoxcall-api-key-created-schema.json",
  "title": "ApiKeyCreated",
  "description": "API key creation response. The `api_key` field contains the full key and is\n**only returned once** at creation time. Store it securely.\n",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/knoxcall-api-keys-api-openapi.yml#/components/schemas/ApiKeyCreated",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Internal UUID of the key record — the value `DELETE /v1/api-keys/{id}` and\nrole assignments reference. Added 2026-08-09; previously the create response\ncarried no UUID at all, so a caller had to list keys back to find it.\n"
    },
    "role_ids": {
      "type": "array",
      "description": "The role UUIDs actually attached, in the same transaction as the key. Empty\nwhen none were requested — which means the key is default-denied on every\npolicy-gated endpoint.\n",
      "items": {
        "type": "string",
        "format": "uuid"
      }
    },
    "key_id": {
      "type": "string",
      "description": "Public key identifier prefix."
    },
    "api_key": {
      "type": "string",
      "description": "The full API key. **This is the only time it will be shown.** Store it\nin a secure location immediately.\n"
    },
    "key_prefix": {
      "type": "string",
      "description": "First characters of the key for identification."
    },
    "key_type": {
      "type": "string",
      "enum": [
        "standard",
        "test"
      ],
      "description": "Key type determined by which API host the key was created on."
    },
    "name": {
      "type": "string",
      "description": "Name you assigned to the key."
    },
    "expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the new key stops authenticating, resolved from whichever of\n`expires_in_days` / `expires_at` / `never_expires` you sent. `null` means it\nnever expires.\n\n**Sending none of the three puts this 90 days out**, so read this field back\neven when you did not ask for an expiry — it is the value that was actually\napplied, not an echo of your request.\n"
    },
    "message": {
      "type": "string",
      "description": "Reminder to store the key securely."
    }
  }
}