Replace the organisations an API token reaches

Needs permission api-token:write.

Declarative: afterwards the token holds a direct grant on exactly the organisations listed, and the difference from its current grants is worked out here. roleId gives it that role on every organisation listed; leave it out to keep its roles, and new organisations get your account's default role. Giving a token a role needs a caller who manages API tokens where it applies (403 access_management_denied otherwise; a person or an API token alike), and the role's permissions must be ones you hold (403 role_assignment_denied). A role for people only answers 400 role_not_assignable, and while only Administrator can be given out any other role answers 400 role_not_yet_available. A role you leave out on access it did not have is your account's default role (GET /customer/access-settings), and administrator while only Administrator can be given out; when that default role is for people only, the token is refused with 400 role_not_assignable and you name its role. Every response lists the token's role at each place in roles. An empty list is refused with 400 — revoke the token instead, so ending an integration is always an explicit act. 404 when any organisation named is not yours.

Prefer the per-organisation routes for a single change: two administrators replacing the set at once have one overwrite the other, and for a credential the overwritten edit is an integration that stops working with nothing to say why. PUT and DELETE /api-tokens/{clientId}/organisations/{organisationId} cannot lose a concurrent edit.

Account-wide access is not affected by this operation. The response is the same body every other operation on this resource returns, with coversWholeCustomer read live.

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

Replaces which organisations the token reaches through direct grants. An empty list is refused:
revoke the token instead.

organisationIds
array of strings | null

The complete set of organisations the token reaches 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. An API token whose account's default role is for people only must name one.

Responses

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