Replace a person's direct grants

Needs permission user:write.

Declarative: afterwards they hold a direct grant on exactly the organisations listed, and the difference from their current grants is worked out here. roleId gives them that role on every organisation listed; leave it out to keep their roles, and new organisations give them 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. Every organisation being added is checked against what you can reach, so nobody grants wider than they hold. 404 when any organisation named is not yours; 400 user_access_would_be_empty when the result would leave them reaching nothing; 409 cannot_remove_own_last_access when it would remove your own last access.

This does not describe account-wide access. Somebody holding it reaches every organisation whatever this list says, and sending an empty list does not remove it — read coversWholeCustomer in the response. To change one organisation without restating the rest, use PUT or DELETE /users/{principalId}/organisations/{organisationId}, which are also safe when two administrators edit at once.

For a guest, an empty list takes back everything you granted — that is how guest access ends, and their own account elsewhere is untouched. 403 owner_access_protected when it would take access from the account owner: only the owner narrows their own access.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
Body Params

Replaces the whole set of organisations a person holds a direct grant on. Does not affect
account-wide access.

organisationIds
array of strings | null

The complete set of organisations they hold a direct grant on afterwards.

organisationIds
string | null

The role to give, such as payroll-manager or one of your own (custom.hr-team); see GET /roles.
Leave it out to give your account's default role (GET /customer/access-settings); while your account cannot
give roles yet, that is administrator.

Responses

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json