---
title: "Create an EdgeStack from a git repository"
method: POST
path: "/edge_stacks/create/repository"
tags: ["edge_stacks"]
---

# Create an EdgeStack from a git repository

`POST /edge_stacks/create/repository`

**Access policy**: administrator

## Query parameters

- `dryrun` string

## Request body

- EdgestacksEdgeStackFromGitRepositoryPayload
  - `DeploymentType` 0 | 1
  - `EdgeGroups` integer[], required — List of identifiers of EdgeGroups
  - `FilePathInRepository` string — Path to the Stack file inside the Git repository
  - `Name` string, required — Name of the stack Max length: 255 Name must only contains lowercase characters, numbers, hyphens, or underscores Name must start with a lowercase character or number Example: stack-name or stack_123 or stackName
  - `Registries` integer[] — List of Registries to use for this stack
  - `RepositoryAuthentication` boolean — Deprecated: Use SourceID instead. Use basic authentication to clone the Git repository.
  - `RepositoryPassword` string — Deprecated: Use SourceID instead. Password used in basic authentication.
  - `RepositoryReferenceName` string — Reference name of a Git repository hosting the Stack file
  - `RepositoryURL` string — Deprecated: Use SourceID instead. URL of a Git repository hosting the Stack file.
  - `RepositoryUsername` string — Deprecated: Use SourceID instead. Username used in basic authentication.
  - `SourceID` integer — SourceID references an existing Source for git credentials/URL. When set, the inline URL and authentication fields are ignored.
  - `TLSSkipVerify` boolean — Deprecated: Use SourceID instead. TLSSkipVerify skips SSL verification when cloning the Git repository.
  - `UseManifestNamespaces` boolean — Uses the manifest's namespaces instead of the default one

## Response `200`

OK

- PortainerEdgeStack
  - `CreatedBy` string — The username which created this stack
  - `CreatedByUserId` string — The username id which created this stack
  - `CreationDate` integer — StatusArray map[EndpointID][]EdgeStackStatus `json:"StatusArray"`
  - `DeploymentType` 0 | 1
  - `EdgeGroups` integer[]
  - `EntryPoint` string
  - `Id` integer — EdgeStack Identifier
  - `ManifestPath` string
  - `Name` string
  - `NumDeployments` integer
  - `ProjectPath` string
  - `Status` object
  - `UseManifestNamespaces` boolean — Uses the manifest's namespaces instead of the default one
  - `Version` integer

## Other responses

- `400` — Bad request
- `500` — Internal server error
- `503` — Edge compute features are disabled

---

[API](https://skmtc.net/portainer/apis/portainerce-api.md) · [All operations](https://skmtc.net/portainer/apis/portainerce-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/portainer/portainerce-api/revisions/c0b0975cd11b/schema)
