---
title: "Create a pull request with codified assets"
method: POST
path: "/api/codify/pullRequest"
tags: ["Codification"]
---

# Create a pull request with codified assets

`POST /api/codify/pullRequest`

Creates a pull request containing Infrastructure as Code for specified cloud resources

## Request body

- CreatePullRequestRequest
  - `vcsId` string, required — VCS integration ID
  - `repository` string, required — Repository full name (e.g., org/repo)
  - `iacType` 'terraform' | 'tfcdk' | 'cloudformation' | 'pulumi', required — Infrastructure as Code type
  - `resources` CodificationResource[], required — Array of cloud resources to codify
    - `assetType` string, required — The Terraform asset type (e.g., aws_s3_bucket)
    - `assetId` string, required — The unique identifier of the cloud asset
    - `providerId` string, required — The Firefly integration ID
    - `provider` string, required — The cloud provider
    - `revisionId` string — Optional revision ID for the asset
    - `isDeleted` boolean — Whether the asset has been deleted
    - `frn` string — Firefly Resource Name
  - `codificationData` CodificationData
    - `codificationMode` string — The codification mode (e.g., NAIVE, MODULE)
    - `preparedContent` object[] — Pre-prepared file content to use instead of codifying
      - `filePath` string
      - `content` string
      - `overWrite` boolean — Whether to overwrite the file if it already exists in the repository
    - `selectedModule` string — Selected module identifier (used in PR title)
    - `fileExtension` string — File extension for the output
    - `codifyType` string — Type of codification operation (e.g., codification, remediation)
    - `commitDetails` string — Additional commit message details
    - `language` string — Output language format
    - `withImportBlocks` boolean — Include Terraform import blocks in the output
    - `withProviderBlock` boolean — Include Terraform provider block in the output
  - `prComment` string — Comment to include in the pull request description
  - `fileName` string — File path for the codified output
  - `selectedBranch` string — Target branch name (defaults to main/master)

## Response `200`

Successfully created pull request

- CreatePullRequestResponse
  - `ok` boolean, required — Whether the pull request was created successfully
  - `url` string, required — URL of the created pull request
  - `branchName` string, required — Name of the created branch

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