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

# Create a new module

`POST /api/codify/module/create`

Create a new module using the provided resource

## Request body

- CreateModuleRequest
  - `assetId` string, required — The id of the resource to be codified using create module
  - `assetType` string, required — The Terraform asset type (e.g. aws_s3_bucket)
  - `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
  - `tfVersion` string — The Terraform version to use from the specified provider
  - `withAi` boolean — Whether to use AI to create the module
  - `withDependencies` boolean — Whether to include dependencies in the module (only available when withAi is true)

## Response `200`

Successfully created module

- CreateModuleResponse — Map of file paths to their contents

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