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

# Query modules

`POST /api/iacStacks/modules`

Query Terraform/Pulumi modules with filtering and pagination

## Request body

- QueryModulesRequest
  - `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` object — Module-specific filters
    - `repoFullName` string[]
    - `moduleOriginType` string[]
    - `misconfigurations` string[]
  - `freeTextSearch` string — Free text search query
  - `size` integer — Number of items per page - v1 compatibility alias for pageSize
  - `sort` SortingOptions[] — Sorting configuration
    - 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
  - `sortArr` object[] — Sorting configuration - v1 compatibility alias for sort
    - `field` string
    - `sort` string

## Response `200`

Successful response

- QueryModulesResponse
  - `modules` Module[]
    - `id` string — Module ID
    - `moduleFolderPath` string — Path to module folder
    - `repoFullName` string — Repository containing the module
    - `moduleVcsPath` string — VCS URL path to module
    - `vcsType` 'github' | 'gitlab' | 'bitbucket' | 'azure-devops'
    - `updateAt` string, date-time — Last update timestamp
    - `lastContributor` string — Last contributor username
    - `firstContributor` string — Original author username
    - `usageCount` integer — Number of stacks using this module
    - `version` string — Module version
    - `moduleOrigin` string — Module source origin
    - `moduleOriginType` 'local' | 'registry' | 'git' — Module origin type
  - `total` integer — Total number of modules

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