{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/zeblink-io/json-schema/zeblink-io-me-response-schema.json",
  "title": "MeResponse",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/_original/zeblink-io-v1-openapi.json#/components/schemas/MeResponse",
  "type": "object",
  "properties": {
    "user": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^usr_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"
        },
        "email": {
          "type": "string",
          "format": "email"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "email",
        "name"
      ]
    },
    "accessibleSpaces": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^spc_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "member",
              "contributor",
              "viewer"
            ],
            "description": "The key owner's role in the space. `contributor` and `viewer` are collection-scoped roles: reads everywhere, writes only inside granted collections (viewer: none)."
          }
        },
        "required": [
          "id",
          "name",
          "role"
        ]
      },
      "description": "Spaces this API key can act on. An all-scope key returns every space the user is a member of; a selected-scope key returns only the allowlisted spaces."
    },
    "apiKey": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^ak_[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$"
        },
        "prefix": {
          "type": "string",
          "description": "First ~8 characters of the key, safe to log."
        }
      },
      "required": [
        "id",
        "prefix"
      ]
    }
  },
  "required": [
    "user",
    "accessibleSpaces",
    "apiKey"
  ]
}