---
title: "Import Terraform module from GitHub repository"
method: POST
path: "/api/vcs/modules/import"
tags: ["VCS"]
---

# Import Terraform module from GitHub repository

`POST /api/vcs/modules/import`

Imports a module to the private registry using backend-managed VCS credential resolution.
The frontend sends metadata only and the backend builds the authenticated download URL.

## Request body

- ImportVcsModuleRequest
  - `name` string, required — Module name in registry path
  - `providerType` string, required — Terraform provider type
  - `version` string, required — Module version in valid semver format
  - `vcsId` string, required — VCS integration ID
  - `repo` string, required — GitHub repoFullName (owner/repo)
  - `branch` string, required — Branch name to import from
  - `path` string — Optional path to module directory in repository. Defaults to repository root.

## Response `200`

Module imported successfully

- ImportVcsModuleResponse
  - `message` string, required

## Other responses

- `400` — Validation error
- `401` — Unauthorized Error
- `404` — Integration not found
- `422` — Registry could not download module from repository
- `500` — Internal error
- `502` — Upstream VCS or registry service unavailable

---

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