{
  "$defs": {
    "TenantStatus": {
      "description": "``suspended`` tenants are read-only; ``deleting`` tenants are inaccessible.",
      "enum": [
        "active",
        "suspended",
        "deleting"
      ],
      "title": "TenantStatus",
      "type": "string"
    },
    "TrustTier": {
      "description": "How much the platform trusts a tenant's code and data (plan \u00a72, \u00a77, \u00a79).",
      "enum": [
        "internal",
        "verified",
        "public",
        "self-hosted-trusted"
      ],
      "title": "TrustTier",
      "type": "string"
    }
  },
  "$id": "https://schemas.mapi.dev/v1/api-Tenant.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "The billing, isolation and quota boundary.",
  "examples": [
    {
      "created_at": "2026-10-15T09:30:00Z",
      "data_residency": "eu",
      "id": "acme",
      "name": "Acme Retail",
      "status": "active",
      "trust_tier": "verified"
    }
  ],
  "properties": {
    "created_at": {
      "format": "date-time",
      "title": "Created At",
      "type": "string"
    },
    "data_residency": {
      "default": "us",
      "description": "A multi-region (eu, us, asia) or one cloud region (europe-west1)",
      "examples": [
        "eu",
        "us",
        "europe-west1"
      ],
      "pattern": "^(?:[a-z]{2,6}|[a-z]+-[a-z]+[0-9]{1,2})$",
      "title": "Data Residency",
      "type": "string"
    },
    "id": {
      "pattern": "^[a-z0-9](?:[a-z0-9_-]{0,62}[a-z0-9])?$",
      "title": "Id",
      "type": "string"
    },
    "name": {
      "maxLength": 200,
      "minLength": 1,
      "title": "Name",
      "type": "string"
    },
    "status": {
      "$ref": "#/$defs/TenantStatus",
      "default": "active"
    },
    "status_reason": {
      "anyOf": [
        {
          "maxLength": 500,
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Status Reason"
    },
    "trust_tier": {
      "$ref": "#/$defs/TrustTier"
    },
    "updated_at": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Updated At"
    }
  },
  "required": [
    "id",
    "name",
    "trust_tier",
    "created_at"
  ],
  "title": "Tenant",
  "type": "object",
  "x-mapi-contract-version": "0.2"
}
