{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/customdomain-ai/json-schema/customdomain-ai-invite-preview-schema.json",
  "title": "InvitePreview",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/customdomain-ai-members-api-openapi.yml#/components/schemas/InvitePreview",
  "type": "object",
  "required": [
    "status",
    "email",
    "role",
    "tenant_id",
    "workspace_name"
  ],
  "properties": {
    "status": {
      "type": "string",
      "enum": [
        "pending",
        "accepted",
        "expired",
        "revoked",
        "replaced"
      ],
      "description": "`pending`: the link works. `accepted`: it was used. `expired`: it lapsed. `revoked`: an admin withdrew the invite. `replaced`: a newer invite was sent to the same address."
    },
    "email": {
      "type": "string",
      "description": "The invited address."
    },
    "role": {
      "$ref": "#/$defs/Role"
    },
    "tenant_id": {
      "type": "string"
    },
    "workspace_name": {
      "type": "string",
      "description": "The tenant's display name."
    },
    "inviter_name": {
      "type": "string"
    },
    "inviter_email": {
      "type": "string"
    },
    "invited_at": {
      "type": "string",
      "format": "date-time"
    },
    "expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the link stops (or stopped) working. Absent when it never expires."
    }
  },
  "$defs": {
    "Role": {
      "type": "string",
      "enum": [
        "owner",
        "admin",
        "member",
        "viewer"
      ]
    }
  }
}