Skip to main content
The Administration API is where you manage the account itself rather than the payroll inside it. Add organisations one at a time or in bulk, group them into organisation groups, invite people and decide which organisations they reach and with which role, see who can reach an organisation, create and rotate the API tokens your integrations authenticate with, and read back a feed of who changed what. Everything is scoped to the account your credentials belong to, the same account the Flow Payroll administration screens show. All endpoints sit under the /v1/administration base path, relative to the environment base URLs documented on the API reference introduction.
Unlike the payroll APIs, this API is not scoped to one organisation. The account comes from your credentials, and where an organisation is involved it comes from the path. The X-Org-Id header is not needed here. If you send it out of habit it is ignored, never rejected.

Users, roles and permissions

The built-in roles, roles of your own, the default role, and the permission each operation needs.

Permission errors

insufficient_permissions, field_not_writable and access_check_unavailable.

Provisioning users with SCIM 2.0

Let your identity provider add, update, suspend and remove your people.

Key concepts

  • Account (Customer): the tenant that owns your organisations, people and API tokens. The API calls it a customer in resource and field names (/customer, coversWholeCustomer); you never pass its id. GET /customer tells you which account your credentials belong to.
  • Organisation: an employer you run payroll for. Every other Flow Payroll API scopes requests to one organisation with X-Org-Id; this API is where organisations are created and where access to them is granted.
  • Person (user): somebody who can sign in to the account. Addressed by principalId.
  • API token: a client credential (client_id / client_secret) your integrations exchange for access tokens. Addressed by clientId.
  • Direct grant: access to one named organisation. A person or token can hold any number of them.
  • Organisation group: a named set of your account’s organisations, such as the clients one team looks after. A person or token given a group reaches every organisation in it, including ones added later. Addressed by groupId.
  • Role: what somebody can do where they have access, named by roleId. It is a built-in role such as administrator, or one of your own such as custom.hr-team. Every grant carries one, and roles on a person or token lists the role at each place they have access.
  • Account-wide access: access to every organisation the account owns, including ones added later. It names no organisation, so somebody who holds it typically has an empty organisationIds list. Reported as coversWholeCustomer on people and tokens alike.
  • Owner: the one person in the account whose access cannot be revoked from inside it. Only the owner can remove people or transfer ownership. GET /customer names them in owner.
  • Guest: somebody from another business invited into specific organisations of yours, or an organisation of another business that you were invited into. Rows carry an accessType of Customer or Guest. A guest sees only what was granted, and neither account manages the other’s people, with one exception: a guest who signs in through your identity provider is your person, so the account Flow Payroll creates for them is managed by yours (see Account). POST /users/{principalId}/release stops managing one: they keep the access they hold and become an independent guest, and if they signed in through your identity provider they are emailed a password reset and your provider can no longer sign them in. Nothing about their organisations moves.

Three ways in

Every person and every API token reaches an organisation in one or more of three ways, each with its own role:
Read coversWholeCustomer before treating an empty organisationIds as no access. An administrator who runs the whole account usually holds no grant on any single organisation.
Nobody can grant wider than they hold. Granting an organisation you cannot reach answers 404, because that organisation is not visible to you; granting account-wide access without holding it answers 403 with whole_customer_access_denied.

API structure

Account

GET /customer returns the account your credentials belong to: its id, display name and owner. origin says how it came to exist (type: GuestInvitation and invitedBy when a guest invitation created it), and managedBy names the account that manages it. Both are absent for an account Flow Payroll set up. A managed account changes nothing of its own: inviting people, roles, organisation groups, API tokens, organisations and account settings answer 403 with account_managed_by_another_account, and the managing account decides what its person reaches. It is never billed. Its person can still change their own profile photo and the company logo of an organisation they reach. PATCH /customer renames it. There is exactly one, so neither takes a parameter. PUT /customer/owner transfers ownership to another of the account’s people, and only the current owner may call it.

Organisations

GET /organisations lists every organisation the account owns or manages, followed by any you reach as a guest of another business. accessType on each row says which, and the accessType query parameter filters to one kind. It is paginated with pageSize (default 50, at most 100) and paginationToken; one page holds one kind, so follow the token to see both. search matches the start of a name. Each row carries headcounts and callerAccess.granted, which says whether you can act on that organisation. The list deliberately includes organisations you cannot reach, so you know they exist. GET /organisations/{organisationId} returns one in full, including its company registration number and PAYE reference. To narrow your own organisations, filter by organisationType and businessType (repeat the parameter, or separate values with commas) and by minEmployees / maxEmployees, which count employees who have not left today. These filters apply only to organisations your account owns, so combining them with groupId, relationship=managed or accessType=Guest answers 400 conflicting_filters. Each row, and the single organisation, carries profile: the PAYE and accounts office references, the registered office, the primary contact, the last completed and next open pay run, and payrollConfigs, the organisation’s pay schedules with their name and pay frequency. profile is left out when it cannot be read at that moment, and the rest of the row is unaffected. GET /organisations/summary adds up the organisations the list shows, once each: how many, their employees, and payroll over from to to (this month by default). Send accessType=Customer for your account’s own organisations only, or Guest for those you reach as a guest. Payroll covers only the organisations where you can see pay runs (pay-run:read), and payroll.organisationCount says how many that is, which may be fewer than the organisations you can see. POST /organisations adds one; POST /organisations/bulk adds several with shared defaults and per-entry overrides. Send an Idempotency-Key header on both so a retry after a lost response cannot create anything twice. Your account’s organisations come in two kinds, marked by relationship: Owned, and Managed for one your account manages on its owner’s behalf, such as a bureau’s client. managedBy and managedFor name the other account, and groups lists your organisation groups the organisation is in. On an organisation another account manages, payer says who it is billed to: Owner, or ManagingAccount when the managing account pays for it, as your contract with Flow Payroll sets out. It is decided per organisation, so one account can pay for some of its organisations while its bureau pays for others. GET /organisations/{organisationId}/access lists everybody who can reach an organisation, one row for each way in: Direct, Group or Account, each with the role it gives. Somebody with two ways in has two rows. Where one account owns the organisation and another manages it, both accounts’ people are listed. kind on each row is Person or ApiToken.

Organisation groups

An organisation group is a named set of your organisations. GET and POST /organisation-groups list and create them, and GET, PATCH and DELETE /organisation-groups/{groupId} read, rename and delete one. Deleting a group ends everybody’s access through it; direct access to an organisation is not affected.
  • PUT and DELETE /organisation-groups/{groupId}/organisations/{organisationId} add an organisation to a group and take it out. GET /organisation-groups/{groupId}/organisations lists the members.
  • PUT /users/{userId}/organisation-groups/{groupId} and PUT /api-tokens/{clientId}/organisation-groups/{groupId} give a person or token access through a group, with a required roleId; DELETE on the same address ends it. GET /organisation-groups/{groupId}/access lists everybody with access through the group.
  • Changing a group, its members or who holds it needs access to every organisation in your account (403 with whole_customer_access_denied), because everybody with access through the group reaches every organisation in it, including ones added later.
  • Groups belong to your account, so only your own people and API tokens can hold one. Give a guest organisations one at a time.

Roles

Only the Administrator role can be given today. GET /roles lists the other built-in roles with available: false so you can see what is coming. Giving any other role, or choosing it as the default, answers 400 with role_not_yet_available. The other roles become available without any change on your side.
GET /roles lists the built-in roles first, each with its permissions and who it can be given to (assignableTo: person, api-token), then your own roles. isDefault marks the role people get when none is chosen for them. GET /roles/{roleId} returns one, and GET /roles/{roleId}/revisions shows how one of your own roles has changed. POST /roles creates a role of your own from the permission catalogue (employee:read, employee:* for every level of one area, or *), PATCH /roles/{roleId} changes it and DELETE /roles/{roleId} deletes it. Built-in roles cannot be changed or deleted (400 with built_in_role_read_only). Nobody can build or give a role with more than they hold themselves. A role still held by somebody cannot be deleted (409 with role_in_use, listing who holds it). roleId sets the role wherever access is given: on POST /users, POST /api-tokens, the per-organisation and account-wide PUT routes, and group grants. Leave it out to give administrator, or to keep the role somebody already holds there. Grants made before roles existed read as administrator. GET /customer/access-settings returns your defaultRole, the role people get when none is chosen for them, such as through single sign-on or SCIM. PATCH /customer/access-settings chooses it. It cannot include managing people, roles, API tokens or the account. Users, roles and permissions describes every built-in role and how to read the permission each operation needs.

People

GET /users lists everyone who can sign in to the account, followed by your guests; add organisationId to see who can reach one organisation, or accessType to see one kind. POST /users invites somebody by email address, or adds access to somebody already in the account (the response’s alreadyExisted says which); send asGuest: true to invite somebody from another business into specific organisations only. When the person already has an account and signs in through an identity provider that is not your account’s own, the answer carries signsInElsewhere: true: whoever runs that provider controls their sign-in, including turning it off, so check that is what you want. POST /users/bulk does the same for many of your own people. DELETE /users/{principalId} removes somebody from the account and disables their sign-in; only the owner may call it. GET /users/{principalId} returns one person with both kinds of access (a guest’s accessType is Guest, as in the list), GET /users/me returns you, with isOwner saying whether you own your account and guestAccess listing your access to other accounts’ organisations, where you are a guest, and POST /users/{principalId}/resend-invitation re-sends an invitation to somebody who has not signed in yet. How somebody signs in is fixed when their account is created, and follows the account’s own sign-in setup, which GET /customer reports in signIn: the identity providers it links people to, and whether passwordSignIn is Allowed, OnRequest or Denied. Where the account links people to a provider and passwords are not Allowed, a new person is linked rather than emailed: invitationEmailed is false, they open Flow Payroll from the provider, and there is no password to reset or invitation to resend (409 with signs_in_through_identity_provider). Send signIn: "Password" to give somebody outside the provider, such as a bureau, a password of their own, or signIn: "IdentityProviderAndPassword" to link somebody to the provider and also email them a password for a direct login. Anything with a password is refused where passwords are Denied (409 with password_sign_in_denied), and anything with the provider where the account has none (409 with identity_provider_not_configured). Guests follow the same rules as your own people. A guest linked to your provider (the default where you have one, or IdentityProvider / IdentityProviderAndPassword) is your person: the account created for them is managed by yours. A guest given signIn: "Password" has a sign-in of their own and an account of their own. Each person’s signInProviders and passwordSignIn say how they sign in. Access is managed on two sub-resources: /users/{principalId}/organisations for direct grants (GET, PUT to replace the set, and PUT / DELETE on /{organisationId} for one at a time) and /users/{principalId}/customer-access for account-wide access (GET, PUT, DELETE). Each person can set a profile photo for themselves under /users/me/photo. Upload it in two steps, as for brand files: POST /users/me/photo/uploads answers a short-lived upload form, then call GET /users/me/photo/uploads/{uploadId} until it is Ready or Rejected. PNG, JPEG, GIF, WebP and SVG are accepted, up to 2 MB. Location and camera data are removed, and SVGs are cleaned. GET /users/me/photo returns a link that works for 15 minutes, and DELETE /users/me/photo removes the photo. API tokens cannot have a photo (403 with profile_photo_needs_a_person).

API tokens

GET /api-tokens lists the account’s client credentials. POST /api-tokens creates one and returns its clientSecret exactly once. PATCH /api-tokens/{clientId} renames it, POST /api-tokens/{clientId}/rotate issues a new secret for the same client id, and DELETE /api-tokens/{clientId} revokes it. Access is managed exactly as for people: /api-tokens/{clientId}/organisations for direct grants, /api-tokens/{clientId}/organisation-groups/{groupId} for organisation groups and /api-tokens/{clientId}/customer-access for account-wide access. An API token manages people, API tokens and the account within its own role, but never holds a role permission, and cannot give or take away account-wide access or access through an organisation group (403 with whole_customer_access_denied). allowedIpRanges limits where a token may be used from: up to 20 IPv4 or IPv6 ranges, such as 203.0.113.0/24. From anywhere else every API answers 403 with ip_not_allowed. Leave it out to allow any address.

Activity

GET /activity returns the account’s recent administration actions, newest first (organisations added, people invited, access changed, tokens issued, rotated, renamed, rescoped or revoked), paginated with pageSize (default 10, at most 50). Events are kept for 90 days. GET /access-changes lists every change to who has access, newest first: access given (Granted), a different role (RoleChanged) and access taken away (Removed), on one organisation, an organisation group or the whole account, with the role before and after and who made the change. ?principalId= narrows it to one person or API token. It is paginated with pageSize (default 25, at most 100), and changes are listed for 13 months.

SCIM

/scim/v2 lets your identity provider add, update, suspend and remove your account’s people, and give them account-wide roles, over SCIM 2.0. It is called by one of your API tokens with Authorization: Bearer. See Provisioning users with SCIM 2.0.

Branding

White label lets your customers and their employees see your product instead of Flow Payroll: your name, logo, colours, font, loading animation and help links, in the app, in emails and on payslips. Your brand applies once Flow has switched white label on for your account; entitlement on the draft says whether it has. You edit a draft and publish it when it is ready. Nobody else sees the draft.
  • GET /customer/branding/draft returns the draft and short-lived links to preview its files, with its version as the ETag header (and as version). PATCH /customer/branding/draft changes it with a JSON Merge Patch: leave a field out to keep it, send null to clear it. Send the ETag you read as If-Match: if somebody else saved since, the answer is 412 with concurrent_change and nothing is written; without If-Match it is 428 with precondition_required. DELETE /customer/branding/draft honours If-Match too.
  • POST /customer/branding/revisions publishes the draft as a new revision. It needs a product name and a main colour (400 brand_incomplete), and an animation when loadingStyle is Animation (400 loading_animation_missing). Send fromRevision to publish an older revision again; the draft is left as it is. GET /customer/branding/revisions lists what was published, newest first, and GET /customer/branding returns what is live (404 until the first publish).
  • DELETE /customer/branding goes back to the Flow brand: your organisations, their employees, emails, payslips and web addresses show it again within 15 minutes. Every revision stays in your history, so publishing one again brings your brand back. DELETE /customer/branding/draft empties the draft so you can start again; what is live does not change. canChange on the draft says whether you can change the brand: one-organisation administrators can view only.
  • emailButtonShape (Rounded, Square or Pill) and emailHeaderStyle (Plain or BrandBar) set how the buttons and the top of each email look.
  • Who emails come from: emailFromName, emailFromAddress (a full address on one of your email domains) and emailReplyTo are the default for every email. emailSenderOverrides changes any of the three for one kind of email, keyed by email type (PayslipGeneratedEvent, P60GeneratedEvent, …): an object changes the fields it names, null puts that email back on the default, and one request can change any number of emails. An address is used once its domain is verified; until then those emails come from noreply@ your first verified domain, or from standardFromAddress (on GET /customer/branding/sending-domains) in your name. An address on a domain that is not one of yours is refused (400 email_sender_domain_not_the_accounts).
  • Files (the logo, icon, fonts and loading animation, and optional dark-mode versions of the logo, icon and animation) are uploaded in two steps. POST /customer/branding/assets, with the file’s type (Logo, IconMark, FontRegular, …), answers a short-lived upload form; then call GET /customer/branding/assets/{uploadId} until the upload is Ready, with an assetId to set on the draft, or Rejected, with a message to show. An SVG keeps a logo or icon sharp, and a PNG works too. A loading animation is an SVG and may move with SMIL or CSS keyframes. Every file is checked by its content, and SVGs are cleaned of scripts and links to other files.
  • GET /customer/branding/domains and GET /customer/branding/sending-domains list the web addresses and email sending domains Flow has set up for you. They are read-only.
  • type replaced kind on brand file uploads, in the request and in both responses. A request that sends only kind answers 400 with asset_type_required.
  • An organisation can have its own company logo, shown first with your brand as “Powered by”: GET and PATCH /organisations/{organisationId}/branding, with uploads through /organisations/{organisationId}/branding/assets. GET /organisations/{organisationId}/resolved-branding says whose brand the app shows for an organisation. GET /organisations/branding?organisationIds= returns the company logos of up to 100 organisations in one call, and leaves out any you cannot reach.
The wording of each email is set through the Email Wording API.

Typical workflow

  1. Mint an access token (see Authentication) and call GET /customer to confirm which account it belongs to.
  2. Add an organisation with POST /organisations, sending an Idempotency-Key. Note the organisationId in the response.
  3. Create an API token for your integration with POST /api-tokens, naming the organisations it should reach in organisationIds. Store the clientSecret from the response immediately: it is not shown again.
  4. Invite the people who will run payroll with POST /users, giving each the organisations they need, or allOrganisations: true for an administrator who should reach everything, present and future.
  5. To give a team the same set of organisations, create an organisation group, add the organisations to it, and give it to each person with PUT /users/{userId}/organisation-groups/{groupId}.
  6. Use the new organisationId as X-Org-Id on the payroll APIs.
  7. When staff change, adjust access with the per-organisation PUT and DELETE routes, and check GET /activity to see what changed.

Limits and safeguards

  • An account may hold 500 people and 5 API tokens. Reaching either limit answers 409 (user_limit_reached, token_limit_reached); accounts already past a limit keep everything they have. Contact hello@flowpayroll.ai to raise an allowance.
  • An account may hold 50 roles of its own (409 with role_limit_reached), and an organisation can be in at most 25 organisation groups (409 with organisation_group_limit_reached).
  • A person or token must always reach something. Removing the last direct grant from somebody without account-wide access answers 400 (user_access_would_be_empty, token_access_would_be_empty). Remove a person with DELETE /users/{principalId} and revoke a token with DELETE /api-tokens/{clientId} rather than emptying their access. A guest is the exception: taking back the last organisation you granted is how guest access ends.
  • Only the account owner can remove a person or transfer ownership (403 with not_customer_owner otherwise), and the owner cannot remove themselves (409 with cannot_delete_owner).
  • Creating organisations and API tokens, and inviting people (POST /users, POST /users/bulk), are gated on billing. While billingStatus is AwaitingSetup, they answer 403 with billing_not_set_up; email hello@flowpayroll.ai to set billing up.
  • A managed account (managedBy on GET /customer) changes nothing of its own: every write but its person’s own photo and a reached organisation’s logo answers 403 with account_managed_by_another_account, naming the managing account.
  • You cannot remove your own last access (409 with cannot_remove_own_last_access); ask another administrator.
  • Resending an invitation sends a fresh link to set up the account, and the link in any earlier invitation stops working, so it is limited to once a minute (429 with invitation_sent_recently) and refused once the person has signed in (409 with already_signed_in) or where they sign in through the account’s identity provider (409 with signs_in_through_identity_provider).
  • Revocation takes effect immediately. An access token already minted from a revoked credential decodes for up to an hour but is refused on every request, because access is checked against live data.

Idempotency

POST /organisations, POST /organisations/bulk and POST /api-tokens accept an Idempotency-Key header: any unique string up to 255 characters, a UUID by convention. A retry with the same key and body answers 200 with what the first attempt made (without a token’s secret, which is shown once); the same key with a different body answers 409 with idempotency_key_reused. Keys are remembered for 24 hours. Inviting a person needs no key: the email address is the identity, so a repeated invitation is recognised as the same person and answered as an access change.

Pagination

Every list takes pageSize and paginationToken, and publishes the next cursor in content.metadata.paginationToken (prefer this) and on the list body. Follow the token until it is absent: a page is never the whole list while a token is present. GET /users?search= filters within the page it returns, so a searched page can hold fewer rows than pageSize while a token is still present; keep following it.

Notes and best practices

  • Prefer the per-organisation PUT and DELETE routes over replacing a whole set. They are idempotent and safe when two administrators edit at once, whereas a declarative PUT can overwrite a concurrent change.
  • Treat clientSecret like a password: it appears once, in the create or rotate response. If it is lost, rotate.
  • Headcounts in organisation responses trail the payroll by seconds and, for leavers, by up to a day. Use them for a headline figure, never a figure to file or pay on.
  • Bulk endpoints answer 201 when every entry went through, 207 when some did, and 400 when none did. The body lists every entry in all three cases, and nothing is rolled back.
  • Reason tokens are snake_case (user_limit_reached); activity actions are PascalCase (UserInvited). They are different vocabularies.
  • Give access with access (a role at each place) when you invite people or create API tokens. organisationIds and allOrganisations on those requests, and organisationIds and coversWholeCustomer on the people and token reads, are deprecated: see Deprecations.

Authentication

Every request must carry a valid token in the X-Auth-Token header; see Authentication. X-Org-Id is not used: the account is derived from the token, and organisations are named in the path. Responses use the shared envelope described in Response format.