{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/openmail-sh/json-schema/openmail-sh-api-key-schema.json",
  "title": "ApiKey",
  "x-generated": "2026-10-31",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/openmail-sh-openapi.json#/components/schemas/ApiKey",
  "type": "object",
  "additionalProperties": true,
  "properties": {
    "id": {
      "type": "string",
      "description": "OpenMail API key ID"
    },
    "name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Human-readable label for the key, if set."
    },
    "podId": {
      "type": [
        "string",
        "null"
      ],
      "description": "ID of the pod this key is scoped to, or null for an account-wide key. A pod-scoped key can only access resources in this pod."
    },
    "inboxId": {
      "type": [
        "string",
        "null"
      ],
      "description": "ID of the inbox this key is confined to, or null. When set, the key can only access this single inbox and its threads, messages, and drafts (its `podId` is the inbox's pod)."
    },
    "tokenPrefix": {
      "type": "string",
      "description": "Non-secret leading characters of the token, to help you identify it."
    },
    "last4": {
      "type": "string",
      "description": "Last 4 characters of the token, shown alongside the prefix."
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "lastUsedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "When the key last authenticated a request, or null if never used."
    }
  }
}