{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/xfa-tech/json-schema/xfa-tech-organization-full-schema.json",
  "title": "OrganizationFull",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/xfa-tech-openapi.yml#/components/schemas/OrganizationFull",
  "type": "object",
  "properties": {
    "awareness_schedule": {
      "$ref": "#/$defs/AwarenessSchedule"
    },
    "organization_id": {
      "type": "string",
      "description": "ID of Organization"
    },
    "name": {
      "type": "string",
      "description": "Name of Organization"
    },
    "address": {
      "type": "string",
      "description": "Address of Organization"
    },
    "zip_code": {
      "type": "string",
      "description": "Zip Code of Organization"
    },
    "city": {
      "type": "string",
      "description": "City of Organization"
    },
    "country": {
      "type": "string",
      "description": "Country of Organization"
    },
    "vat": {
      "type": "string",
      "description": "VAT of Organization"
    },
    "tax_number": {
      "type": "string",
      "description": "Tax Number of Organization"
    },
    "phone_number": {
      "type": "string",
      "description": "Phone Number of Organization"
    },
    "billing_email": {
      "type": "string",
      "description": "Billing Email of Organization"
    },
    "billing_name": {
      "type": "string",
      "description": "Billing Name of Organization"
    },
    "billing_first_name": {
      "type": "string",
      "description": "Billing First Name of Organization"
    },
    "billing_last_name": {
      "type": "string",
      "description": "Billing Last Name of Organization"
    },
    "deleted": {
      "type": "boolean",
      "description": "Whether the organization is deleted"
    },
    "deleted_at": {
      "type": "string",
      "format": "date-time",
      "description": "UTC time of the delete. Absent when not deleted, and for organizations deleted before this field existed."
    },
    "logo_url": {
      "type": "string",
      "description": "URL of the logo"
    },
    "notify_no_managed_devices": {
      "type": "boolean",
      "description": "Notify no managed devices"
    },
    "notify_no_desktop_devices": {
      "type": "boolean",
      "description": "Notify no desktop devices"
    },
    "notify_no_mobile_devices": {
      "type": "boolean",
      "description": "Notify no mobile devices"
    },
    "notify_discovered_devices": {
      "type": "boolean",
      "description": "Notify discovered devices"
    },
    "notify_discovered_devices_frequency_in_days": {
      "type": "integer",
      "description": "Frequency of notification for discovered devices"
    },
    "invite_discovered_devices": {
      "type": "boolean",
      "description": "Invite discovered devices"
    },
    "default_language": {
      "$ref": "#/$defs/Language"
    },
    "self_invite_enabled": {
      "type": "boolean",
      "description": "Allow verified native app users to request self-invite when eligible"
    },
    "my_account_disabled": {
      "type": "boolean",
      "description": "End-user self-service (My account) is read-only: users can still sign in to My account and see their sign-in methods and devices, but cannot change them. False (the default) means self-service is on. Organization administrators change it."
    },
    "domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The organization's email domains (normalized, sorted), managed through /organizations/{organizationId}/domains"
    },
    "verified_domains": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The domains among domains whose ownership is proven with a DNS TXT record (XFA-3939)"
    },
    "require_verified_domains": {
      "type": "boolean",
      "description": "Only domains with proven ownership admit IdP sign-in, onboarding and import: emails are checked against verified_domains instead of domains. False (the default) means every domain counts. Organization administrators change it."
    },
    "last_active_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "description": "When (RFC 3339, UTC) any administrator of this organization last used the dashboard; XFA system administrators do not count. Set by organizations-service; absent until the first visit (XFA-3989)."
    },
    "last_active_by": {
      "type": "string",
      "readOnly": true,
      "description": "The email of the administrator whose visit set last_active_at, written together with it by organizations-service. Never XFA staff. Absent until the first visit, and for times recorded before this field existed (XFA-3989)."
    },
    "notify_unsafe_devices": {
      "type": "boolean",
      "description": "Notify unsafe devices"
    },
    "notify_unsafe_devices_frequency_in_days": {
      "type": "integer",
      "description": "Frequency of notification for unsafe devices"
    },
    "slack_enabled": {
      "type": "boolean",
      "description": "Enable Slack DMs for device risk notifications"
    },
    "slack_notify_unsafe_devices": {
      "type": "boolean",
      "description": "Send Slack DMs to users about unsafe devices"
    },
    "slack_notify_discovered_devices": {
      "type": "boolean",
      "description": "Send Slack DMs to users about discovered devices"
    },
    "slack_invite_discovered_devices": {
      "type": "boolean",
      "description": "Send invitation Slack DMs to users with discovered devices"
    },
    "manual_invite_send_slack": {
      "type": "boolean",
      "description": "Last-used Slack toggle state in the manual Invite users popup."
    },
    "teams_notify_unsafe_devices": {
      "type": "boolean",
      "description": "Send Teams DMs to users about unsafe devices"
    },
    "teams_notify_discovered_devices": {
      "type": "boolean",
      "description": "Send Teams DMs to users about discovered devices"
    },
    "teams_invite_discovered_devices": {
      "type": "boolean",
      "description": "Send invitation Teams DMs to users with discovered devices"
    },
    "manual_invite_send_teams": {
      "type": "boolean",
      "description": "Last-used Microsoft Teams toggle state in the manual Invite users popup."
    },
    "notify_breach_people": {
      "type": "boolean",
      "description": "Breach alerts: email each address at a monitored domain that turns up in a breach HIBP added after the domain was verified. Absent means off; off by default for every organization."
    },
    "notify_only_groups": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        }
      }
    },
    "default_policy_id": {
      "type": "string",
      "description": "Default Policy ID of Organization"
    },
    "feature_flags": {
      "type": "array",
      "description": "Feature flags enabled for this organization",
      "items": {
        "$ref": "#/$defs/FeatureFlag"
      }
    },
    "getting_started_state": {
      "type": "string",
      "description": "JSON blob owned by the dashboard's Getting Started journey; opaque to the backend."
    },
    "referred_by": {
      "type": "string",
      "description": "Email of the dashboard user whose referral code this organization signed up with, if any."
    },
    "timestamp": {
      "type": "string",
      "format": "date-time",
      "description": "Created timestamp of the organization"
    }
  },
  "required": [
    "organization_id",
    "name",
    "address",
    "zip_code",
    "city",
    "country",
    "vat",
    "tax_number",
    "phone_number",
    "billing_email",
    "timestamp"
  ],
  "$defs": {
    "AwarenessAutomationSchedule": {
      "type": "object",
      "required": [
        "next_run_at"
      ],
      "properties": {
        "next_run_at": {
          "type": "string",
          "format": "date-time",
          "description": "Next scheduled Awareness evaluation, in UTC; actual delivery is conditional."
        }
      }
    },
    "AwarenessSchedule": {
      "type": "object",
      "readOnly": true,
      "description": "Next nominal hourly Awareness evaluation in production (minute 30, UTC), not a guaranteed delivery time. Recipient cooldowns, scope, billing and channel availability are checked at execution. Absent outside production or when all automations are disabled. Reload to refresh expired times. Risk alerts currently require notify_unsafe_devices, including Slack/Teams.",
      "properties": {
        "auto_invite": {
          "$ref": "#/$defs/AwarenessAutomationSchedule"
        },
        "setup_reminder": {
          "$ref": "#/$defs/AwarenessAutomationSchedule"
        },
        "risk_alert": {
          "$ref": "#/$defs/AwarenessAutomationSchedule"
        }
      }
    },
    "FeatureFlag": {
      "type": "string",
      "description": "An organization feature flag. Values are validated by xfa-organizations-service (`FeatureFlag.IsValid()`), which is the single source of truth; this contract is intentionally left open so that adding a new flag does not require an xfa-api change. Currently known values: phishing_lab, runaway_ai, edr-detection, safe_browsing, slack, teams, self_invite, mem_export, unattended_remote_access, aikido_enabled, application_checks_enabled, idp, play_protect, mdm_enrollment, passkeys, admin_mfa_approval."
    },
    "Language": {
      "type": "string",
      "description": "Language for end-user emails when the recipient has not picked one; a user's own choice always wins. The set mirrors the email templates shipped by xfa-notification-service. An empty string is the canonical way to clear the organization default, on both PUT and PATCH, so the whole organization can be saved in one request; xfa-organizations-service stores it as an absent attribute.",
      "enum": [
        "",
        "en",
        "nl",
        "fr",
        "de",
        "es"
      ]
    }
  }
}