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

# Replay deliveries

> Resends deliveries from a window of up to 90 days, by outcome and event type, and optionally sends events an endpoint never received. With `scope=customer` it covers every endpoint on your account, account-wide and each organisation's own, and needs account-wide access. Runs in the background; follow it with the replay's id.



## OpenAPI

````yaml /api-reference/specs/webhooks.json post /replays
openapi: 3.1.1
info:
  title: Webhooks Service
  description: >-
    Outbound webhooks for FlowPayroll: register an endpoint, subscribe to event
    types, manage signing secrets, inspect the delivery log and replay.
  version: v1
servers:
  - url: https://api.sandbox.flowpayroll.ai/v1/webhooks
security:
  - X-Auth-Token: []
tags:
  - name: Alert contacts
  - name: Delivery log
  - name: Endpoint subscriptions
  - name: Endpoints
  - name: Event types
  - name: Events
  - name: Replays
paths:
  /replays:
    post:
      tags:
        - Replays
      summary: Replay deliveries
      description: >-
        Resends deliveries from a window of up to 90 days, by outcome and event
        type, and optionally sends events an endpoint never received. With
        `scope=customer` it covers every endpoint on your account, account-wide
        and each organisation's own, and needs account-wide access. Runs in the
        background; follow it with the replay's id.
      operationId: StartReplay
      parameters:
        - name: scope
          in: query
          description: >-
            Whose resources: your organisation's (the default), or with
            account-wide access the account's (`customer`).
          schema:
            enum:
              - organisation
              - customer
            type: string
            default: organisation
        - name: Idempotency-Key
          in: header
          description: >-
            Makes a retry safe: the same key from the same person with the same
            body within 24 hours gets the first response back instead of running
            again. The same key with a different request is refused with 409.
          schema:
            maxLength: 255
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateReplayRequest'
        required: true
      responses:
        '202':
          description: Accepted
          headers:
            Location:
              description: Where the new resource can be read.
              schema:
                type: string
                format: uri
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReplayJobResponseResponseBody'
        '400':
          description: Bad Request
          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'
components:
  schemas:
    CreateReplayRequest:
      required:
        - endDate
        - startDate
      type: object
      properties:
        endpointIds:
          type:
            - 'null'
            - array
          items:
            type: string
        eventTypes:
          type:
            - 'null'
            - array
          items:
            type: string
        statuses:
          type:
            - 'null'
            - array
          items:
            enum:
              - Pending
              - Succeeded
              - Failed
              - Skipped
            type: string
        includeNeverSent:
          type:
            - 'null'
            - boolean
        startDate:
          type: string
        endDate:
          type: string
        maxDeliveries:
          type:
            - 'null'
            - integer
          format: int32
      additionalProperties: false
    ReplayJobResponseResponseBody:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/ReplayJobResponseContentResponse'
        validationIssues:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ValidationIssue'
      additionalProperties: false
    ObjectResponseBody:
      type: object
      properties:
        message:
          $ref: '#/components/schemas/MessageWithTokenResponse'
        content:
          $ref: '#/components/schemas/ObjectContentResponse'
        validationIssues:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ValidationIssue'
      additionalProperties: false
    MessageWithTokenResponse:
      type: object
      properties:
        text:
          type: string
        token:
          type: string
        tokenArguments:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
      additionalProperties: false
    ReplayJobResponseContentResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ReplayJobResponse'
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssue:
      type: object
      properties:
        field:
          type: string
        reason:
          type: string
        reasonToken:
          type: string
        reasonTokenArguments:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ValidationIssueArgument'
      additionalProperties: false
    ObjectContentResponse:
      type: object
      properties:
        data:
          type: 'null'
        metadata:
          $ref: '#/components/schemas/ContentMetadataResponse'
      additionalProperties: false
    ValidationIssueArgument:
      type: object
      properties:
        name:
          type: string
        value:
          type: 'null'
      additionalProperties: false
    ReplayJobResponse:
      required:
        - createdDate
        - ownerId
        - replayId
        - replayed
        - request
        - scope
        - status
      type: object
      properties:
        replayId:
          type: string
        status:
          enum:
            - Queued
            - Running
            - Completed
            - Cancelled
          type: string
        scope:
          enum:
            - Organisation
            - Customer
          type: string
        ownerId:
          type: string
        request:
          $ref: '#/components/schemas/CreateReplayRequest'
        replayed:
          type: integer
          format: int32
        createdDate:
          type: string
        finishedDate:
          type:
            - 'null'
            - string
      additionalProperties: false
    ContentMetadataResponse:
      type: object
      properties:
        dateFormat:
          type: string
        dateTimeFormat:
          type: string
        paginationToken:
          type:
            - 'null'
            - string
          description: >-
            Cursor for the next page, present only when more results follow and
            null on the last page. Pass it back unmodified to continue; it is
            opaque and short-lived, so do not store it.
      additionalProperties: false
  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.