{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/beatra-ai/json-schema/beatra-ai-account-profile-response-schema.json",
  "title": "AccountProfileResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/beatra-ai-account-api-openapi.yml#/components/schemas/AccountProfileResponse",
  "properties": {
    "tenant_id": {
      "type": "string",
      "title": "Tenant Id"
    },
    "user_id": {
      "type": "string",
      "title": "User Id"
    },
    "country_code": {
      "type": "string",
      "title": "Country Code"
    },
    "country_source": {
      "type": "string",
      "title": "Country Source"
    },
    "preferred_locale": {
      "type": "string",
      "title": "Preferred Locale"
    },
    "locale_source": {
      "type": "string",
      "title": "Locale Source"
    },
    "country_policy_key": {
      "type": "string",
      "title": "Country Policy Key"
    },
    "country_policy_version": {
      "type": "integer",
      "title": "Country Policy Version"
    },
    "login_methods": {
      "$ref": "#/$defs/LoginMethodsResponse"
    },
    "identities": {
      "items": {
        "$ref": "#/$defs/LoginIdentityResponse"
      },
      "type": "array",
      "title": "Identities"
    },
    "currency": {
      "type": "string",
      "title": "Currency"
    },
    "commercial_catalog_key": {
      "type": "string",
      "title": "Commercial Catalog Key"
    },
    "invoice_title_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Invoice Title Name"
    },
    "invoice_tax_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Invoice Tax Id"
    },
    "invoice_recipient_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Invoice Recipient Email"
    },
    "display_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Display Name"
    },
    "avatar_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Avatar Url"
    },
    "account_label": {
      "anyOf": [
        {
          "$ref": "#/$defs/AccountLabelResponse"
        },
        {
          "type": "null"
        }
      ]
    },
    "acct_ref": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Acct Ref"
    },
    "merged_from": {
      "items": {
        "$ref": "#/$defs/MergedFromOut"
      },
      "type": "array",
      "title": "Merged From"
    }
  },
  "type": "object",
  "required": [
    "tenant_id",
    "user_id",
    "country_code",
    "country_source",
    "preferred_locale",
    "locale_source",
    "country_policy_key",
    "country_policy_version",
    "login_methods",
    "currency",
    "commercial_catalog_key"
  ],
  "$defs": {
    "AccountLabelResponse": {
      "properties": {
        "kind": {
          "type": "string",
          "enum": [
            "nickname",
            "phone",
            "email",
            "wechat",
            "account"
          ],
          "title": "Kind"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        },
        "registered_on": {
          "anyOf": [
            {
              "type": "string",
              "format": "date"
            },
            {
              "type": "null"
            }
          ],
          "title": "Registered On"
        }
      },
      "type": "object",
      "required": [
        "kind"
      ],
      "title": "AccountLabelResponse",
      "description": "How this account is named to a person (account_links.labels; spec §6.1).\n\nClients put it into words: the nickname, masked phone or masked email as\n`text`, or 「微信账号 · {registered_on}注册」 / 「Beatra 账号 · …」 for the\n`wechat` and `account` kinds."
    },
    "LoginIdentityResponse": {
      "properties": {
        "provider": {
          "type": "string",
          "title": "Provider"
        },
        "display_value": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Display Value"
        }
      },
      "type": "object",
      "required": [
        "provider"
      ],
      "title": "LoginIdentityResponse",
      "description": "A way this account can actually be signed in to.\n\n`login_methods` above is the country policy's list of what a market\nsupports; this is what the account itself has. Settings was showing the\nformer labelled as the latter, so an account created with Google was told\nits sign-in was phone and WeChat."
    },
    "LoginMethodsResponse": {
      "properties": {
        "primary": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Primary"
        },
        "other": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Other"
        }
      },
      "type": "object",
      "required": [
        "primary",
        "other"
      ],
      "title": "LoginMethodsResponse"
    },
    "MergedFromOut": {
      "properties": {
        "tenant_id": {
          "type": "string",
          "title": "Tenant Id"
        },
        "user_id": {
          "type": "string",
          "title": "User Id"
        },
        "merged_at": {
          "type": "string",
          "format": "date-time",
          "title": "Merged At"
        }
      },
      "type": "object",
      "required": [
        "tenant_id",
        "user_id",
        "merged_at"
      ],
      "title": "MergedFromOut",
      "description": "An account merged into this one (spec §7.6); read by mobile_agent and desktop, never shown."
    }
  }
}