---
title: "Search IaC stacks"
method: POST
path: "/api/iacStacks"
tags: ["IaC Stacks"]
---

# Search IaC stacks

`POST /api/iacStacks`

Query IaC stacks with filtering, sorting, and pagination

## Request body

- SearchIacStacksRequest
  - `page` integer — Page number (1-indexed)
  - `pageSize` integer — Number of items per page
  - `pageNumber` integer — Page number (1-indexed) - v1 compatibility alias for page
  - `tablePageSize` integer — Number of items per page - v1 compatibility alias for pageSize
  - `screenFilters` ScreenFilters — Filters for querying stacks. Filter values are matched against stack properties. Some filters are mapped to nested fields internally: - providerIntegrationId → stackProviders.providerIntegrationId - providerType → stackProviders.providerType - providerAccountId → stackProviders.providerAccountId - vcsRepo → metadata.vcsRepo
    - `stateType` string[] — IAC type filter (terraform, cloudformation, pulumi, helm, k8s, opentofu, etc.)
    - `providerIntegrationId` string[] — Integration ID filter (maps to stackProviders.providerIntegrationId)
    - `providerType` string[] — Provider type filter - aws, gcp, azure, etc. (maps to stackProviders.providerType)
    - `providerAccountId` string[] — Provider account ID filter (maps to stackProviders.providerAccountId)
    - `stackAssetTypes` string[] — Asset type filter
    - `status` string[] — Stack status filter
    - `iacState` string[] — Stack sync state filter - synced, unsynced, drifted (handled via meta-index)
    - `vcsRepo` string[] — VCS repository filter (maps to metadata.vcsRepo)
    - `backendLocation` string[] — Backend location filter
    - `hasIntegratedProviders` boolean — Filter stacks with integrated providers
    - `hasNotIntegratedProviders` boolean — Filter stacks without integrated providers
  - `freeTextSearch` string — Free text search query
  - `sorting` union
    - object
      - `field` string — Field name to sort by
      - `order` string — Sort direction (asc or desc)
    - object[] — Array of sorting options (v1 compatibility)
      - `field` string
      - `sort` string

## Response `200`

Successful response

- SearchIacStacksResponse
  - `hits` IacStack[] — List of IaC stacks
    - `id` string — Unique stack identifier
    - `name` string — Stack name
    - `stateType` 'terraform' | 'cloudformation' | 'pulumi' | 'helm' | 'k8s' — IaC type
    - `status` string — Stack status
    - `version` string — IaC version
    - `backend` string — Backend/state storage location
    - `lastApplied` string, date-time — Last apply timestamp
    - `assetCount` integer — Number of managed assets
    - `stackProviders` StackProvider[]
      - `providerType` string — Provider type (aws, gcp, azure, etc.)
      - `providerAccountId` string — Provider account identifier
      - `providerIntegrationId` string — Firefly integration ID
      - `isIntegrated` boolean — Whether provider is integrated with Firefly
    - `metadata` object
      - `vcsRepo` string
      - `vcsPath` string
      - `branch` string
  - `total` integer — Total number of stacks matching the query

## Other responses

- `400` — Bad Request Error
- `401` — Unauthorized Error
- `500` — Internal Server Error

---

[API](https://skmtc.net/firefly/apis/api-gateway.md) · [All operations](https://skmtc.net/firefly/apis/api-gateway/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/firefly/api-gateway/revisions/eea119b4113f/schema)
