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

# Preview an organisation's email as it would be sent

> The email exactly as it would be sent: subject, a whole HTML page and the plain-text version, with sample values (Jane Doe, Acme Ltd) and no attachment. Send `wording` in the same shape as a change to preview unsaved wording over what is saved. Logos are embedded in the page, so it can be shown in a sandboxed frame. Nothing is saved or sent. At most 30 previews a minute per person (429 `preview_limit`); API tokens cannot preview (403). 409 `preview_no_template` when the email is not set up; 502 `preview_unavailable` when the preview cannot be drawn just now. An organisation previews the published brand only: `brand` `Draft` answers 400 `draft_preview_not_available`.



## OpenAPI

````yaml /api-reference/specs/notification.json post /organisations/{organisationId}/email-settings/{eventType}/rendered-previews
openapi: 3.0.1
info:
  title: Email wording API
  description: >-
    The wording of the emails we send for you: payslips, P45s, P60s, pension
    enrolment letters, report-ready and webhook alerts, and, for your whole
    account, the sign-in emails. Set it once for your account, or for one
    organisation; each field falls back on its own to the account's, then the
    standard wording. Report-ready and webhook alerts can be switched off.
    Preview the real email, and go back to any saved version. Your brand,
    statutory content and links always stay.
  version: v1
servers:
  - url: https://api.sandbox.flowpayroll.ai/v1/notification-settings
security:
  - X-Auth-Token: []
paths:
  /organisations/{organisationId}/email-settings/{eventType}/rendered-previews:
    post:
      tags:
        - Organisation emails
      summary: Preview an organisation's email as it would be sent
      description: >-
        The email exactly as it would be sent: subject, a whole HTML page and
        the plain-text version, with sample values (Jane Doe, Acme Ltd) and no
        attachment. Send `wording` in the same shape as a change to preview
        unsaved wording over what is saved. Logos are embedded in the page, so
        it can be shown in a sandboxed frame. Nothing is saved or sent. At most
        30 previews a minute per person (429 `preview_limit`); API tokens cannot
        preview (403). 409 `preview_no_template` when the email is not set up;
        502 `preview_unavailable` when the preview cannot be drawn just now. An
        organisation previews the published brand only: `brand` `Draft` answers
        400 `draft_preview_not_available`.
      operationId: RenderOrganisationEmailPreview
      parameters:
        - name: organisationId
          in: path
          required: true
          schema:
            type: string
          description: >-
            The organisation to act on. It must be the one selected with
            `X-Org-Id`: a request naming two different organisations is refused
            with 403.
        - name: eventType
          in: path
          required: true
          schema:
            type: string
            enum:
              - PayslipGeneratedEvent
              - P45GeneratedEvent
              - P60GeneratedEvent
              - EmployeePensionEnrolmentEvent
              - ReportReadyEvent
              - WebhookEndpointFailingEvent
              - WebhookEndpointDisabledEvent
          description: >-
            The email, by the event name its webhook delivery events carry, as
            listed by the list operation: PayslipGeneratedEvent,
            P45GeneratedEvent, P60GeneratedEvent, EmployeePensionEnrolmentEvent,
            ReportReadyEvent, WebhookEndpointFailingEvent,
            WebhookEndpointDisabledEvent.
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EmailRenderedPreviewRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmailRenderedPreviewResponseResponseBody'
        '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'
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
        '502':
          description: Bad Gateway
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ObjectResponseBody'
      security:
        - X-Auth-Token: []
          X-Org-Id: []
components:
  schemas:
    EmailRenderedPreviewRequest:
      type: object
      description: 'Both optional: no body previews what is saved, in the published brand.'
      properties:
        wording:
          allOf:
            - $ref: '#/components/schemas/EmailWordingPatch'
          nullable: true
        brand:
          type: string
          enum:
            - Live
            - Draft
          default: Live
      additionalProperties: false
    EmailRenderedPreviewResponseResponseBody:
      type: object
      required:
        - message
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
        content:
          $ref: '#/components/schemas/EmailRenderedPreviewResponseContentResponse'
      additionalProperties: false
    ObjectResponseBody:
      type: object
      required:
        - message
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        validationIssues:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssue'
          nullable: true
      additionalProperties: false
    EmailWordingPatch:
      type: object
      description: 'Absent: keep. null: clear and inherit. Text: set.'
      properties:
        subject:
          type: string
          nullable: true
        heading:
          type: string
          nullable: true
        intro:
          type: string
          nullable: true
        closing:
          type: string
          nullable: true
        buttonLabel:
          type: string
          nullable: true
        enabled:
          type: boolean
          nullable: true
          description: 'false: switch the email off. true: on. null: follow the account.'
      additionalProperties: false
    MessageWithTokenResponse:
      type: object
      required:
        - text
        - token
      properties:
        text:
          type: string
        token:
          type: string
        tokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      additionalProperties: false
    ValidationIssue:
      type: object
      required:
        - field
        - reason
        - reasonToken
      properties:
        field:
          type: string
        reason:
          type: string
        reasonToken:
          type: string
        reasonTokenArguments:
          type: array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
          nullable: true
      additionalProperties: false
    EmailRenderedPreviewResponseContentResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/EmailRenderedPreviewResponse'
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssueArgument:
      type: object
      required:
        - name
      properties:
        name:
          type: string
        value: {}
      additionalProperties: false
    EmailRenderedPreviewResponse:
      type: object
      required:
        - eventType
        - subject
        - html
        - text
      properties:
        eventType:
          type: string
        subject:
          type: string
        html:
          type: string
        text:
          type: string
      additionalProperties: false
    ContentMetadataResponse:
      type: object
      required:
        - dateFormat
        - dateTimeFormat
      properties:
        dateFormat:
          type: string
        dateTimeFormat:
          type: string
        paginationToken:
          type: string
          nullable: true
      additionalProperties: false
  securitySchemes:
    X-Auth-Token:
      type: apiKey
      description: Your access token (raw token, no Bearer prefix)
      name: X-Auth-Token
      in: header
    X-Org-Id:
      type: apiKey
      description: >-
        The organisation to act on. Required only when your credentials can
        reach more than one organisation; optional for a single organisation.
      name: X-Org-Id
      in: header

````

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