Skip to main content
POST
/
api
/
v1
/
invites
/
bulk
Bulk Invite to Websites or Groups
curl --request POST \
  --url https://api.athenahq.ai/api/v1/invites/bulk \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "invite_method": "direct",
  "email": "user@example.com",
  "role": "viewer",
  "website_ids": [
    "123e4567-e89b-12d3-a456-426614174000",
    "987e6543-e21b-12d3-a456-426614174000"
  ],
  "group_ids": [
    "456e7890-e89b-12d3-a456-426614174000",
    "789e0123-e89b-12d3-a456-426614174000"
  ],
  "first_name": "John",
  "last_name": "Doe"
}
'
{
  "success": true,
  "results": [
    {
      "website_id": "123e4567-e89b-12d3-a456-426614174000",
      "success": true,
      "message": "User added to website",
      "user_id": "abc12345-e89b-12d3-a456-426614174000"
    },
    {
      "website_id": "987e6543-e21b-12d3-a456-426614174000",
      "success": false,
      "error": "User is already a member of this website"
    }
  ]
}

Documentation Index

Fetch the complete documentation index at: https://docs.athenahq.ai/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-api-key
string
header
required

API key for authentication. You can create one here.

Body

application/json

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.

invite_method
enum<string>
required

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.

Available options:
direct,
email
Example:

"direct"

email
string<email>
required

Email address of the user to invite

Example:

"user@example.com"

role
enum<string>
default:viewer

The role to assign to the invited user on each target

Available options:
admin,
viewer
Example:

"viewer"

website_ids
string<uuid>[]

Array of website IDs to invite the user to (1-50). Mutually exclusive with group_ids.

Required array length: 1 - 50 elements
Example:
[
"123e4567-e89b-12d3-a456-426614174000",
"987e6543-e21b-12d3-a456-426614174000"
]
group_ids
string<uuid>[]

Array of group IDs to invite the user to (1-50). Mutually exclusive with website_ids. Requires a global API key.

Required array length: 1 - 50 elements
Example:
[
"456e7890-e89b-12d3-a456-426614174000",
"789e0123-e89b-12d3-a456-426614174000"
]
first_name
string

Optional first name of the invited user. Used when creating a new user account for 'direct' invites or populating invite records for 'email' invites.

Example:

"John"

last_name
string

Optional last name of the invited user. Used when creating a new user account for 'direct' invites or populating invite records for 'email' invites.

Example:

"Doe"

Response

Bulk invite processed. Check individual results for per-target outcomes.

Response from a bulk invite request. Each target (website or group) is processed independently.

success
boolean
required

Whether the bulk operation was processed (always true if request was valid)

Example:

true

results
object[]
required

Per-target results (one entry per website or group in the request)