> ## 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.

# Start a support session for an organisation

> For an organisation whose brand has a support panel address: that address (`embedUrl`) and a signed token for the page behind it. Show the address in a frame and, once the page says it is ready, hand it the token in a message; never put the token in the address. The token lasts 10 minutes (`expiresAt`), so ask again shortly before, and ask again whenever the person changes organisation. `sessionId` is the token's `jti`: quote it to support.

The token is a JSON Web Token signed with RS256, with `typ` `support-assertion+jwt`: refuse any other `typ`. Its claims: `iss` (Flow Payroll's public keys address), `aud` (the customer id of the account whose brand the organisation shows), `sub` (that account's `externalId` for the person, or `flow:` followed by their id here when it has given them none or they are not one of its own people), `org` (that account's `externalId` for the organisation, or `flow:` followed by the organisation's id), `principal_id` and `organisation_id` (the ids used by this API, always), `env`, `ver`, `iat`, `exp` and `jti`. It carries no name, email address or payroll data, and it is not accepted by this API.

Needs any access to the organisation. 404 `support_panel_not_set` when the organisation's brand has no support panel address (or Flow Payroll's own brand applies); 403 `support_session_needs_a_person` for an API token; 429 `too_many_support_sessions` after 120 in an hour for one person, with `Retry-After` in seconds until the hour turns.



## OpenAPI

````yaml /api-reference/specs/administration.json post /organisations/{organisationId}/support-sessions
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}/support-sessions:
    post:
      tags:
        - Organisations
      summary: Start a support session for an organisation
      description: >-
        For an organisation whose brand has a support panel address: that
        address (`embedUrl`) and a signed token for the page behind it. Show the
        address in a frame and, once the page says it is ready, hand it the
        token in a message; never put the token in the address. The token lasts
        10 minutes (`expiresAt`), so ask again shortly before, and ask again
        whenever the person changes organisation. `sessionId` is the token's
        `jti`: quote it to support.


        The token is a JSON Web Token signed with RS256, with `typ`
        `support-assertion+jwt`: refuse any other `typ`. Its claims: `iss` (Flow
        Payroll's public keys address), `aud` (the customer id of the account
        whose brand the organisation shows), `sub` (that account's `externalId`
        for the person, or `flow:` followed by their id here when it has given
        them none or they are not one of its own people), `org` (that account's
        `externalId` for the organisation, or `flow:` followed by the
        organisation's id), `principal_id` and `organisation_id` (the ids used
        by this API, always), `env`, `ver`, `iat`, `exp` and `jti`. It carries
        no name, email address or payroll data, and it is not accepted by this
        API.


        Needs any access to the organisation. 404 `support_panel_not_set` when
        the organisation's brand has no support panel address (or Flow Payroll's
        own brand applies); 403 `support_session_needs_a_person` for an API
        token; 429 `too_many_support_sessions` after 120 in an hour for one
        person, with `Retry-After` in seconds until the hour turns.
      operationId: CreateOrganisationSupportSession
      parameters:
        - name: organisationId
          in: path
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SupportSessionResponseResponseBody'
        '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'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
components:
  schemas:
    SupportSessionResponseResponseBody:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/SupportSessionResponseContentResponse'
        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
    SupportSessionResponseContentResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/SupportSessionResponse'
        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
    SupportSessionResponse:
      type: object
      properties:
        sessionId:
          type: string
          description: >-
            This session's id, also the token's `jti`. Quote it to support to
            find the session; it opens nothing on its own.
        token:
          type: string
          description: >-
            A signed JSON Web Token (RS256) saying who is asking and which
            organisation they are working in. Hand it to the

            support page in a message once the page has loaded; never put it in
            the page's address. It gives no access to

            this API.
        embedUrl:
          type: string
          description: The address of the account's support page, to show in a frame.
        expiresAt:
          type: string
          description: >-
            When the token stops verifying, UTC (ISO 8601). Ask for another
            shortly before.
        attributes:
          $ref: '#/components/schemas/SupportSessionAttributesResponse'
      additionalProperties: false
      description: >-
        What the app needs to open an account's own support page for the
        signed-in person in one organisation.
    ContentMetadataResponse:
      type: object
      properties:
        dateFormat:
          type: string
        dateTimeFormat:
          type: string
        paginationToken:
          type: string
          nullable: true
      additionalProperties: false
    SupportSessionAttributesResponse:
      type: object
      properties:
        hasPayRun:
          type: boolean
          description: Whether the organisation has any pay run, open or completed.
        lastPayRunStatus:
          type: string
          description: >-
            `Open` while a pay run is open, else `Completed`. Left out before
            the first pay run.
          nullable: true
        lastCompletedPayRunPayDate:
          type: string
          description: The pay date of the last completed pay run (`yyyy-MM-dd`).
          nullable: true
        nextPayRunPayDate:
          type: string
          description: The pay date of the open pay run that pays soonest (`yyyy-MM-dd`).
          nullable: true
      additionalProperties: false
      description: Where the organisation's payroll stands when the session starts.
  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.