---
title: "Query plan item instances"
method: POST
path: "/cmmn-query/plan-item-instances"
tags: ["Plan Item Instances", "Query"]
---

# Query plan item instances

`POST /cmmn-query/plan-item-instances`

## Request

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

The request body can contain all possible filters that can be used in the List plan item instances URL query. On top of these, it’s possible to provide an array of variables and caseInstanceVariables to include in the query, with their format described here.

The general paging and sorting query-parameters can be used for this URL.

## Request body

- PlanItemInstanceQueryRequest
  - `start` integer
  - `size` integer
  - `sort` string
  - `order` string
  - `id` string
  - `elementId` string
  - `name` string
  - `caseInstanceId` string
  - `caseInstanceIds` string[]
  - `caseDefinitionId` string
  - `stageInstanceId` string
  - `planItemDefinitionId` string
  - `planItemDefinitionType` string
  - `planItemDefinitionTypes` string[]
  - `state` string
  - `createdBefore` string, date-time
  - `createdAfter` string, date-time
  - `startUserId` string
  - `referenceId` string
  - `referenceType` string
  - `includeEnded` boolean
  - `includeLocalVariables` boolean
  - `variables` QueryVariable[]
    - `name` string
    - `operation` 'equals' | 'notEquals' | 'equalsIgnoreCase' | 'notEqualsIgnoreCase' | 'like' | 'likeIgnoreCase' | 'greaterThan' | 'greaterThanOrEquals' | 'lessThan' | 'lessThanOrEquals' | 'exists' | 'notExists'
    - `value` object
    - `type` string
  - `caseInstanceVariables` QueryVariable[]
    - `name` string
    - `operation` 'equals' | 'notEquals' | 'equalsIgnoreCase' | 'notEqualsIgnoreCase' | 'like' | 'likeIgnoreCase' | 'greaterThan' | 'greaterThanOrEquals' | 'lessThan' | 'lessThanOrEquals' | 'exists' | 'notExists'
    - `value` object
    - `type` string
  - `tenantId` string
  - `withoutTenantId` boolean

## Response `200`

Indicates request was successful and the plan item instances are returned.

- DataResponsePlanItemInstanceResponse
  - `data` PlanItemInstanceResponse[]
    - `id` string
    - `url` string
    - `name` string
    - `caseInstanceId` string
    - `caseInstanceUrl` string
    - `caseDefinitionId` string
    - `caseDefinitionUrl` string
    - `derivedCaseDefinitionId` string
    - `derivedCaseDefinitionUrl` string
    - `stageInstanceId` string
    - `stageInstanceUrl` string
    - `planItemDefinitionId` string
    - `planItemDefinitionType` string
    - `state` string
    - `stage` boolean
    - `elementId` 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
    - `startUserId` string
    - `assignee` string
    - `completedBy` string
    - `referenceId` string
    - `referenceType` string
    - `completable` boolean
    - `entryCriterionId` string
    - `exitCriterionId` string
    - `formKey` string
    - `extraValue` string
    - `tenantId` 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

- `404`: Indicates a 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)
