{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/latitude-so/json-schema/latitude-so-account-response-schema.json",
  "title": "AccountResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/latitude-so-account-api-openapi.yml#/components/schemas/AccountResponse",
  "type": "object",
  "properties": {
    "user": {
      "$ref": "#/$defs/AccountUser"
    },
    "organization": {
      "$ref": "#/$defs/AccountOrganization"
    },
    "role": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "owner",
        "admin",
        "member",
        null
      ],
      "description": "Caller's role in the organization. `null` for API-key callers (no real user behind the credential)."
    }
  },
  "required": [
    "user",
    "organization",
    "role"
  ],
  "$defs": {
    "AccountOrganization": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable organization identifier across the API."
        },
        "name": {
          "type": "string",
          "description": "Human-readable organization name."
        },
        "slug": {
          "type": "string",
          "description": "URL-safe slug. Regenerated when the organization is renamed — don't use it as a stable key."
        }
      },
      "required": [
        "id",
        "name",
        "slug"
      ],
      "description": "Organization the request is scoped to."
    },
    "AccountUser": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "Stable user identifier across the API."
        },
        "email": {
          "type": "string",
          "description": "Verified email address of the authenticated user."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Display name, when set. `null` until the user completes onboarding."
        },
        "image": {
          "type": [
            "string",
            "null"
          ],
          "description": "Profile image URL, when set."
        }
      },
      "required": [
        "id",
        "email",
        "name",
        "image"
      ],
      "description": "The user the request is acting on behalf of. `null` for API-key callers — API keys are org-scoped, not user-scoped."
    }
  }
}