{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mentio-dev/json-schema/mentio-dev-whoami-schema.json",
  "title": "Whoami",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mentio-dev-auth-api-openapi.yml#/components/schemas/Whoami",
  "type": "object",
  "properties": {
    "workspace": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Workspace id (org_...)."
        },
        "name": {
          "type": "string",
          "description": "The workspace name, as the dashboard shows it."
        }
      },
      "required": [
        "id",
        "name"
      ],
      "description": "The workspace this credential acts on."
    },
    "auth": {
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "api_key",
            "oauth",
            "session"
          ],
          "description": "How the request authenticated: an API key, an OAuth access token (MCP sign-in), or the dashboard session."
        },
        "scope": {
          "type": "string",
          "enum": [
            "read",
            "write"
          ],
          "description": "What the credential may do: read (GET only) or write."
        },
        "apiKeyId": {
          "type": [
            "string",
            "null"
          ],
          "description": "The key id (key_...) when authenticated with an API key; null otherwise."
        },
        "expiresAt": {
          "type": [
            "string",
            "null"
          ],
          "description": "When an API key stops working; null for a key that never expires, an OAuth token or a session."
        }
      },
      "required": [
        "kind",
        "scope",
        "apiKeyId",
        "expiresAt"
      ],
      "description": "The credential."
    },
    "user": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "User id, what assigneeId and ownerId take."
        },
        "email": {
          "type": "string",
          "description": "The account's email address."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "The name on the account; null when they never set one."
        }
      },
      "required": [
        "id",
        "email",
        "name"
      ],
      "description": "The person behind an OAuth token or a session; null for an API key, which has no person behind it."
    }
  },
  "required": [
    "workspace",
    "auth",
    "user"
  ]
}