{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/latitude-so/json-schema/latitude-so-api-key-schema.json",
  "title": "ApiKey",
  "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/ApiKey",
  "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": "The full API key token. Returned by create / get / update — store it securely; treat it as a password."
    },
    "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 (rename, revoke, last-used touch)."
    }
  },
  "required": [
    "id",
    "organizationId",
    "scope",
    "projectId",
    "projectSlug",
    "name",
    "token",
    "lastUsedAt",
    "deletedAt",
    "createdAt",
    "updatedAt"
  ]
}