Invite somebody, or give somebody more access
Needs permission user:write.
201 when an account was created for the address and an invitation emailed. 200 when the address already belongs to somebody in your account: the access you asked for is added, no second account is created and no email is sent — alreadyExisted and invitationEmailed in the response say which happened. 404 when any organisation named is not yours.
State the access as either organisationIds or allOrganisations: true, never both. allOrganisations grants account-wide access — every organisation the account owns, including ones added later — and only somebody who already holds it may grant it (403 whole_customer_access_denied otherwise). Every organisation named is checked against what you can reach, so nobody grants wider than they hold.
Guests (asGuest: true): somebody from another business, invited into the organisations you pick and nothing else. They never see your other organisations, your people or your settings; you see only the access you granted, and can take it back at any time. organisationIds is required and allOrganisations is refused for a guest. If they have no account, one is created for them in their own right — never a place in yours.
Sign-in follows your account’s set-up (GET /customer, signIn), for guests as for your own people. Where your account links people to an identity provider and passwords are not Allowed, the new person is linked instead of emailed: invitationEmailed is false, they open Flow Payroll from the provider, and there is no password to reset. signIn: Password asks for a password of their own, for somebody outside the provider such as a bureau; signIn: IdentityProviderAndPassword links them and also emails a password, for somebody who needs a direct login as well. 409 password_sign_in_denied for either where your account never issues passwords, and 409 identity_provider_not_configured for anything with the provider where it has none. roleId is the role they get wherever this invitation gives access (GET /roles); leave it out for your account’s default role. You may change your own access like anybody else’s, within what you hold. You need permission to manage people where you give the role (403 access_management_denied), and you can only give a role whose permissions you hold, unless it is your account’s default role (403 role_assignment_denied). Locking and unlocking pay runs, submitting to HMRC, getting payment files and approving pension contributions must always be held to be given. While only Administrator can be given out, any other role answers 400 role_not_yet_available. A role you leave out on access they did not have is your account’s default role (GET /customer/access-settings), and administrator while only Administrator can be given out. {principalId} may be the bare id or the full USER#… one. Every response lists the role at each place in roles. A guest linked to your provider signs in through it, so whoever runs that provider can sign in as them: invite a guest from another business, such as an accountant, with signIn: Password. Giving somebody more access never changes how they sign in.
externalId records your own identifier for them (the same value SCIM provisioning uses), for one of your own people or a guest alike: it is your account’s label, never seen by the guest’s own account. Setting it needs user:write across your whole account, not only in some organisations (403 insufficient_permissions, missingPermission: user:write), and, where your account gives roles, cannot be done for somebody who can do things you cannot (403 holder_outranks_you). It is unique among your people and guests (409 external_id_taken), and an invitation never changes the one somebody already has (409 external_id_already_set); repeating their own value changes nothing and needs nothing more. Each is refused before anybody is invited.
An account may hold 500 people. Only a new account of your own uses one of those places, so an invitation that turns out to be an access change works at the limit, and an account already past the limit keeps everyone it has. Three things answer 409, told apart by message.token:
user_limit_reached— the account already holds 500 people. The account owner can remove somebody who no longer needs access withDELETE /users/{principalId}, or contact support to raise the allowance.email_already_in_use— that address already signs in to a different account, so it cannot be invited here — unless you invite them as a guest.account_needs_repair— that address has an older account that support must repair before it can be given access.
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/administration/users \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"email": "<string>",
"givenName": "<string>",
"familyName": "<string>",
"organisationIds": [
"<string>"
],
"allOrganisations": true,
"asGuest": true,
"signIn": "<string>",
"access": [
{
"scope": {
"id": "<string>"
},
"roleId": "<string>"
}
],
"externalId": "emp-00417"
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/administration/users"
payload = {
"email": "<string>",
"givenName": "<string>",
"familyName": "<string>",
"organisationIds": ["<string>"],
"allOrganisations": True,
"asGuest": True,
"signIn": "<string>",
"access": [
{
"scope": { "id": "<string>" },
"roleId": "<string>"
}
],
"externalId": "emp-00417"
}
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({
email: '<string>',
givenName: '<string>',
familyName: '<string>',
organisationIds: ['<string>'],
allOrganisations: true,
asGuest: true,
signIn: '<string>',
access: [{scope: {id: '<string>'}, roleId: '<string>'}],
externalId: 'emp-00417'
})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/administration/users', 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",
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([
'email' => '<string>',
'givenName' => '<string>',
'familyName' => '<string>',
'organisationIds' => [
'<string>'
],
'allOrganisations' => true,
'asGuest' => true,
'signIn' => '<string>',
'access' => [
[
'scope' => [
'id' => '<string>'
],
'roleId' => '<string>'
]
],
'externalId' => 'emp-00417'
]),
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"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true,\n \"asGuest\": true,\n \"signIn\": \"<string>\",\n \"access\": [\n {\n \"scope\": {\n \"id\": \"<string>\"\n },\n \"roleId\": \"<string>\"\n }\n ],\n \"externalId\": \"emp-00417\"\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")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true,\n \"asGuest\": true,\n \"signIn\": \"<string>\",\n \"access\": [\n {\n \"scope\": {\n \"id\": \"<string>\"\n },\n \"roleId\": \"<string>\"\n }\n ],\n \"externalId\": \"emp-00417\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/administration/users")
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 \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true,\n \"asGuest\": true,\n \"signIn\": \"<string>\",\n \"access\": [\n {\n \"scope\": {\n \"id\": \"<string>\"\n },\n \"roleId\": \"<string>\"\n }\n ],\n \"externalId\": \"emp-00417\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": {
"principalId": "<string>",
"alreadyExisted": true,
"grantedOrganisationIds": [
"<string>"
],
"alreadyHeldOrganisationIds": [
"<string>"
],
"coversWholeCustomer": true,
"invitationEmailed": true,
"roleId": "<string>",
"access": [
{
"scope": {
"type": "Organisation",
"id": "<string>"
},
"roleId": "<string>"
}
],
"signsInElsewhere": true
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": {
"principalId": "<string>",
"alreadyExisted": true,
"grantedOrganisationIds": [
"<string>"
],
"alreadyHeldOrganisationIds": [
"<string>"
],
"coversWholeCustomer": true,
"invitationEmailed": true,
"roleId": "<string>",
"access": [
{
"scope": {
"type": "Organisation",
"id": "<string>"
},
"roleId": "<string>"
}
],
"signsInElsewhere": true
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": "<unknown>",
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": "<unknown>",
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": "<unknown>",
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": "<unknown>",
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": "<unknown>",
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}Body
Invites somebody into your account, or gives more access to somebody already in it.
Deprecated: use access. Deprecated: use access with an Account entry. Give access to every organisation the account owns,
including ones added later. Only somebody who already holds account-wide access may grant it. State exactly one of
this and organisationIds; a request giving both is refused rather than merged.
The person belongs to another business. They are invited into the organisations you pick, never
into the account: they cannot see your other organisations, your people or your settings, and
you can take the access back at any time. Give them organisations only: an Account or
OrganisationGroup entry (or AllOrganisations) is refused for guests.
How they sign in. IdentityProvider links them to your account's identity provider;
Password gives them a password of their own, for somebody outside your identity provider
such as a bureau; IdentityProviderAndPassword does both, for somebody who signs in through
the provider day to day and also needs a direct login. Leave it out to use your account's default.
Anything with a password is refused when your account signs people in through its identity
provider only, and anything with the provider when it has none.
Was this page helpful?
curl --request POST \
--url https://api.sandbox.flowpayroll.ai/v1/administration/users \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"email": "<string>",
"givenName": "<string>",
"familyName": "<string>",
"organisationIds": [
"<string>"
],
"allOrganisations": true,
"asGuest": true,
"signIn": "<string>",
"access": [
{
"scope": {
"id": "<string>"
},
"roleId": "<string>"
}
],
"externalId": "emp-00417"
}
'import requests
url = "https://api.sandbox.flowpayroll.ai/v1/administration/users"
payload = {
"email": "<string>",
"givenName": "<string>",
"familyName": "<string>",
"organisationIds": ["<string>"],
"allOrganisations": True,
"asGuest": True,
"signIn": "<string>",
"access": [
{
"scope": { "id": "<string>" },
"roleId": "<string>"
}
],
"externalId": "emp-00417"
}
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({
email: '<string>',
givenName: '<string>',
familyName: '<string>',
organisationIds: ['<string>'],
allOrganisations: true,
asGuest: true,
signIn: '<string>',
access: [{scope: {id: '<string>'}, roleId: '<string>'}],
externalId: 'emp-00417'
})
};
fetch('https://api.sandbox.flowpayroll.ai/v1/administration/users', 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",
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([
'email' => '<string>',
'givenName' => '<string>',
'familyName' => '<string>',
'organisationIds' => [
'<string>'
],
'allOrganisations' => true,
'asGuest' => true,
'signIn' => '<string>',
'access' => [
[
'scope' => [
'id' => '<string>'
],
'roleId' => '<string>'
]
],
'externalId' => 'emp-00417'
]),
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"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true,\n \"asGuest\": true,\n \"signIn\": \"<string>\",\n \"access\": [\n {\n \"scope\": {\n \"id\": \"<string>\"\n },\n \"roleId\": \"<string>\"\n }\n ],\n \"externalId\": \"emp-00417\"\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")
.header("X-Auth-Token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true,\n \"asGuest\": true,\n \"signIn\": \"<string>\",\n \"access\": [\n {\n \"scope\": {\n \"id\": \"<string>\"\n },\n \"roleId\": \"<string>\"\n }\n ],\n \"externalId\": \"emp-00417\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.flowpayroll.ai/v1/administration/users")
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 \"email\": \"<string>\",\n \"givenName\": \"<string>\",\n \"familyName\": \"<string>\",\n \"organisationIds\": [\n \"<string>\"\n ],\n \"allOrganisations\": true,\n \"asGuest\": true,\n \"signIn\": \"<string>\",\n \"access\": [\n {\n \"scope\": {\n \"id\": \"<string>\"\n },\n \"roleId\": \"<string>\"\n }\n ],\n \"externalId\": \"emp-00417\"\n}"
response = http.request(request)
puts response.read_body{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": {
"principalId": "<string>",
"alreadyExisted": true,
"grantedOrganisationIds": [
"<string>"
],
"alreadyHeldOrganisationIds": [
"<string>"
],
"coversWholeCustomer": true,
"invitationEmailed": true,
"roleId": "<string>",
"access": [
{
"scope": {
"type": "Organisation",
"id": "<string>"
},
"roleId": "<string>"
}
],
"signsInElsewhere": true
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": {
"principalId": "<string>",
"alreadyExisted": true,
"grantedOrganisationIds": [
"<string>"
],
"alreadyHeldOrganisationIds": [
"<string>"
],
"coversWholeCustomer": true,
"invitationEmailed": true,
"roleId": "<string>",
"access": [
{
"scope": {
"type": "Organisation",
"id": "<string>"
},
"roleId": "<string>"
}
],
"signsInElsewhere": true
},
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": "<unknown>",
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": "<unknown>",
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": "<unknown>",
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": "<unknown>",
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}{
"message": {
"text": "<string>",
"token": "<string>",
"tokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
},
"content": {
"data": "<unknown>",
"metadata": {
"dateFormat": "<string>",
"dateTimeFormat": "<string>",
"paginationToken": "<string>"
}
},
"validationIssues": [
{
"field": "<string>",
"reason": "<string>",
"reasonToken": "<string>",
"reasonTokenArguments": [
{
"name": "<string>",
"value": "<unknown>"
}
]
}
]
}