---
updatedAt: 2026-05-28T08:16:45.000Z
agentTools:
  projectIndex: https://docs.scalr.io/llms.txt
---

# Create a Module Namespace

Create a new module namespace.

# OpenAPI definition

```json
{
  "components": {
    "schemas": {
      "ModuleNamespace": {
        "description": "A terraform module namespace in the [Private Module Registry](../../module.html).",
        "properties": {
          "attributes": {
            "properties": {
              "is-shared": {
                "description": "Whether the module namespace is shared across all current and future environments.",
                "type": "boolean"
              },
              "name": {
                "description": "The module namespace name.",
                "maxLength": 255,
                "type": "string"
              }
            },
            "type": "object"
          },
          "id": {
            "readOnly": true,
            "type": "string"
          },
          "links": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object"
          },
          "relationships": {
            "properties": {
              "environments": {
                "description": "The environments in which the namespace modules can be used.",
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "environments",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "modules": {
                "description": "The modules in the module namespace.",
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "modules",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "readOnly": true,
                "required": [
                  "data"
                ],
                "type": "object"
              },
              "owners": {
                "description": "The teams, the module namespace belongs to.",
                "properties": {
                  "data": {
                    "items": {
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "type": {
                          "enum": [
                            "teams",
                            ""
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "type",
                        "id"
                      ],
                      "type": "object"
                    },
                    "nullable": true,
                    "type": "array"
                  }
                },
                "required": [
                  "data"
                ],
                "type": "object"
              }
            },
            "type": "object"
          },
          "type": {
            "enum": [
              "module-namespaces"
            ],
            "type": "string"
          }
        },
        "required": [
          "type"
        ],
        "type": "object"
      },
      "ModuleNamespaceDocument": {
        "description": "JSON:API Document.\n\nsee: https://jsonapi.org/format/#document-structure",
        "properties": {
          "data": {
            "$ref": "#/components/schemas/ModuleNamespace"
          },
          "included": {
            "items": {
              "type": "object"
            },
            "readOnly": true,
            "type": "array"
          },
          "meta": {
            "readOnly": true,
            "type": "object"
          }
        },
        "type": "object"
      }
    },
    "securitySchemes": {
      "API-Key": {
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Scalr IACP API",
    "license": {
      "name": "Apache 2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0"
    },
    "title": "Scalr IACP API",
    "version": "unversioned"
  },
  "openapi": "3.0.0",
  "paths": {
    "/module-namespaces": {
      "post": {
        "description": "Create a new module namespace.",
        "operationId": "create_module_namespace",
        "parameters": [],
        "requestBody": {
          "content": {
            "application/vnd.api+json": {
              "schema": {
                "$ref": "#/components/schemas/ModuleNamespaceDocument"
              }
            }
          }
        },
        "responses": {
          "201": {
            "content": {
              "application/vnd.api+json": {
                "schema": {
                  "$ref": "#/components/schemas/ModuleNamespaceDocument"
                }
              }
            },
            "description": "Success."
          },
          "403": {
            "description": "User unauthorized to perform action."
          },
          "404": {
            "description": "Relationship resource not found, or user unauthorized to perform action."
          },
          "422": {
            "description": "Malformed request body (missing attributes, wrong types, etc.)."
          },
          "4XX": {
            "description": "Client error."
          },
          "5XX": {
            "description": "Server error."
          }
        },
        "summary": "Create a Module Namespace",
        "tags": [
          "module-namespaces"
        ],
        "x-resource": "ModuleNamespace",
        "x-service": "tf-api"
      }
    }
  },
  "security": [
    {
      "API-Key": []
    }
  ],
  "servers": [
    {
      "url": "https://{Domain}/api/iacp/v3",
      "variables": {
        "Domain": {
          "default": "example.scalr.io",
          "description": "Domain where Scalr is hosted"
        }
      }
    }
  ]
}
```

# Sibling pages

* [List Module Namespaces](https://docs.scalr.io/scalr/reference/list_module_namespaces.md)
* [Get a Module Namespace](https://docs.scalr.io/scalr/reference/get_module_namespace.md)
* [Delete a Module Namespace](https://docs.scalr.io/scalr/reference/delete_module_namespace.md)
* [Update a Module Namespace](https://docs.scalr.io/scalr/reference/update_module_namespace.md)