Create invitations for many accounts and send them
LogsPOST /account-invitations/bulk
Create invitations for many accounts and send them; per-item results (a delivery failure appears as the item's error)
Issues one invitation code per item, each for the account named by its account_id and sent to exactly one phone or e-mail, with holder permissions unless others are given. Between 1 and 500 items are accepted; each item gets its own result with either the invitation or an error (unknown account, invalid recipient, no delivery channel, or delivery failure), so one bad item does not fail the batch. Invitations that could not be delivered within the request are revoked and reported as errors. Requires the business:accounts:invitations:create permission.
Body application/json
invitationsShow child attributes
phoneemailpermissionsexpires_in_hoursDefault 168, maximum 720
account_idRequired in bulk requests
Returns
201 Per-account results
Permissions business:accounts:invitations:create · Roles: admin, customer_service, owner
curl -X POST "$BUSINESS_API/account-invitations/bulk" \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"invitations": [
{
"phone": "+258841234567",
"email": "ana.matsinhe@example.org",
"permissions": [
"permission"
],
"expires_in_hours": 1,
"account_id": "act_2JFioNDgIfvkgflk8RtcqhBaARP"
}
]
}'
# No matching CLI command; use cURL or direct HTTP.
const res = await fetch("$BUSINESS_API/account-invitations/bulk", {
method: "POST",
headers: {
Authorization: "Bearer sk_test_...",
"Content-Type": "application/json"
},
body: JSON.stringify({
"invitations": [
{
"phone": "+258841234567",
"email": "ana.matsinhe@example.org",
"permissions": [
"permission"
],
"expires_in_hours": 1,
"account_id": "act_2JFioNDgIfvkgflk8RtcqhBaARP"
}
]
})
});
const data = await res.json();
import requests
res = requests.post(
"$BUSINESS_API/account-invitations/bulk",
headers={
"Authorization": "Bearer sk_test_..."
},
json={
"invitations": [
{
"phone": "+258841234567",
"email": "ana.matsinhe@example.org",
"permissions": [
"permission"
],
"expires_in_hours": 1,
"account_id": "act_2JFioNDgIfvkgflk8RtcqhBaARP"
}
]
}
)
data = res.json()
body := strings.NewReader(`{
"invitations": [
{
"phone": "+258841234567",
"email": "ana.matsinhe@example.org",
"permissions": [
"permission"
],
"expires_in_hours": 1,
"account_id": "act_2JFioNDgIfvkgflk8RtcqhBaARP"
}
]
}`)
req, _ := http.NewRequest("POST", "$BUSINESS_API/account-invitations/bulk", body)
req.Header.Set("Authorization", "Bearer sk_test_...")
req.Header.Set("Content-Type", "application/json")
resp, err := http.DefaultClient.Do(req)
Per-account results