/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 /customertells 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 byclientId. - 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 asadministrator, or one of your own such ascustom.hr-team. Every grant carries one, androleson 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
organisationIdslist. Reported ascoversWholeCustomeron 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 /customernames them inowner. - 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
accessTypeofCustomerorGuest. 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}/releasestops 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:
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.
PUTandDELETE /organisation-groups/{groupId}/organisations/{organisationId}add an organisation to a group and take it out.GET /organisation-groups/{groupId}/organisationslists the members.PUT /users/{userId}/organisation-groups/{groupId}andPUT /api-tokens/{clientId}/organisation-groups/{groupId}give a person or token access through a group, with a requiredroleId;DELETEon the same address ends it.GET /organisation-groups/{groupId}/accesslists everybody with access through the group.- Changing a group, its members or who holds it needs access to every organisation in your account (
403withwhole_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
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/draftreturns the draft and short-lived links to preview its files, with its version as theETagheader (and asversion).PATCH /customer/branding/draftchanges it with a JSON Merge Patch: leave a field out to keep it, sendnullto clear it. Send theETagyou read asIf-Match: if somebody else saved since, the answer is412withconcurrent_changeand nothing is written; withoutIf-Matchit is428withprecondition_required.DELETE /customer/branding/drafthonoursIf-Matchtoo.POST /customer/branding/revisionspublishes the draft as a new revision. It needs a product name and a main colour (400brand_incomplete), and an animation whenloadingStyleisAnimation(400loading_animation_missing). SendfromRevisionto publish an older revision again; the draft is left as it is.GET /customer/branding/revisionslists what was published, newest first, andGET /customer/brandingreturns what is live (404until the first publish).DELETE /customer/brandinggoes 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/draftempties the draft so you can start again; what is live does not change.canChangeon the draft says whether you can change the brand: one-organisation administrators can view only.emailButtonShape(Rounded,SquareorPill) andemailHeaderStyle(PlainorBrandBar) 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) andemailReplyToare the default for every email.emailSenderOverrideschanges any of the three for one kind of email, keyed by email type (PayslipGeneratedEvent,P60GeneratedEvent, …): an object changes the fields it names,nullputs 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 fromnoreply@your first verified domain, or fromstandardFromAddress(onGET /customer/branding/sending-domains) in your name. An address on a domain that is not one of yours is refused (400email_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’stype(Logo,IconMark,FontRegular, …), answers a short-lived upload form; then callGET /customer/branding/assets/{uploadId}until the upload isReady, with anassetIdto set on the draft, orRejected, 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/domainsandGET /customer/branding/sending-domainslist the web addresses and email sending domains Flow has set up for you. They are read-only.typereplacedkindon brand file uploads, in the request and in both responses. A request that sends onlykindanswers400withasset_type_required.- An organisation can have its own company logo, shown first with your brand as “Powered by”:
GETandPATCH /organisations/{organisationId}/branding, with uploads through/organisations/{organisationId}/branding/assets.GET /organisations/{organisationId}/resolved-brandingsays 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.
Typical workflow
- Mint an access token (see Authentication) and call
GET /customerto confirm which account it belongs to. - Add an organisation with
POST /organisations, sending anIdempotency-Key. Note theorganisationIdin the response. - Create an API token for your integration with
POST /api-tokens, naming the organisations it should reach inorganisationIds. Store theclientSecretfrom the response immediately: it is not shown again. - Invite the people who will run payroll with
POST /users, giving each the organisations they need, orallOrganisations: truefor an administrator who should reach everything, present and future. - 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}. - Use the new
organisationIdasX-Org-Idon the payroll APIs. - When staff change, adjust access with the per-organisation
PUTandDELETEroutes, and checkGET /activityto 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 (
409withrole_limit_reached), and an organisation can be in at most 25 organisation groups (409withorganisation_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 withDELETE /users/{principalId}and revoke a token withDELETE /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 (
403withnot_customer_ownerotherwise), and the owner cannot remove themselves (409withcannot_delete_owner). - Creating organisations and API tokens, and inviting people (
POST /users,POST /users/bulk), are gated on billing. WhilebillingStatusisAwaitingSetup, they answer403withbilling_not_set_up; email hello@flowpayroll.ai to set billing up. - A managed account (
managedByonGET /customer) changes nothing of its own: every write but its person’s own photo and a reached organisation’s logo answers403withaccount_managed_by_another_account, naming the managing account. - You cannot remove your own last access (
409withcannot_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 (
429withinvitation_sent_recently) and refused once the person has signed in (409withalready_signed_in) or where they sign in through the account’s identity provider (409withsigns_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 takespageSize 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
PUTandDELETEroutes over replacing a whole set. They are idempotent and safe when two administrators edit at once, whereas a declarativePUTcan overwrite a concurrent change. - Treat
clientSecretlike 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
201when every entry went through,207when some did, and400when 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.organisationIdsandallOrganisationson those requests, andorganisationIdsandcoversWholeCustomeron the people and token reads, are deprecated: see Deprecations.
Authentication
Every request must carry a valid token in theX-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.