{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/groundmail-dev/json-schema/groundmail-dev-list-api-keys-response-schema.json",
  "title": "ListApiKeysResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/groundmail-dev-api-keys-api-openapi.yml#/components/schemas/ListApiKeysResponse",
  "type": "object",
  "required": [
    "data",
    "has_more",
    "next_cursor"
  ],
  "properties": {
    "data": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ApiKey"
      }
    },
    "has_more": {
      "type": "boolean"
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "$defs": {
    "ApiKey": {
      "type": "object",
      "required": [
        "id",
        "name",
        "scope",
        "scopes",
        "allowed_domains",
        "prefix",
        "created_at"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "scope": {
          "type": "string",
          "enum": [
            "full",
            "sending"
          ],
          "description": "Legacy label; `sending` for any key narrower than full."
        },
        "scopes": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ApiScope"
          }
        },
        "allowed_domains": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Domains this key may send from; empty means any verified domain."
        },
        "test": {
          "type": "boolean",
          "description": "A test key (`gm_test_…`). Its sends are simulated and never delivered."
        },
        "tenant": {
          "type": "string",
          "description": "The `external_id` of the tenant this key is limited to. Present only on tenant keys."
        },
        "prefix": {
          "type": "string",
          "description": "Visible key prefix (e.g. `gm_1a2b3c4d`, or `gm_test_1a2b3c4d` for a test key)"
        },
        "created_at": {
          "type": "string",
          "format": "date-time"
        },
        "last_used_at": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        }
      }
    },
    "ApiScope": {
      "type": "string",
      "description": "A scope for API keys and OAuth tokens. `full` grants everything.",
      "enum": [
        "full",
        "emails:send",
        "emails:read",
        "domains:read",
        "domains:write",
        "webhooks:write",
        "templates:write",
        "suppressions:write",
        "account:read"
      ]
    }
  }
}