{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/latitude-so/json-schema/latitude-so-member-list-schema.json",
  "title": "MemberList",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/latitude-so-members-api-openapi.yml#/components/schemas/MemberList",
  "type": "object",
  "properties": {
    "members": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Member"
      }
    }
  },
  "required": [
    "members"
  ],
  "$defs": {
    "ActiveMember": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "active"
          ],
          "description": "Discriminator for confirmed members — the user has accepted their invitation and joined the org."
        },
        "id": {
          "type": "string",
          "description": "Stable membership identifier. Use this to address the row in update/remove endpoints."
        },
        "organizationId": {
          "type": "string",
          "description": "Organization this membership belongs to."
        },
        "userId": {
          "type": "string",
          "description": "Identifier of the user the membership represents."
        },
        "role": {
          "type": "string",
          "enum": [
            "owner",
            "admin",
            "member"
          ],
          "description": "Member's role within the organization."
        },
        "name": {
          "type": [
            "string",
            "null"
          ],
          "description": "Display name of the user. `null` if the user hasn't completed onboarding."
        },
        "email": {
          "type": "string",
          "description": "User's email address, verified at signup."
        },
        "image": {
          "type": [
            "string",
            "null"
          ],
          "description": "User's profile image URL, when set."
        },
        "joinedAt": {
          "type": "string",
          "description": "ISO-8601 timestamp at which the user joined the organization."
        }
      },
      "required": [
        "status",
        "id",
        "organizationId",
        "userId",
        "role",
        "name",
        "email",
        "image",
        "joinedAt"
      ]
    },
    "InvitedMember": {
      "type": "object",
      "properties": {
        "status": {
          "type": "string",
          "enum": [
            "invited"
          ],
          "description": "Discriminator for pending invitations — the invitee hasn't accepted yet, so no user record exists."
        },
        "id": {
          "type": "string",
          "description": "Stable invitation identifier. Distinct from membership ids."
        },
        "organizationId": {
          "type": "string",
          "description": "Organization the invitation grants access to."
        },
        "userId": {
          "nullable": true,
          "description": "Always `null` — no user record exists until the invitation is accepted."
        },
        "role": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "owner",
            "admin",
            "member",
            null
          ],
          "description": "Role the invitee will get once they accept. `null` means the default (`member`)."
        },
        "name": {
          "nullable": true,
          "description": "Always `null` — no user record exists yet."
        },
        "email": {
          "type": "string",
          "description": "Email address the invitation was sent to."
        },
        "image": {
          "nullable": true,
          "description": "Always `null` — no user record exists yet."
        },
        "invitedAt": {
          "type": "string",
          "description": "ISO-8601 timestamp at which the invitation was created."
        },
        "expiresAt": {
          "type": "string",
          "description": "ISO-8601 timestamp at which the invitation expires."
        },
        "inviterId": {
          "type": "string",
          "description": "User id of the member who issued the invitation."
        }
      },
      "required": [
        "status",
        "id",
        "organizationId",
        "userId",
        "role",
        "name",
        "email",
        "image",
        "invitedAt",
        "expiresAt",
        "inviterId"
      ]
    },
    "Member": {
      "oneOf": [
        {
          "$ref": "#/$defs/ActiveMember"
        },
        {
          "$ref": "#/$defs/InvitedMember"
        }
      ]
    }
  }
}