{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/athenahq-ai/json-schema/athenahq-ai-bulk-invite-request-schema.json",
  "title": "BulkInviteRequest",
  "description": "Request body for inviting a user to multiple websites or multiple groups. Provide exactly one of `website_ids` or `group_ids` — the two are mutually exclusive. A single consolidated invitation email is sent in 'email' mode.",
  "x-generated": "2026-11-01",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/athenahq-ai-openapi.json#/components/schemas/BulkInviteRequest",
  "type": "object",
  "required": [
    "invite_method",
    "email"
  ],
  "properties": {
    "invite_method": {
      "type": "string",
      "enum": [
        "direct",
        "email"
      ],
      "description": "How to invite the user. 'direct' adds the user to each target immediately without sending any email — if no account exists for the email, a new user account is created automatically (with emailVerified=false). 'email' creates pending invite records and sends a single consolidated invitation email."
    },
    "email": {
      "type": "string",
      "format": "email",
      "description": "Email address of the user to invite"
    },
    "role": {
      "type": "string",
      "enum": [
        "admin",
        "viewer"
      ],
      "description": "The role to assign to the invited user on each target. Mutually exclusive with `role_id`."
    },
    "role_id": {
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$",
      "description": "Assign any role by ID — a system role or one of your organization's custom roles (see `GET /api/v1/roles`). Mutually exclusive with `role`. Returns 404 if the role does not exist or belongs to another organization. Defaults to Viewer when neither `role` nor `role_id` is given. System role IDs are GUID-shaped sentinels (e.g. `00000000-0000-0000-0000-000000000001`), not RFC 4122 UUIDs."
    },
    "website_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "minItems": 1,
      "maxItems": 50,
      "description": "Array of website IDs to invite the user to (1-50). Mutually exclusive with `group_ids`."
    },
    "group_ids": {
      "type": "array",
      "items": {
        "type": "string",
        "format": "uuid"
      },
      "minItems": 1,
      "maxItems": 50,
      "description": "Array of group IDs to invite the user to (1-50). Mutually exclusive with `website_ids`. Requires a global API key."
    },
    "first_name": {
      "type": "string",
      "description": "Optional first name of the invited user. Used when creating a new user account for 'direct' invites or populating invite records for 'email' invites."
    },
    "last_name": {
      "type": "string",
      "description": "Optional last name of the invited user. Used when creating a new user account for 'direct' invites or populating invite records for 'email' invites."
    }
  }
}