Invite several people at once
State the access once in defaults; any entry may override it. Leave a field out of an entry to inherit the default, or set it to override. An entry that names organisations replaces the default set for that person rather than adding to it, and allOrganisations: false on an entry opts that person out of a default of true.
Each person is invited exactly as POST /users would invite them, so nothing about the authorisation differs. 201 when every entry went through, 207 when some did, 400 when none did. In all three the body lists what happened to each entry, and a failed entry carries the same reason token the single endpoint would have answered with in message.token. Partial success is normal and is not rolled back: invitations already sent stay sent.
The account’s limit of 500 people is counted once for the whole batch. A batch carrying more new people than there is room for fills the remaining places and answers user_limit_reached on the rest; entries that turn out to be access changes for people already in the account use no place at all.
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"defaults": {
"organisationIds": [
"<string>"
],
"allOrganisations": true
},
"entries": [
{
"email": "<string>",
"givenName": "<string>",
"familyName": "<string>",
"organisationIds": [
"<string>"
],
"allOrganisations": true
}
]
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk"
payload = {
"defaults": {
"organisationIds": ["<string>"],
"allOrganisations": True
},
"entries": [
{
"email": "<string>",
"givenName": "<string>",
"familyName": "<string>",
"organisationIds": ["<string>"],
"allOrganisations": True
}
]
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
defaults: {organisationIds: ['<string>'], allOrganisations: true},
entries: [
{
email: '<string>',
givenName: '<string>',
familyName: '<string>',
organisationIds: ['<string>'],
allOrganisations: true
}
]
})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'defaults' => [
'organisationIds' => [
'<string>'
],
'allOrganisations' => true
],
'entries' => [
[
'email' => '<string>',
'givenName' => '<string>',
'familyName' => '<string>',
'organisationIds' => [
'<string>'
],
'allOrganisations' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk"
payload := strings.NewReader("{\n \"defaults\": {\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n },\n \"entries\": [\n {\n \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"defaults\": {\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n },\n \"entries\": [\n {\n \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"defaults\": {\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n },\n \"entries\": [\n {\n \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": {
"invited": [
{
"principalId": "<string>",
"alreadyExisted": true,
"grantedOrganisationIds": [
"<string>"
],
"alreadyHeldOrganisationIds": [
"<string>"
],
"coversWholeCustomer": true,
"invitationEmailed": true
}
],
"failed": [
{
"reference": "<string>",
"reason": "<string>",
"message": "<string>"
}
]
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": {
"invited": [
{
"principalId": "<string>",
"alreadyExisted": true,
"grantedOrganisationIds": [
"<string>"
],
"alreadyHeldOrganisationIds": [
"<string>"
],
"coversWholeCustomer": true,
"invitationEmailed": true
}
],
"failed": [
{
"reference": "<string>",
"reason": "<string>",
"message": "<string>"
}
]
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": {
"invited": [
{
"principalId": "<string>",
"alreadyExisted": true,
"grantedOrganisationIds": [
"<string>"
],
"alreadyHeldOrganisationIds": [
"<string>"
],
"coversWholeCustomer": true,
"invitationEmailed": true
}
],
"failed": [
{
"reference": "<string>",
"reason": "<string>",
"message": "<string>"
}
]
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}Authorizations
FlowPayroll JWT (raw token, no Bearer prefix)
Body
Invites several people in one request: shared defaults plus per-entry overrides.
Was this page helpful?
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"defaults": {
"organisationIds": [
"<string>"
],
"allOrganisations": true
},
"entries": [
{
"email": "<string>",
"givenName": "<string>",
"familyName": "<string>",
"organisationIds": [
"<string>"
],
"allOrganisations": true
}
]
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk"
payload = {
"defaults": {
"organisationIds": ["<string>"],
"allOrganisations": True
},
"entries": [
{
"email": "<string>",
"givenName": "<string>",
"familyName": "<string>",
"organisationIds": ["<string>"],
"allOrganisations": True
}
]
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
defaults: {organisationIds: ['<string>'], allOrganisations: true},
entries: [
{
email: '<string>',
givenName: '<string>',
familyName: '<string>',
organisationIds: ['<string>'],
allOrganisations: true
}
]
})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'defaults' => [
'organisationIds' => [
'<string>'
],
'allOrganisations' => true
],
'entries' => [
[
'email' => '<string>',
'givenName' => '<string>',
'familyName' => '<string>',
'organisationIds' => [
'<string>'
],
'allOrganisations' => true
]
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Auth-Token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk"
payload := strings.NewReader("{\n \"defaults\": {\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n },\n \"entries\": [\n {\n \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Auth-Token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"defaults\": {\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n },\n \"entries\": [\n {\n \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/administration/users/bulk")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Auth-Token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"defaults\": {\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n },\n \"entries\": [\n {\n \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": {
"invited": [
{
"principalId": "<string>",
"alreadyExisted": true,
"grantedOrganisationIds": [
"<string>"
],
"alreadyHeldOrganisationIds": [
"<string>"
],
"coversWholeCustomer": true,
"invitationEmailed": true
}
],
"failed": [
{
"reference": "<string>",
"reason": "<string>",
"message": "<string>"
}
]
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": {
"invited": [
{
"principalId": "<string>",
"alreadyExisted": true,
"grantedOrganisationIds": [
"<string>"
],
"alreadyHeldOrganisationIds": [
"<string>"
],
"coversWholeCustomer": true,
"invitationEmailed": true
}
],
"failed": [
{
"reference": "<string>",
"reason": "<string>",
"message": "<string>"
}
]
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": {
"invited": [
{
"principalId": "<string>",
"alreadyExisted": true,
"grantedOrganisationIds": [
"<string>"
],
"alreadyHeldOrganisationIds": [
"<string>"
],
"coversWholeCustomer": true,
"invitationEmailed": true
}
],
"failed": [
{
"reference": "<string>",
"reason": "<string>",
"message": "<string>"
}
]
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": null
}
]
},
"content": {
"data": null,
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": null
}
]
}
]
}