{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/customdomain-ai/json-schema/customdomain-ai-member-schema.json",
  "title": "Member",
  "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/Member",
  "type": "object",
  "required": [
    "id",
    "tenant_id",
    "email",
    "role",
    "status",
    "created_at"
  ],
  "properties": {
    "id": {
      "type": "string"
    },
    "tenant_id": {
      "type": "string"
    },
    "email": {
      "type": "string"
    },
    "role": {
      "$ref": "#/$defs/Role"
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "pending",
        "expired"
      ],
      "description": "`active` once accepted, `pending` while the invite link works, `expired` once it has lapsed."
    },
    "invited_by": {
      "type": "string",
      "description": "The accepting user's id in the calling application, when one was supplied at accept."
    },
    "inviter_email": {
      "type": "string",
      "description": "Who sent (or last re-sent) the invite, resolved from the sending credential."
    },
    "inviter_name": {
      "type": "string",
      "description": "The sender's display name, when one was supplied."
    },
    "invite_sent_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the current invite link was issued."
    },
    "invite_expires_at": {
      "type": "string",
      "format": "date-time",
      "description": "When the current invite link stops working. Absent for members never invited by link."
    },
    "invite_token": {
      "type": "string",
      "description": "The single-use invite token. Present only in the invite, resend and get-invite responses, never in the roster."
    },
    "accepted_at": {
      "type": "string",
      "format": "date-time"
    },
    "created_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "$defs": {
    "Role": {
      "type": "string",
      "enum": [
        "owner",
        "admin",
        "member",
        "viewer"
      ]
    }
  }
}