# List draft invoice histories

> 🔐 **Required role:** `API_ADMIN`
📖 **Data dictionary:** [Draft invoice history](/reference/data-dictionary/draft-invoice-history)

**Retrieve draft invoice histories with basic pagination support**
Uses standard limit/offset pagination via `pageSize` and `page` — see [Pagination](/reference/pagination). Use `total.aggregate.count` to detect the end.
Provides paginated access to draft invoice history records.

Endpoint: POST /gql/v1/draft_invoice_histories
Version: 1.0.0
Security: BearerAuth, CfAccessClientId, CfAccessClientSecret

## Security:

  - `BearerAuth` (unknown)
    http bearer JWT

  - `CfAccessClientId` (unknown)
    apiKey in header CF-Access-Client-Id

  - `CfAccessClientSecret` (unknown)
    apiKey in header CF-Access-Client-Secret

## Request fields (application/json):

  - `pageSize` (integer)
    Limit — number of records to return (not a page count).

  - `page` (integer)
    Offset — number of records to skip. This is not a page index.
To fetch the next N rows after the first N, send `pageSize: N`
and `page: N`. An offset at or beyond `total.aggregate.count`
returns an empty result array.

## Request examples:

  - `Default pagination` (unknown)

## Response 200:

  - `200` (unknown)
    Successfully retrieved draft invoice histories

## Response 200 fields (application/json):

  - `draftInvoices` (array, required)

  - `draftInvoices.clientId` (integer, required)
    Client identifier
    Example: 7720

  - `draftInvoices.invoiceId` (integer | null, required)
    Identifier of the posted invoice. Null until the draft has produced an invoice.
    Example: 125890

  - `draftInvoices.jobId` (integer, required)
    Associated job/project identifier
    Example: 2514

  - `draftInvoices.client` (object, required)
    Client summary information

  - `draftInvoices.client.active` (boolean, required)
    Example: true

  - `draftInvoices.client.clientRef` (string, required)
    Example: TF-2024-789

  - `draftInvoices.client.name` (string, required)
    Example: TechFlow Enterprises

  - `draftInvoices.client.pmsRef` (string, required)
    Example: 240815

  - `draftInvoices.draftInvoice` (object | null, required)
    Draft invoice metadata. Null when the history record has no draft invoice
or the draft's AR transaction is inactive.

  - `draftInvoices.draftInvoice.approvedAt` (string | null, required)
    Approval timestamp. Null until the draft is approved.
    Example: 2024-03-15T14:32:18+00:00

  - `draftInvoices.draftInvoice.arTranId` (integer, required)
    AR transaction identifier of the draft invoice
    Example: 125880

  - `draftInvoices.draftInvoice.approverStaffId` (integer, required)
    Example: 301

  - `draftInvoices.draftInvoice.approvedByStaffId` (integer | null, required)
    Staff who approved the draft. Null until the draft is approved.
    Example: 301

  - `draftInvoices.draftInvoice.invoiceId` (integer | null, required)
    Identifier of the posted invoice. Null until the draft is posted.
    Example: 125890

  - `draftInvoices.draftInvoice.isActive` (boolean, required)
    Example: true

  - `draftInvoices.draftInvoice.pms_invoice_number` (string | null, required)
    Invoice number in the practice management system. Null unless the draft was pushed to a PMS.
    Example: null

  - `draftInvoices.draftInvoice.status` (string, required)
    Example: APPROVED

  - `draftInvoices.draftInvoice.attachTimeEntries` (boolean | null, required)
    Whether time entries are attached to the invoice
    Example: false

  - `draftInvoices.draftInvoice.automaticallyBillOn` (string | null, required)
    When the draft is scheduled to bill automatically. Null when it is not scheduled.
    Example: null

  - `draftInvoices.draftInvoice.billAddressContactInfoId` (integer | null, required)
    Identifier of the contact info used as the bill-to address
    Example: 4410

  - `draftInvoices.draftInvoice.billerStaffId` (integer, required)
    Identifier of the biller staff member
    Example: 301

  - `draftInvoices.draftInvoice.createdAt` (string, required)
    When the draft was created
    Example: 2024-05-12T22:50:20.595961+00:00

  - `draftInvoices.draftInvoice.createdByStaffId` (integer | null, required)
    Identifier of the staff member who created the draft
    Example: 301

  - `draftInvoices.draftInvoice.currentAssignedStaffId` (integer, required)
    Identifier of the staff member the draft is currently assigned to
    Example: 301

  - `draftInvoices.draftInvoice.deliveryMethod` (string | null, required)
    How the invoice will be delivered: EMAIL, DOWNLOAD, EMAIL_AND_DOWNLOAD or POST_ONLY
    Example: EMAIL

  - `draftInvoices.draftInvoice.emailRecipients` (string | null, required)
    Email recipients for the invoice
    Example: ap@techflow.example

  - `draftInvoices.draftInvoice.expenseLineItemStrategy` (string | null, required)
    How expenses are presented as line items: SINGLE_LINE, HIDE or ALL
    Example: HIDE

  - `draftInvoices.draftInvoice.invoiceDate` (string | null, required)
    Invoice date to use when the draft is billed
    Example: null

  - `draftInvoices.draftInvoice.lineItemStrategy` (string | null, required)
    How time is presented as line items
    Example: JOB

  - `draftInvoices.draftInvoice.postOn` (string | null, required)
    Date the invoice is scheduled to post
    Example: null

  - `draftInvoices.draftInvoice.reversalReason` (string | null, required)
    Reason the draft was reversed
    Example: null

  - `draftInvoices.draftInvoice.reversedAt` (string | null, required)
    When the draft was reversed
    Example: null

  - `draftInvoices.draftInvoice.reversedByStaffId` (integer | null, required)
    Identifier of the staff member who reversed the draft
    Example: null

  - `draftInvoices.draftInvoice.reviewedAt` (string | null, required)
    When the draft was reviewed
    Example: 2024-03-14T10:05:00+00:00

  - `draftInvoices.draftInvoice.reviewedByStaffId` (integer | null, required)
    Identifier of the staff member who reviewed the draft
    Example: 301

  - `draftInvoices.draftInvoice.reviewerStaffId` (integer, required)
    Identifier of the reviewer staff member
    Example: 301

  - `draftInvoices.draftInvoice.scheduledByStaffId` (integer | null, required)
    Identifier of the staff member who scheduled the draft
    Example: null

  - `draftInvoices.draftInvoice.senderStaffId` (integer, required)
    Identifier of the sender staff member
    Example: 301

  - `draftInvoices.draftInvoice.timeEntryGrouping` (string | null, required)
    How attached time entries are grouped
    Example: null

  - `draftInvoices.draftInvoice.timeEntryPageOrientation` (string | null, required)
    Page orientation of attached time entries
    Example: null

  - `draftInvoices.draftInvoice.updatedAt` (string, required)
    When the draft was last updated
    Example: 2024-05-12T22:50:20.595961+00:00

  - `draftInvoices.draftInvoice.wipUnbilledAsOf` (string | null, required)
    Cut-off date for unbilled WIP included in the draft
    Example: null

  - `total` (object, required)

  - `total.aggregate` (object)

  - `total.aggregate.count` (integer)
    Total number of draft invoice history records matching criteria
    Example: 94

## Response 400:

  - `400` (unknown)
    Bad request - invalid pagination parameters

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 500:

  - `500` (unknown)
    Internal server error

## Response 200 examples:

  - `Draft invoice histories with client and draft invoice details` (unknown)

