{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mentio-dev/json-schema/mentio-dev-invitation-schema.json",
  "title": "Invitation",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mentio-dev-members-api-openapi.yml#/components/schemas/Invitation",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Invitation id (inv_...)."
    },
    "email": {
      "type": "string",
      "description": "The invited address, lowercased."
    },
    "role": {
      "type": "string",
      "enum": [
        "owner",
        "admin",
        "member"
      ],
      "description": "The role they join with."
    },
    "invitedBy": {
      "type": [
        "object",
        "null"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "name": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "id",
        "email",
        "name"
      ],
      "description": "Who sent it; an API key invites on behalf of the oldest owner."
    },
    "expiresAt": {
      "type": "string",
      "description": "Invitations last 48 hours; an expired one is no longer listed."
    },
    "createdAt": {
      "type": "string",
      "description": "When the invitation was sent."
    }
  },
  "required": [
    "id",
    "email",
    "role",
    "invitedBy",
    "expiresAt",
    "createdAt"
  ]
}