---
title: "Inspect an Edge Stack for an Environment"
method: GET
path: "/endpoints/{id}/edge/stacks/{stackId}"
tags: ["edge_agent", "edge_stacks"]
---

# Inspect an Edge Stack for an Environment

`GET /endpoints/{id}/edge/stacks/{stackId}`

**Access policy**: Edge agent only — requires X-PortainerAgent-EdgeID header

## Path parameters

- `id` integer, required
- `stackId` integer, required

## Response `200`

OK

- EdgeStackPayload
  - `AlwaysCloneGitRepoForRelativePath` boolean — AlwaysCloneGitRepoForRelativePath is a flag indicating if the agent must always clone the git repository for relative path. This field is only valid when SupportRelativePath is true. Used only for EE
  - `CreatedBy` string — CreatedBy is the username that created this stack Used for adding labels to Kubernetes manifests
  - `CreatedByUserId` string — CreatedByUserId is the user ID that created this stack Used for adding labels to Kubernetes manifests
  - `DeployerOptionsPayload` EdgeDeployerOptionsPayload
    - `ForceRecreate` boolean — ForceRecreate is a flag indicating if the agent must force the redeployment of the stack. This field is only used when the Force Redeployment is triggered. Once the stack is redeployed, this field will be reset to false. For standard edge agent, this field is used in agent side For async edge agent, this field is used in both agent side and server side. This flag drives `docker compose up --force-recreate` option
    - `Prune` boolean — Prune is a flag indicating if the agent must prune the containers or not when creating/updating an edge stack This flag drives `docker compose up --remove-orphans` and `docker stack up --prune` options Used only for EE
    - `RemoveVolumes` boolean — RemoveVolumes is a flag indicating if the agent must remove the named volumes declared in the compose file and anonymouse volumes attached to containers This flag drives `docker compose down --volumes` option Used only for EE
  - `DirEntries` FilesystemDirEntry[] — Content of stack folder
    - `Content` string
    - `IsFile` boolean
    - `Name` string
    - `Permissions` integer
  - `EdgeUpdateID` integer — EdgeUpdateID is the ID of the edge update related to this stack. Used only for EE
  - `EntryFileName` string — Name of the stack entry file
  - `EnvVars` PortainerPair[] — Used only for EE EnvVars is a list of environment variables to inject into the stack
    - `name` string, required
    - `value` string, required
  - `FilesystemPath` string — Mount point for relative path
  - `ForceUpdate` boolean — ForceUpdate is a flag indicating if the agent must force the update of the stack. Used only for EE
  - `HelmConfig` PortainerHelmConfig
    - `Atomic` boolean — Atomic enables automatic rollback on deployment failure (equivalent to helm --atomic). Used by both git repo and Helm repository deployments.
    - `ChartName` string — ChartName is the name of the Helm chart within the repository. Required for Helm repository deployments.
    - `ChartPath` string — ChartPath is the path to a Helm chart folder within the cloned git repository. Used exclusively for git repo helm deployments. Mutually exclusive with ChartURL.
    - `ChartURL` string — ChartURL is the URL of a Helm chart repository. Used exclusively for Helm repository deployments. Mutually exclusive with ChartPath.
    - `ChartVersion` string — ChartVersion is the version of the Helm chart to deploy. Empty means latest. Used exclusively for Helm repository deployments.
    - `Namespace` string — Namespace is the Kubernetes namespace to deploy the Helm chart into. Used by both git repo and Helm repository deployments.
    - `Timeout` string — Timeout sets the deadline for Helm operations (equivalent to helm --timeout, e.g. "5m0s"). Used by both git repo and Helm repository deployments.
    - `ValuesFiles` string[] — ValuesFiles is a list of relative paths to Helm values YAML files within the cloned git repository. Used exclusively for git repo helm deployments.
    - `ValuesInline` string — ValuesInline is the inline YAML string of Helm values. Used exclusively for Helm repository deployments.
  - `ID` integer — ID of the stack
  - `Name` string — Name of the stack
  - `Namespace` string — Namespace to use for kubernetes stack. Keep empty to use the manifest namespace.
  - `PrePullImage` boolean — PrePullImage is a flag indicating if the agent must pull the image before deploying the stack. Used only for EE
  - `RePullImage` boolean — RePullImage is a flag indicating if the agent must pull the image if it is already present on the node. Used only for EE
  - `ReadyRePullImage` boolean — Used only for EE async edge agent ReadyRePullImage is a flag to indicate whether the auto update is trigger to re-pull image Deprecated(2.36): use DeployerOptionsPayload.ForceRecreate instead
  - `RegistryCredentials` EdgeRegistryCredentials[] — RegistryCredentials holds the credentials for a Docker registry. Used only for EE
    - `Secret` string
    - `ServerURL` string
    - `Username` string
  - `RetryDeploy` boolean — RetryDeploy is a flag indicating if the agent must retry to deploy the stack if it fails. Used only for EE
  - `RetryPeriod` integer — RetryPeriod specifies the duration, in seconds, for which the agent should continue attempting to deploy the stack after a failure Used only for EE
  - `RollbackTo` integer — RollbackTo specifies the stack file version to rollback to (only support to rollback to the last version currently)
  - `StackFileContent` string — Content of the stack file (for compatibility to agent version less than 2.19.0)
  - `SupportPerDeviceConfigs` boolean — Whether the edge stack supports per device configs
  - `SupportRelativePath` boolean — Is relative path supported
  - `Version` integer — Version of the stack file

## Other responses

- `400` — Bad Request
- `404` — Not Found
- `500` — Internal 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)
