v13

latestOpenAPI 3.0.0zlibraw.githubusercontent.com2026-08-01265409652.5 KB
stacks

Redeploy a stack

Pull and redeploy a stack via Git Access policy: authenticated

put/stacks/{id}/git/redeploy

Path parameters

idinteger required

Stack identifier

Query parameters

endpointIdinteger

Stacks created before version 1.18.0 might not have an associated environment(endpoint) identifier. Use this optional parameter to set the environment(endpoint) identifier used by the stack.

Request body

Pruneboolean
PullImageboolean

Deprecated(2.36): use RepullImageAndRedeploy instead for cleaner responsibility Force a pulling to current image with the original tag though the image is already the latest

RepositoryAuthenticationboolean

When true and RepositoryPassword is non-empty, stored credentials are replaced.

RepositoryPasswordstring

Non-empty value (with RepositoryAuthentication=true) replaces stored credentials; leave blank to keep them.

RepositoryReferenceNamestring
RepositoryUsernamestring
RepullImageAndRedeployboolean

RepullImageAndRedeploy indicates whether to force repulling images and redeploying the stack

StackNamestring

Example request

{
  "Env": [
    {
      "name": "name",
      "value": "value"
    }
  ]
}

Response

Success

AdditionalFilesstring[]

Only applies when deploying stack with multiple files

CreatedBystring

The username which created this stack

CreationDateinteger

The date in unix time when stack was created

DeploymentStartStatus0 | 1 | 2 | 3 | 4
EndpointIdinteger

Environment(Endpoint) identifier. Reference the environment(endpoint) that will be used for deployment

EntryPointstring

EntryPoint is the path to the config file relative to the project root. NOTE: For git stacks this mirrors GitConfig.ConfigFilePath and the two are kept in sync by stackUpdateGit. The deploy command builder (compose_unpacker_cmd_builder) uses this field directly; Kubernetes deploy and git clone operations use GitConfig.ConfigFilePath.

FromAppTemplateboolean

Whether the stack is from a app template

Idinteger

Stack Identifier

Namestring

Stack name

Namespacestring

Kubernetes namespace if stack is a kube application

ProjectPathstring

Path on disk to the repository hosting the Stack file

Status0 | 1 | 2 | 3 | 4
SwarmIdstring

Cluster identifier of the Swarm cluster where the stack is deployed

Type0 | 1 | 2 | 3
UpdateDateinteger

The date in unix time when stack was last updated

UpdatedBystring

The username which last updated this stack

WorkflowIDinteger

WorkflowID is the ID of the Workflow that owns the Source for this stack.

Example response

{
  "AutoUpdate": {
    "Interval": "1m30s",
    "JobID": "15",
    "Webhook": "05de31a2-79fa-4644-9c12-faa67e5c49f0"
  },
  "CreatedBy": "admin",
  "CreationDate": 1587399600,
  "EndpointId": 1,
  "EntryPoint": "docker-compose.yml",
  "Env": [
    {
      "name": "name",
      "value": "value"
    }
  ],
  "GitConfig": {
    "ConfigFilePath": "docker-compose.yml",
    "ConfigHash": "bc4c183d756879ea4d173315338110b31004b8e0",
    "ReferenceName": "refs/heads/branch_name",
    "URL": "https://github.com/portainer/portainer.git"
  },
  "Id": 1,
  "Name": "myStack",
  "Namespace": "default",
  "ProjectPath": "/data/compose/myStack_jpofkc0i9uo9wtx1zesuk649w",
  "ResourceControl": {
    "AdministratorsOnly": true,
    "Id": 1,
    "Public": true,
    "ResourceId": "617c5f22bb9b023d6daab7cba43a57576f83492867bc767d1c59416b065e5f08",
    "SubResourceIds": [
      "617c5f22bb9b023d6daab7cba43a57576f83492867bc767d1c59416b065e5f08"
    ]
  },
  "SwarmId": "jpofkc0i9uo9wtx1zesuk649w",
  "UpdateDate": 1587399600,
  "UpdatedBy": "bob"
}