{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trajectory/json-schema/trajectory-api-key-list-response-schema.json",
  "title": "ApiKeyListResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trajectory-api-keys-api-openapi.yml#/components/schemas/ApiKeyListResponse",
  "properties": {
    "items": {
      "items": {
        "$ref": "#/$defs/ApiKey"
      },
      "type": "array",
      "title": "Items",
      "description": "Page of the organization's active API keys."
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Cursor",
      "description": "Cursor for the next page, or null if none."
    },
    "has_more": {
      "type": "boolean",
      "title": "Has More",
      "description": "True if more API keys remain beyond this page."
    }
  },
  "type": "object",
  "required": [
    "items",
    "has_more"
  ],
  "$defs": {
    "ApiKey": {
      "properties": {
        "key_hash": {
          "type": "string",
          "title": "Key Hash",
          "description": "Opaque identifier for the key (SHA-256 of the secret). Used to reference the key when revoking it; the secret itself is never returned after creation."
        },
        "key_prefix": {
          "type": "string",
          "title": "Key Prefix",
          "description": "Non-secret prefix shown to help identify the key."
        },
        "name": {
          "type": "string",
          "title": "Name",
          "description": "Human-readable label for the key."
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At",
          "description": "UTC timestamp the key was created."
        },
        "last_used_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Last Used At",
          "description": "UTC timestamp the key was last used to authenticate, if ever."
        }
      },
      "type": "object",
      "required": [
        "key_hash",
        "key_prefix",
        "name"
      ],
      "title": "ApiKey"
    }
  }
}