---
title: "Retrieve the content of the Stack file for the specified stack"
method: GET
path: "/stacks/{id}/file"
tags: ["stacks"]
---

# Retrieve the content of the Stack file for the specified stack

`GET /stacks/{id}/file`

Get Stack file content.
**Access policy**: restricted

## Path parameters

- `id` integer, required

## Response `200`

Success

- StacksStackFileResponse
  - `StackFileContent` string — Content of the Stack file

## Other responses

- `400` — Invalid request
- `403` — Permission denied
- `404` — Stack not found
- `409` — Git settings changed, redeploy required
- `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/ec51a8194ac0/schema)
