---
title: "Create a module call"
method: POST
path: "/api/codify/module"
tags: ["Codification"]
---

# Create a module call

`POST /api/codify/module`

Create a module call using the provided resource along with its dependencies

## Request body

- CodifyModuleRequest
  - `assetId` string, required — The id of the resource to be codified using module call
  - `assetType` string, required — The Terraform asset type (e.g. aws_s3_bucket)
  - `format` 'HCL' | 'YAML' | 'JSON' | 'TFVARS' | 'TFVARS_JSON' | 'TERRAGRUNT' — The format of the codified result (e.g. terraform, json)
  - `moduleMD5` string, required — The MD5 hash of the module path
  - `repoProtocol` 'ssh' | 'https' — The protocol to reach the module's repository
  - `provider` 'akamai' | 'aws' | 'azurerm' | 'cloudflare' | 'datadog' | 'gcp' | 'github' | 'mongodbatlas' | 'newrelic' | 'ns1' | 'oci' | 'pagerduty' | 'vault', required — The provider of the resource type
  - `providerId` string, required — The Firefly integration ID where the resource is located
  - `sourceType` 'private' | 'public', required — The source type of the module (e.g. private, public)
  - `withAi` boolean — Whether to use AI to codify the module

## Response `200`

Successful module call

- CodifyModuleResponse
  - `Files` object — Map of file paths to their contents
  - `CodifiedMismatches` string[] — List of asset types that could not be codified
  - `ModuleMismatches` string[] — Asset types present in the module that are not part of the original request
  - `TerraformCMDs` string[] — Terraform commands to import the generated module
  - `TerraformImportBlocks` string[] — Terraform import blocks
  - `HasUnknownModules` boolean — Whether the module has unknown modules
  - `ModuleCallGaps` string[] — Potential issues with existing module call considering input and output
  - `Format` 'HCL' | 'YAML' | 'JSON' | 'TFVARS' | 'TFVARS_JSON' | 'TERRAGRUNT' — The format of the codified result based on the request

## Other responses

- `400` — Bad Request Error
- `401` — Unauthorized Error
- `403` — Insufficient permissions
- `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)
