> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flowpayroll.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Change what your account records about an organisation

> Needs permission organisation:write.

A JSON Merge Patch: leave a field out to keep it, send `null` to clear it. Answers the organisation as it now stands, in `GET /organisations/{organisationId}`'s shape.

`externalId` is your account's own identifier for it, such as its id in your practice management system: 1 to 256 characters, case-sensitive, no spaces at either end (400 `invalid_external_id`), unique among your account's organisations (409 `external_id_taken`); 409 `concurrent_change` when somebody changed it while this request ran, so read it again and retry. Setting it needs `organisation:write` across your whole account, not only on this organisation (403 `insufficient_permissions`, `missingPermission: organisation:write`), because partners' own systems identify the organisation by it. Only your account sees it: an account that owns or manages the same organisation keeps its own.

The organisation's names, type and references are its payroll record's and do not change here. 404 for an organisation that belongs to another account and for one that does not exist.



## OpenAPI

````yaml /api-reference/specs/administration.json patch /organisations/{organisationId}
openapi: 3.0.4
info:
  title: Administration API
  description: >-
    Manage your Flow Payroll account: the organisations it owns, the people who
    can sign in to it, the API tokens it holds, its brand, and a feed of recent
    administration activity. Every resource is scoped to the account your
    credentials belong to, so no request ever names a customer and the
    `X-Org-Id` header is not used.
  version: v1
servers:
  - url: https://api.sandbox.flowpayroll.ai/v1/administration
security:
  - X-Auth-Token: []
tags:
  - name: Customer
    description: >-
      Your account: the customer every other resource on this API belongs to.
      Read it and rename it.
  - name: Organisations
    description: >-
      The organisations your account owns or manages: list them with headcounts
      and your access to each, get one in full, add one or several at a time,
      see everybody who can reach one, and read which of its data an outside
      system manages.
  - name: Organisation groups
    description: >-
      Named sets of your organisations, such as the clients one team looks
      after. Give a person or API token a group, and they reach every
      organisation in it, including ones added later.
  - name: Users
    description: >-
      The people who can sign in to your account: list, invite (one or many),
      resend invitations, and manage each person's direct grants and
      account-wide access.
  - name: Roles
    description: >-
      What people and API tokens can do where they have access: the built-in
      roles, roles of your own, and the default role. Only Administrator can be
      given today.
  - name: API tokens
    description: >-
      The client credentials your integrations authenticate with: create (the
      secret is shown once), rename, rotate, revoke, and manage which
      organisations each token reaches.
  - name: Branding
    description: >-
      Your white-label brand: edit a draft, publish it, upload its files, and
      set a company logo for each organisation.
  - name: Activity
    description: >-
      Recent administration actions in your account, and every change to who has
      access, newest first.
  - name: SCIM
    description: >-
      SCIM 2.0 provisioning: your identity provider adds, updates, suspends and
      removes your account's people, and gives them account-wide roles.
paths:
  /organisations/{organisationId}:
    patch:
      tags:
        - Organisations
      summary: Change what your account records about an organisation
      description: >-
        Needs permission organisation:write.


        A JSON Merge Patch: leave a field out to keep it, send `null` to clear
        it. Answers the organisation as it now stands, in `GET
        /organisations/{organisationId}`'s shape.


        `externalId` is your account's own identifier for it, such as its id in
        your practice management system: 1 to 256 characters, case-sensitive, no
        spaces at either end (400 `invalid_external_id`), unique among your
        account's organisations (409 `external_id_taken`); 409
        `concurrent_change` when somebody changed it while this request ran, so
        read it again and retry. Setting it needs `organisation:write` across
        your whole account, not only on this organisation (403
        `insufficient_permissions`, `missingPermission: organisation:write`),
        because partners' own systems identify the organisation by it. Only your
        account sees it: an account that owns or manages the same organisation
        keeps its own.


        The organisation's names, type and references are its payroll record's
        and do not change here. 404 for an organisation that belongs to another
        account and for one that does not exist.
      operationId: UpdateOrganisation
      parameters:
        - name: organisationId
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/merge-patch+json:
            schema:
              $ref: '#/components/schemas/UpdateOrganisationRequest'
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateOrganisationRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OrganisationDetailResponseResponseBody'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
components:
  schemas:
    UpdateOrganisationRequest:
      type: object
      properties:
        externalId:
          type: string
          description: >-
            Your account's own identifier for this organisation: 1 to 256
            characters, case-sensitive, unique among your

            account's organisations. `null` clears it.
          nullable: true
      additionalProperties: false
      description: >-
        A JSON Merge Patch (RFC 7396) of what your account records about one of
        its organisations: leave a field out to keep

        it, send `null` to clear it. The organisation's names, type and
        references are its payroll record's, changed there.
    OrganisationDetailResponseResponseBody:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/OrganisationDetailResponseContentResponse'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
      additionalProperties: false
    ObjectResponseBody:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/ObjectContentResponse'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
      additionalProperties: false
    MessageWithTokenResponse:
      type: object
      properties:
        text:
          type: string
        token:
          type: string
        tokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      additionalProperties: false
    OrganisationDetailResponseContentResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/OrganisationDetailResponse'
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssue:
      type: object
      properties:
        field:
          type: string
        reason:
          type: string
        reasonToken:
          type: string
        reasonTokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      additionalProperties: false
    ObjectContentResponse:
      type: object
      properties:
        data: {}
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssueArgument:
      type: object
      properties:
        name:
          type: string
        value: {}
      additionalProperties: false
    OrganisationDetailResponse:
      type: object
      properties:
        organisationId:
          type: string
          description: >-
            The organisation's identifier. Send it as `X-Org-Id` on requests to
            the other Flow Payroll APIs.
        legalName:
          type: string
          description: The registered legal name.
          nullable: true
        tradingName:
          type: string
          description: The trading name, when one is recorded.
          nullable: true
        organisationType:
          enum:
            - Branch
            - Franchise
            - Independent
            - Parent
            - Subsidiary
          type: string
          description: >-
            One of `Branch`, `Franchise`, `Independent`, `Parent` or
            `Subsidiary`.
          nullable: true
        companyRegistrationNumber:
          type: string
          description: The Companies House registration number, when recorded.
          nullable: true
        payeReference:
          type: string
          description: The employer PAYE reference, once payroll has been set up.
          nullable: true
        employees:
          $ref: '#/components/schemas/EmployeeCountsResponse'
        callerAccess:
          $ref: '#/components/schemas/CallerAccessResponse'
        managedFor:
          allOf:
            - $ref: '#/components/schemas/AccountReferenceResponse'
          description: >-
            Present only on an organisation your account manages on its owner's
            behalf: the owning account, so a screen can say "Managed for
            {name}". Absent (null) for an organisation you own or reach as a
            guest.
          nullable: true
        managedBy:
          allOf:
            - $ref: '#/components/schemas/AccountReferenceResponse'
          description: >-
            Present only on an organisation your account owns that another
            account manages: that account, so a screen can say "Managed by
            {name}". Absent (null) otherwise, including for a guest of either
            account.
          nullable: true
        payer:
          enum:
            - Owner
            - ManagingAccount
          type: string
          description: >-
            On an organisation someone manages (`ManagedFor` or `ManagedBy`
            set): who it is billed to, `Owner` or

            `ManagingAccount`, so the owner's screen can say "Billed to {name}".
            Null when nobody else manages it.
          nullable: true
        profile:
          $ref: '#/components/schemas/OrganisationProfileResponse'
        externalId:
          type: string
          description: >-
            Your account's own identifier for this organisation, set on creation
            or with

            `PATCH /organisations/{organisationId}`. Absent when none is set,
            and on an organisation you reach as a guest.

            Another account that owns or manages the same organisation keeps its
            own, which you never see.
          nullable: true
      additionalProperties: false
      description: One organisation in full, read from the system that owns its record.
    ContentMetadataResponse:
      type: object
      properties:
        dateFormat:
          type: string
        dateTimeFormat:
          type: string
        paginationToken:
          type: string
          nullable: true
      additionalProperties: false
    EmployeeCountsResponse:
      type: object
      properties:
        totalEmployeeCount:
          type: integer
          description: On the books, whether or not they have left.
          format: int32
        activeEmployeeCount:
          type: integer
          description: On the books and not left.
          format: int32
        leaverEmployeeCount:
          type: integer
          description: On the books and left.
          format: int32
      additionalProperties: false
      description: >-
        Headcounts for an organisation today. They trail the payroll by seconds:
        a headline figure, never one to

        file or pay on.
    CallerAccessResponse:
      type: object
      properties:
        granted:
          type: boolean
          description: >-
            Whether you can act on this organisation. There is nothing else to
            say about it: everybody who

            reaches an organisation may do everything in it.
      additionalProperties: false
      description: What you can do with an organisation.
    AccountReferenceResponse:
      type: object
      properties:
        customerId:
          type: string
          description: The account's identifier.
        name:
          type: string
          description: The account's display name; its identifier when it has none.
      additionalProperties: false
      description: Another Flow Payroll account, as its own record names it.
    OrganisationProfileResponse:
      type: object
      properties:
        payeReference:
          type: string
          description: >-
            The employer PAYE reference, office number and reference
            (`123/AB45678`).
          nullable: true
        accountsOfficeReference:
          type: string
          description: HMRC's accounts office reference, for paying PAYE.
          nullable: true
        registeredOffice:
          $ref: '#/components/schemas/AddressResponse'
        primaryContact:
          $ref: '#/components/schemas/ContactResponse'
        lastCompletedPayRun:
          $ref: '#/components/schemas/PayRunGlanceResponse'
        nextPayRun:
          $ref: '#/components/schemas/PayRunGlanceResponse'
        payrollConfigs:
          type: array
          items:
            $ref: '#/components/schemas/PayrollConfigGlanceResponse'
          description: The organisation's payroll configs (its pay schedules), by name.
      additionalProperties: false
      description: An organisation's registered details and where its payroll stands.
    AddressResponse:
      type: object
      properties:
        line1:
          type: string
          description: First line.
          nullable: true
        line2:
          type: string
          description: Second line.
          nullable: true
        city:
          type: string
          description: Town or city.
          nullable: true
        county:
          type: string
          description: County.
          nullable: true
        postcode:
          type: string
          description: Postcode.
          nullable: true
        countryCode:
          type: string
          description: ISO 3166-1 alpha-2 country, `GB` for the UK.
          nullable: true
      additionalProperties: false
      description: A postal address; a part not recorded is null.
    ContactResponse:
      type: object
      properties:
        name:
          type: string
          description: Their name.
          nullable: true
        email:
          type: string
          description: Their email address.
          nullable: true
        phone:
          type: string
          description: Their phone number.
          nullable: true
      additionalProperties: false
      description: A person to contact; a part not recorded is null.
    PayRunGlanceResponse:
      type: object
      properties:
        payrollConfigId:
          type: string
          description: The pay schedule it belongs to, as the payroll API names it.
        frequency:
          type: string
          description: The schedule's frequency, such as `Monthly` or `Weekly`.
        year:
          type: integer
          description: >-
            The tax year it falls in, by its starting year (`2026` for 2026 to
            2027).
          format: int32
        period:
          type: integer
          description: Its period in that tax year.
          format: int32
        paymentDate:
          type: string
          description: When employees are paid, `yyyy-MM-dd`; null until set.
          nullable: true
        totalEmployees:
          type: integer
          description: How many employees it pays.
          format: int32
      additionalProperties: false
      description: One pay run at a glance.
    PayrollConfigGlanceResponse:
      type: object
      properties:
        payrollConfigId:
          type: string
          description: The payroll config, as the payroll API names it.
        name:
          type: string
          description: Its name; null when not set.
          nullable: true
        payFrequency:
          type: string
          description: >-
            How often it pays: `Weekly`, `Fortnightly`, `FourWeekly`, `Monthly`,
            `Quarterly`, `BiAnnually`, `Annual` or `Daily`.
          nullable: true
      additionalProperties: false
      description: One payroll config (a pay schedule).
  securitySchemes:
    X-Auth-Token:
      type: apiKey
      description: FlowPayroll JWT (raw token, no Bearer prefix)
      name: X-Auth-Token
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.