{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/asap-cool/json-schema/asap-cool-api-key-view-schema.json",
  "title": "ApiKeyView",
  "description": "One row in the `GET /v1/api-keys` response.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/asap-cool-api-keys-api-openapi.yml#/components/schemas/ApiKeyView",
  "type": "object",
  "required": [
    "id",
    "label",
    "prefix",
    "scopes",
    "env",
    "created_at"
  ],
  "properties": {
    "created_at": {
      "type": "string",
      "description": "RFC3339 creation timestamp."
    },
    "env": {
      "type": "string",
      "description": "`live` or `test`."
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "description": "Row id."
    },
    "label": {
      "type": "string",
      "description": "Display label."
    },
    "last_used_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC3339 last-used timestamp, if ever."
    },
    "prefix": {
      "type": "string",
      "description": "17-char lookup prefix (safe to display in UI)."
    },
    "revoked_at": {
      "type": [
        "string",
        "null"
      ],
      "description": "RFC3339 revocation timestamp, if any."
    },
    "scopes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Granted scopes as wire-format strings."
    }
  }
}