{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/frihet-io/json-schema/frihet-io-team-member-schema.json",
  "title": "TeamMember",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/frihet-io-team-api-openapi.yml#/components/schemas/TeamMember",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Member or invitation document ID"
    },
    "email": {
      "type": "string",
      "format": "email"
    },
    "name": {
      "type": [
        "string",
        "null"
      ]
    },
    "role": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "owner",
        "admin",
        "viewer",
        "editor",
        "accountant"
      ],
      "description": "Null only on an invitation row whose persisted role is not an assignable team role. Such a row is always reported with `status: invalid`; the API will not invent a valid role for it. Revoke the row via DELETE /v1/team/members/{memberId} to release the seat it holds."
    },
    "status": {
      "type": "string",
      "enum": [
        "active",
        "pending",
        "expired",
        "invalid"
      ],
      "description": "Effective state computed at read time, not merely the persisted field. `expired` is only reported when expiry is PROVEN and the row holds no seat; `invalid` means validity could not be proven and the row conservatively still holds its seat."
    },
    "joinedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Set for active members"
    },
    "invitedAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Set for pending invitations"
    },
    "expiresAt": {
      "type": [
        "string",
        "null"
      ],
      "format": "date-time",
      "description": "Invite expiry (pending only)"
    }
  }
}