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

# Delete a saved report definition (refuses while schedules reference it)



## OpenAPI

````yaml /api-reference/specs/report.json delete /report-definitions/{id}
openapi: 3.0.1
info:
  title: Report Service
  description: Customisable reporting API for FlowPayroll.
  contact:
    name: FlowPayroll
    email: hello@flowpayroll.com
  version: v1
servers:
  - url: https://api.sandbox.flowpayroll.ai/v1/report
security:
  - X-Auth-Token: []
    X-Org-Id: []
tags:
  - name: Datasets
    description: >-
      Discover what you can query: list the available datasets and inspect each
      field catalog — types, filterability, groupability, and supported
      aggregations.
  - name: Run reports
    description: >-
      Run a report synchronously — either an inline report definition or a saved
      one — and get columns and rows back in the response.
  - name: Report definitions
    description: >-
      Save a report definition under a name so it can be re-run, exported, and
      scheduled. Create, list, retrieve, replace, and delete definitions.
  - name: Exports
    description: >-
      Queue large result sets as asynchronous exports (CSV or JSONL, up to
      5,000,000 rows) and poll for a presigned download URL.
  - name: Schedules
    description: >-
      Run a saved definition on a cron schedule and deliver the export by
      webhook or email.
  - name: Run history
    description: Audit trail of every report run — synchronous, export, and scheduled.
paths:
  /report-definitions/{id}:
    delete:
      tags:
        - Report definitions
      summary: Delete a saved report definition (refuses while schedules reference it)
      operationId: deleteReportDefinition
      parameters:
        - $ref: '#/components/parameters/DefinitionId'
      responses:
        '204':
          description: Deleted
        '401':
          $ref: '#/components/responses/Unauthorised'
        '404':
          $ref: '#/components/responses/NotFound'
        '409':
          $ref: '#/components/responses/Conflict'
components:
  parameters:
    DefinitionId:
      name: id
      in: path
      required: true
      schema:
        type: string
      description: Report definition id (ULID)
  responses:
    Unauthorised:
      description: No organisation context on the request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServiceError'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServiceError'
    Conflict:
      description: Conflict
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServiceError'
  schemas:
    ServiceError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
        message:
          type: string
  securitySchemes:
    X-Auth-Token:
      type: apiKey
      description: FlowPayroll JWT (raw token, no Bearer prefix)
      name: X-Auth-Token
      in: header
    X-Org-Id:
      type: apiKey
      description: >-
        Organisation to scope the request to. Required when the principal can
        access more than one organisation; optional for single-organisation
        principals (the authorizer resolves it automatically).
      name: X-Org-Id
      in: header

````