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

# Choose how pension letters are sent

> Needs permission pension:write.

For each employee, whether the named letter goes by itself when their next pay run is finalised (sendAutomatically: true) or waits for somebody to send it (false). Applies to letters still to be given; a letter already given is reported in skipped as AlreadyGiven, and somebody owed no such letter as NotEnrolled, NoPostponementNotice or NoOptInInformation. The organisation's automaticLetterTypes decides it for letters that become owed later. Up to 1000 employees per request.



## OpenAPI

````yaml /api-reference/specs/pension-v2.json put /employee-pension/letters/{letterType}/sending
openapi: 3.0.4
info:
  title: FlowPayroll Pension API
  version: v2
servers:
  - url: https://api.sandbox.flowpayroll.ai/v2/pension
security: []
tags:
  - name: Pension providers
    description: >-
      Look up the pension providers available to your organisation. Providers
      are set up in the product, so the API exposes them read-only.
  - name: Pension schemes
    description: >-
      Your organisation's arrangements with providers. Scheme endpoints use the
      /pension-schema path.
  - name: Pension groups
    description: >-
      Contribution rule sets within a scheme: pension type, contribution basis,
      and employee and employer factors.
  - name: Employee enrolment
    description: >-
      Associate employees with pension groups, remove associations, and send
      enrolment letters.
  - name: Pension information
    description: >-
      An employee's full pension picture in one call: composition, latest
      assessment, and postponement.
  - name: Auto-enrolment
    description: >-
      Assessment results per pay run, employees with outstanding or no
      auto-enrolment, and a stateless assessment preview.
  - name: Postponement
    description: Defer auto-enrolment per employee, overriding the organisation defaults.
  - name: Organisation defaults
    description: >-
      The organisation's default pension group, postponement definitions, and
      auto-enrolment mode.
  - name: Pension calculations
    description: >-
      Per-period contribution amounts, the contributions CSV, and provider
      export files.
  - name: Provider submissions
    description: >-
      Send a completed pay run to its connected pension provider, approve the
      payment, and read back what the provider reported: opt-outs, stopped
      contributions, refunds and schedules.
paths:
  /employee-pension/letters/{letterType}/sending:
    put:
      tags:
        - Employee enrolment
      summary: Choose how pension letters are sent
      description: >-
        Needs permission pension:write.


        For each employee, whether the named letter goes by itself when their
        next pay run is finalised (sendAutomatically: true) or waits for
        somebody to send it (false). Applies to letters still to be given; a
        letter already given is reported in skipped as AlreadyGiven, and
        somebody owed no such letter as NotEnrolled, NoPostponementNotice or
        NoOptInInformation. The organisation's automaticLetterTypes decides it
        for letters that become owed later. Up to 1000 employees per request.
      operationId: SetPensionLetterSending
      parameters:
        - name: letterType
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PutLetterSendingRequest'
        required: true
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LetterSendingModelResponseBody'
        '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/ApiErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
components:
  schemas:
    PutLetterSendingRequest:
      required:
        - employeeIds
        - sendAutomatically
      type: object
      properties:
        employeeIds:
          type: array
          items:
            type: string
          description: Whose letter. Repeated ids are collapsed.
          nullable: true
        sendAutomatically:
          type: boolean
          description: >-
            True: Flow sends it when the worker's next pay run is finalised,
            unless it has been sent by

            then. False: it waits for somebody to send it.
      additionalProperties: false
      description: >-
        How a letter still to be given goes out, for one worker or many: by
        itself when the worker's

        next pay run is finalised, or when somebody sends it.
    LetterSendingModelResponseBody:
      required:
        - message
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/LetterSendingModelContentResponse'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
          description: >-
            Deprecated: the same issues as `validationIssues` (`reasonText` is
            `reason`, `reasonId` is `reasonToken`, `reasonParameters` is
            `reasonTokenArguments`). Read `validationIssues`; this will be
            removed.
          nullable: true
          readOnly: true
          deprecated: true
        metadata:
          allOf:
            - $ref: '#/components/schemas/ContentMetadataResponse'
          description: >-
            Deprecated: the same values as `content.metadata`. Read that; this
            will be removed.
          deprecated: true
      additionalProperties: false
      description: >-
        The response envelope every FlowPayroll API answers with: a `message`,
        the

        `content`, and any `validationIssues`. `errors` and the top-level

        `metadata` are deprecated copies of `validationIssues` and

        `content.metadata`, and will be removed.
    ObjectResponseBody:
      required:
        - message
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/ObjectContentResponse'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
          description: >-
            Deprecated: the same issues as `validationIssues` (`reasonText` is
            `reason`, `reasonId` is `reasonToken`, `reasonParameters` is
            `reasonTokenArguments`). Read `validationIssues`; this will be
            removed.
          nullable: true
          readOnly: true
          deprecated: true
        metadata:
          allOf:
            - $ref: '#/components/schemas/ContentMetadataResponse'
          description: >-
            Deprecated: the same values as `content.metadata`. Read that; this
            will be removed.
          deprecated: true
      additionalProperties: false
      description: >-
        The response envelope every FlowPayroll API answers with: a `message`,
        the

        `content`, and any `validationIssues`. `errors` and the top-level

        `metadata` are deprecated copies of `validationIssues` and

        `content.metadata`, and will be removed.
    ApiErrorResponse:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/ApiErrorMessage'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
      additionalProperties: false
    MessageWithTokenResponse:
      required:
        - token
      type: object
      properties:
        text:
          type: string
          nullable: true
        token:
          type: string
          description: >-
            Stable snake_case key for the message, for clients that translate
            it.
          nullable: true
        tokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
        textId:
          type: string
          description: >-
            Deprecated: the same value as `token`. Read that; this will be
            removed.
          nullable: true
          readOnly: true
          deprecated: true
        textParameters:
          type: array
          items:
            $ref: '#/components/schemas/Pair'
          description: >-
            Deprecated: the same values as `tokenArguments`. Read that; this
            will be removed.
          nullable: true
          readOnly: true
          deprecated: true
      additionalProperties: false
      description: >-
        What happened, as English `text` and a stable `token` to translate from.

        `textId` and `textParameters` are deprecated copies of `token` and
        `tokenArguments`.
    LetterSendingModelContentResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/LetterSendingModel'
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssue:
      type: object
      properties:
        field:
          type: string
          nullable: true
        reason:
          type: string
          nullable: true
        reasonToken:
          type: string
          nullable: true
        reasonTokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      additionalProperties: false
    Error:
      type: object
      properties:
        field:
          type: string
          nullable: true
        reasonText:
          type: string
          nullable: true
        reasonId:
          type: string
          nullable: true
        reasonParameters:
          type: array
          items:
            $ref: '#/components/schemas/Pair'
          nullable: true
      additionalProperties: false
      description: >-
        Deprecated: an entry of the old `errors` list. Read `validationIssues`
        instead.
      deprecated: true
    ContentMetadataResponse:
      type: object
      properties:
        dateFormat:
          type: string
          nullable: true
        dateTimeFormat:
          type: string
          nullable: true
        paginationToken:
          type: string
          nullable: true
      additionalProperties: false
    ObjectContentResponse:
      type: object
      properties:
        data:
          nullable: true
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ApiErrorMessage:
      type: object
      properties:
        text:
          type: string
          nullable: true
        token:
          type: string
          nullable: true
        tokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      additionalProperties: false
    ValidationIssueArgument:
      type: object
      properties:
        name:
          type: string
          nullable: true
        value:
          nullable: true
      additionalProperties: false
    Pair:
      type: object
      properties:
        key:
          type: string
          nullable: true
        value:
          type: string
          nullable: true
      additionalProperties: false
      description: >-
        Deprecated: a key and value of the old `textParameters` and
        `reasonParameters`.
      deprecated: true
    LetterSendingModel:
      required:
        - employeeIds
        - letterType
        - sendAutomatically
        - skipped
      type: object
      properties:
        letterType:
          enum:
            - Enrolment
            - ReEnrolment
            - Postponement
            - OptInInformation
            - OptInConfirmation
            - JoinConfirmation
          type: string
          nullable: true
        sendAutomatically:
          type: boolean
        employeeIds:
          type: array
          items:
            type: string
          description: The workers whose letter now goes the way asked.
          nullable: true
        skipped:
          type: array
          items:
            $ref: '#/components/schemas/PensionLetterFailureModel'
          description: >-
            Workers left as they were, each with a reason:

            `AlreadyGiven`, `NotEnrolled`, `NoPostponementNotice` or
            `NoOptInInformation`.
          nullable: true
      additionalProperties: false
      description: What changed, and who was left alone and why.
    PensionLetterFailureModel:
      required:
        - employeeId
        - reason
      type: object
      properties:
        employeeId:
          type: string
          nullable: true
        reason:
          enum:
            - AlreadySending
            - NotEnrolled
            - SendFailed
            - UnsupportedLetterType
            - NoOptOutContact
            - NoEnrolmentDate
            - NoJoiningRoute
            - NoPostponementNotice
            - NoOptInInformation
            - AlreadyGiven
          type: string
          description: >-
            Why this employee's letter was left alone. A stable token, so a
            caller can branch on it

            and say it in its own words.
          nullable: true
      additionalProperties: false

````

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