{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/latitude-so/json-schema/latitude-so-api-key-list-schema.json",
  "title": "ApiKeyList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/latitude-so-api-keys-api-openapi.yml#/components/schemas/ApiKeyList",
  "type": "object",
  "properties": {
    "apiKeys": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApiKeyListItem"
      }
    }
  },
  "required": [
    "apiKeys"
  ],
  "$defs": {
    "ApiKeyListItem": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable API-key identifier."
        },
        "organizationId": {
          "type": "string",
          "description": "Organization that owns this API key."
        },
        "scope": {
          "type": "string",
          "enum": [
            "organization",
            "project"
          ],
          "description": "`organization` keys can call every route. `project` keys are bound to `projectId`."
        },
        "projectId": {
          "type": [
            "string",
            "null"
          ],
          "description": "Project this key is bound to. `null` for an organization-wide key."
        },
        "projectSlug": {
          "type": [
            "string",
            "null"
          ],
          "description": "Slug of the bound project, when the project still exists. `null` for organization-wide keys."
        },
        "name": {
          "type": "string",
          "description": "Human-readable name."
        },
        "token": {
          "type": "string",
          "description": "Masked token preview safe to display in lists. Use `GET /api-keys/{apiKeyId}` to retrieve the full token."
        },
        "lastUsedAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO-8601 timestamp of the most recent successful authentication. `null` until first use."
        },
        "deletedAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "ISO-8601 timestamp at which the key was revoked. `null` while the key is active."
        },
        "createdAt": {
          "type": "string",
          "description": "ISO-8601 timestamp of creation."
        },
        "updatedAt": {
          "type": "string",
          "description": "ISO-8601 timestamp of the last metadata update."
        }
      },
      "required": [
        "id",
        "organizationId",
        "scope",
        "projectId",
        "projectSlug",
        "name",
        "token",
        "lastUsedAt",
        "deletedAt",
        "createdAt",
        "updatedAt"
      ]
    }
  }
}