---
title: "Query for historic plan item instances"
method: POST
path: "/cmmn-query/historic-planitem-instances"
tags: ["History PlanItem", "Query"]
---

# Query for historic plan item instances

`POST /cmmn-query/historic-planitem-instances`

## Request

- Base URL: `https://developer-docs.flowable.com/cmmn-api`
- URL: `https://developer-docs.flowable.com/cmmn-api/cmmn-query/historic-planitem-instances`
- Auth: HTTP basic
- TypeScript: <https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/docs/cmmn-query/historic-planitem-instances/post.ts> (a function with typed inputs; its response is checked against the schema)

All supported JSON parameter fields allowed are exactly the same as the parameters found for getting a collection of historic plan item instances, but passed in as JSON-body arguments rather than URL-parameters to allow for more advanced querying and preventing errors with request-uri’s that are too long.

## Request body

- HistoricPlanItemInstanceQueryRequest
  - `start` integer
  - `size` integer
  - `sort` string
  - `order` string
  - `planItemInstanceId` string
  - `planItemInstanceName` string
  - `planItemInstanceState` string
  - `caseDefinitionId` string
  - `caseInstanceId` string
  - `caseInstanceIds` string[]
  - `stageInstanceId` string
  - `elementId` string
  - `planItemDefinitionId` string
  - `planItemDefinitionType` string
  - `createdBefore` string, date-time
  - `createdAfter` string, date-time
  - `lastAvailableBefore` string, date-time
  - `lastAvailableAfter` string, date-time
  - `lastEnabledBefore` string, date-time
  - `lastEnabledAfter` string, date-time
  - `lastDisabledBefore` string, date-time
  - `lastDisabledAfter` string, date-time
  - `lastStartedBefore` string, date-time
  - `lastStartedAfter` string, date-time
  - `lastSuspendedBefore` string, date-time
  - `lastSuspendedAfter` string, date-time
  - `completedBefore` string, date-time
  - `completedAfter` string, date-time
  - `terminatedBefore` string, date-time
  - `terminatedAfter` string, date-time
  - `occurredBefore` string, date-time
  - `occurredAfter` string, date-time
  - `exitBefore` string, date-time
  - `exitAfter` string, date-time
  - `endedBefore` string, date-time
  - `endedAfter` string, date-time
  - `startUserId` string
  - `referenceId` string
  - `referenceType` string
  - `tenantId` string
  - `withoutTenantId` boolean
  - `includeLocalVariables` boolean

## Response `200`

Indicates request was successful and the plan item instances are returned

- DataResponseHistoricPlanItemInstanceResponse
  - `data` HistoricPlanItemInstanceResponse[]
    - `id` string
    - `name` string
    - `state` string
    - `caseDefinitionId` string
    - `derivedCaseDefinitionId` string
    - `caseInstanceId` string
    - `stageInstanceId` string
    - `stage` boolean
    - `elementId` string
    - `planItemDefinitionId` string
    - `planItemDefinitionType` string
    - `createTime` string, date-time
    - `lastAvailableTime` string, date-time
    - `lastEnabledTime` string, date-time
    - `lastDisabledTime` string, date-time
    - `lastStartedTime` string, date-time
    - `lastSuspendedTime` string, date-time
    - `completedTime` string, date-time
    - `occurredTime` string, date-time
    - `terminatedTime` string, date-time
    - `exitTime` string, date-time
    - `endedTime` string, date-time
    - `lastUpdatedTime` string, date-time
    - `startUserId` string
    - `assignee` string
    - `completedBy` string
    - `referenceId` string
    - `referenceType` string
    - `entryCriterionId` string
    - `exitCriterionId` string
    - `formKey` string
    - `extraValue` string
    - `showInOverview` boolean
    - `tenantId` string
    - `url` string
    - `caseInstanceUrl` string
    - `caseDefinitionUrl` string
    - `derivedCaseDefinitionUrl` string
    - `stageInstanceUrl` string
    - `localVariables` RestVariable[]
      - `name` string: Name of the variable
      - `type` string: Type of the variable.
      - `value` object: Value of the variable.
      - `valueUrl` string
      - `scope` string
  - `total` integer
  - `start` integer
  - `sort` string
  - `order` string
  - `size` integer

## Other responses

- `400`: Indicates an parameter was passed in the wrong format. The status-message contains additional information.

---

[API](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api.md) - [All operations](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/flowable/apis/flowable-cmmn-rest-api/revisions/afdfa1fcacd0?raw)
