{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/classquill-com/json-schema/classquill-com-bulk-invite-request-schema.json",
  "title": "BulkInviteRequest",
  "description": "POST /v1/users/bulk-invite — create/invite 1–100 users (students, tutors, and/or\nparents) in one call. Each row is provisioned independently: one row's failure never\nrolls back the others (see the per-row `results`).",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/classquill-com-students-parents-api-openapi.yml#/components/schemas/BulkInviteRequest",
  "properties": {
    "users": {
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/BulkInviteStudent"
          },
          {
            "$ref": "#/$defs/BulkInviteTutor"
          },
          {
            "$ref": "#/$defs/BulkInviteParent"
          }
        ]
      },
      "type": "array",
      "maxItems": 100,
      "minItems": 1,
      "title": "Users"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "users"
  ],
  "$defs": {
    "BulkInviteParent": {
      "properties": {
        "type": {
          "type": "string",
          "const": "parent",
          "title": "Type"
        },
        "first_name": {
          "type": "string",
          "title": "First Name"
        },
        "last_name": {
          "type": "string",
          "title": "Last Name"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Email"
        },
        "send_invite": {
          "type": "boolean",
          "title": "Send Invite",
          "default": true
        },
        "phone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Phone"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "type",
        "first_name",
        "last_name"
      ],
      "title": "BulkInviteParent",
      "description": "A standalone parent row in POST /v1/users/bulk-invite. Mirrors POST /v1/parents.\n\n`send_invite` is accepted for shape-parity but a STANDALONE parent is created without an\norg link, so it is never auto-invited here (the org-scoped invite requires a student link);\nlink them to a student, then call POST /v1/parents/{id}/send-invite."
    },
    "BulkInviteStudent": {
      "properties": {
        "type": {
          "type": "string",
          "const": "student",
          "title": "Type"
        },
        "first_name": {
          "type": "string",
          "title": "First Name"
        },
        "last_name": {
          "type": "string",
          "title": "Last Name"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Email"
        },
        "send_invite": {
          "type": "boolean",
          "title": "Send Invite",
          "default": true
        },
        "phone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Phone"
        },
        "parent": {
          "anyOf": [
            {
              "$ref": "#/$defs/ParentInline"
            },
            {
              "type": "null"
            }
          ]
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "type",
        "first_name",
        "last_name"
      ],
      "title": "BulkInviteStudent",
      "description": "A student row in POST /v1/users/bulk-invite (optionally with a parent created +\nlinked atomically). Mirrors POST /v1/students."
    },
    "BulkInviteTutor": {
      "properties": {
        "type": {
          "type": "string",
          "const": "tutor",
          "title": "Type"
        },
        "first_name": {
          "type": "string",
          "title": "First Name"
        },
        "last_name": {
          "type": "string",
          "title": "Last Name"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Email"
        },
        "send_invite": {
          "type": "boolean",
          "title": "Send Invite",
          "default": true
        },
        "phone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Phone"
        },
        "bio": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Bio"
        },
        "teaching_mode": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Teaching Mode",
          "description": "online | in_person | both"
        },
        "is_published": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Is Published"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "type",
        "first_name",
        "last_name"
      ],
      "title": "BulkInviteTutor",
      "description": "A tutor (staff) row in POST /v1/users/bulk-invite. Mirrors POST /v1/tutors."
    },
    "ParentInline": {
      "properties": {
        "first_name": {
          "type": "string",
          "title": "First Name"
        },
        "last_name": {
          "type": "string",
          "title": "Last Name"
        },
        "email": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Email"
        },
        "phone": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Phone"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "first_name",
        "last_name"
      ],
      "title": "ParentInline",
      "description": "A parent created alongside a student in POST /v1/students. `email` is optional\n(omit → no-email placeholder parent account)."
    }
  }
}