---
title: "Deploy a new kubernetes stack from a git repository"
method: POST
path: "/stacks/create/kubernetes/repository"
tags: ["stacks"]
---

# Deploy a new kubernetes stack from a git repository

`POST /stacks/create/kubernetes/repository`

Deploy a new stack into a Docker environment specified via the environment identifier.
**Access policy**: authenticated

## Query parameters

- `endpointId` integer, required

## Request body

- StacksKubernetesGitDeploymentPayload
  - `AdditionalFiles` string[]
  - `AutoUpdate` PortainerAutoUpdateSettings
    - `ForcePullImage` boolean — Pull latest image
    - `ForceUpdate` boolean — Force update ignores repo changes
    - `Interval` string — Auto update interval Deprecated: polling interval now lives on the associated Source (Source.Interval). Kept for DB backwards-compatibility only; new code must not read or write this field.
    - `JobID` string — Autoupdate job id
    - `Webhook` string — A UUID generated from client
  - `ComposeFormat` boolean
  - `ManifestFile` string
  - `Namespace` string
  - `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 — Deprecated: use SourceID instead. 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.
  - `StackName` string
  - `TLSSkipVerify` boolean — Deprecated: use SourceID instead. TLSSkipVerify skips SSL verification when cloning the Git repository.

## Response `200`

OK

- StacksCreateKubernetesStackResponse
  - `Output` string

## Other responses

- `400` — Invalid request
- `409` — Stack name or webhook ID already exists
- `500` — Server error

---

[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/versions/c0b0975cd11b/schema)
