---
title: "Query repositories"
method: POST
path: "/api/iacStacks/repositories"
tags: ["IaC Stacks"]
---

# Query repositories

`POST /api/iacStacks/repositories`

Query VCS repositories containing IaC code

## Request body

- QueryRepositoriesRequest
  - `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

## Response `200`

Successful response

- IacStacksRepository[]
  - `repoFullName` string — Full repository name (org/repo)
  - `maxTimestamp` number — Last update timestamp (epoch)
  - `topHit` object
    - `vcsId` string — VCS integration ID
    - `vcsType` 'github' | 'gitlab' | 'bitbucket' | 'azure-devops' — VCS type
    - `modulesCount` integer — Number of modules in repository
    - `resourcesCount` integer — Number of resources in repository

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