{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cloudtruth/json-schema/cloudtruth-organization-schema.json",
  "title": "Organization",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cloudtruth-organizations-api-openapi.yml#/components/schemas/Organization",
  "type": "object",
  "properties": {
    "url": {
      "type": "string",
      "format": "uri",
      "readOnly": true
    },
    "id": {
      "type": "string",
      "readOnly": true,
      "description": "A unique identifier for the organization."
    },
    "name": {
      "type": "string",
      "description": "The organization name.",
      "maxLength": 256
    },
    "project_name_pattern": {
      "type": "string",
      "description": "A regular expression project names must match",
      "maxLength": 255
    },
    "maintenance": {
      "type": "boolean",
      "readOnly": true,
      "description": "If set, we are performing maintenance on this organization and have disabled making changes"
    },
    "mfa_enabled": {
      "type": "boolean",
      "description": "Multi-factor authentication for the organization"
    },
    "version": {
      "allOf": [
        {
          "$ref": "#/$defs/VersionEnum"
        }
      ],
      "readOnly": true,
      "description": "The current version of this Organization\n\n* `1` - NEW_SECRETS\n* `2` - API_CACHING\n* `3` - EFFECTIVE_VALUE\n* `4` - MEV\n* `5` - MEV_NATS"
    },
    "notification_config": {},
    "current": {
      "type": "boolean",
      "description": "Indicates if this Organization is the one currently targeted by the Bearer token used by the client to authorize.",
      "readOnly": true
    },
    "role": {
      "allOf": [
        {
          "$ref": "#/$defs/RoleA5aEnum"
        }
      ],
      "description": "Your role in the organization.",
      "readOnly": true
    },
    "subscription_expires_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "If a subscription will not auto-renew, this indicates the last active date.",
      "readOnly": true
    },
    "subscription_features": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "A list of optional feature names the subscription enables.",
      "readOnly": true
    },
    "subscription_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The subscription identifier, or None if there is an error retrieving it.",
      "readOnly": true
    },
    "subscription_plan_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "The subscription plan code, or None if there is an error retrieving it.",
      "readOnly": true
    },
    "subscription_plan_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "The subscription plan name, or None if there is an error retrieving it.",
      "readOnly": true
    },
    "copilot_enabled": {
      "type": "boolean",
      "readOnly": true,
      "description": "If set, the organization has Copilot enabled."
    },
    "auth0_organization_id": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "The Auth0 Organization ID (e.g., 'org_abc123') when SSO is enabled."
    },
    "sso_domain": {
      "type": [
        "string",
        "null"
      ],
      "readOnly": true,
      "description": "The verified email domain for SSO (e.g., 'acme.com')."
    },
    "sso_enabled": {
      "type": "boolean",
      "readOnly": true,
      "description": "If set, this organization requires SSO authentication via Auth0 Organizations."
    },
    "sso_migration_state": {
      "allOf": [
        {
          "$ref": "#/$defs/SsoMigrationStateEnum"
        }
      ],
      "readOnly": true,
      "description": "Tracks the state of SSO migration for this organization.\n\n* `not_started` - Not Started\n* `in_progress` - In Progress\n* `completed` - Completed"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true
    },
    "modified_at": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "readOnly": true
    }
  },
  "required": [
    "auth0_organization_id",
    "copilot_enabled",
    "created_at",
    "current",
    "id",
    "maintenance",
    "modified_at",
    "name",
    "role",
    "sso_domain",
    "sso_enabled",
    "sso_migration_state",
    "subscription_expires_at",
    "subscription_features",
    "subscription_id",
    "subscription_plan_id",
    "subscription_plan_name",
    "url",
    "version"
  ],
  "$defs": {
    "RoleA5aEnum": {
      "enum": [
        "OWNER",
        "ADMIN",
        "CONTRIB",
        "VIEWER",
        "NO_SECRETS"
      ],
      "type": "string"
    },
    "SsoMigrationStateEnum": {
      "enum": [
        "not_started",
        "in_progress",
        "completed"
      ],
      "type": "string",
      "description": "* `not_started` - Not Started\n* `in_progress` - In Progress\n* `completed` - Completed"
    },
    "VersionEnum": {
      "enum": [
        1,
        2,
        3,
        4,
        5
      ],
      "type": "integer",
      "description": "* `1` - NEW_SECRETS\n* `2` - API_CACHING\n* `3` - EFFECTIVE_VALUE\n* `4` - MEV\n* `5` - MEV_NATS"
    }
  }
}