{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/anjal-app/json-schema/anjal-app-domain-schema.json",
  "title": "Domain",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/anjal-app-domains-api-openapi.yml#/components/schemas/Domain",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid"
    },
    "domain": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "verified",
        "failed"
      ]
    },
    "workspaceId": {
      "type": "string",
      "format": "uuid"
    },
    "dnsRecords": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DnsRecord"
      }
    },
    "sharedWith": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "google",
        "microsoft",
        "other",
        null
      ],
      "description": "Set when the domain's main mail stays at another provider (Google\nWorkspace, Microsoft 365 or other) and Anjal mailboxes live\nalongside it. Null for a domain whose MX points at Anjal.\n"
    },
    "routingSteps": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Present only for shared domains. Steps for the provider's admin\nconsole so it passes mail for addresses it doesn't know on to Anjal.\n"
    },
    "createdAt": {
      "type": "string",
      "format": "date-time"
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "DnsRecord": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "TXT",
            "CNAME",
            "MX",
            "A"
          ]
        },
        "name": {
          "type": "string"
        },
        "value": {
          "type": "string"
        },
        "priority": {
          "type": [
            "integer",
            "null"
          ]
        },
        "status": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "pending",
            "verified"
          ]
        },
        "note": {
          "type": [
            "string",
            "null"
          ],
          "description": "Extra instructions for this record. On a shared domain the SPF\nrecord is merged into your existing one, and the note says to\nreplace the existing record (a domain must have only one SPF record).\n"
        }
      }
    }
  }
}