How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Portainer stacks API

Manage stacks

Portainer stacks API is one of 32 APIs that Portainer publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include Stacks. The published artifact set on APIs.io includes an OpenAPI specification, API documentation, an API reference, and a getting-started guide.

This API exposes 22 operations across 20 paths, and defines 26 schemas. It is described by OpenAPI 3.2.0, at version 2.39.1.

Requests are made against a single base URL, /api.

22 operations 20 paths 26 schemas 2 DELETE3 GET14 POST3 PUT

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.2.0
API Version
2.39.1
Base URL
https://api-docs.portainer.io
Authentication
API Key, API Key
License
Resource Areas
1

Authentication & Security 2

Portainer stacks API declares 2 security schemes for authenticating requests. An API key is passed in the header as X-API-KEY (ApiKeyAuth). An API key is passed in the header as Authorization (jwt).

Paths & Operations 22

Across 20 paths, the API surfaces 22 operations — 2 DELETE, 3 GET, 14 POST, 3 PUT. Each is listed below with its method, path, parameters, and response codes.

stacks 22

Manage stacks

GET
/stacks
List stacks
StackList 1 param → 200204400500
DELETE
/stacks/{id}
Remove a stack
StackDelete 3 params → 204400403404500
GET
/stacks/{id}
Inspect a stack
StackInspect 1 param → 200400403404500
PUT
/stacks/{id}
Update a stack
StackUpdate 2 params body → 200400403404500
PUT
/stacks/{id}/associate
Associate an orphaned stack to a new environment(endpoint)
StackAssociate 4 params → 200400403404500
GET
/stacks/{id}/file
Retrieve the content of the Stack file for the specified stack
StackFileInspect 1 param → 200400403404500
POST
/stacks/{id}/git
Update a stack's Git configs
StackUpdateGit 2 params body → 200400403404500
PUT
/stacks/{id}/git/redeploy
Redeploy a stack
StackGitRedeploy 2 params body → 200400403404500
POST
/stacks/{id}/migrate
Migrate a stack to another environment(endpoint)
StackMigrate 2 params body → 200400403404409500
POST
/stacks/{id}/start
Starts a stopped Stack
StackStart 2 params → 200400403404409500
POST
/stacks/{id}/stop
Stops a stopped Stack
StackStop 2 params → 200400403404500
POST
/stacks/create/kubernetes/repository
Deploy a new kubernetes stack from a git repository
StackCreateKubernetesGit 1 param body → 200400409500
POST
/stacks/create/kubernetes/string
Deploy a new kubernetes stack from a file
StackCreateKubernetesFile 1 param body → 200400500
POST
/stacks/create/kubernetes/url
Deploy a new kubernetes stack from a url
StackCreateKubernetesUrl 1 param body → 200400500
POST
/stacks/create/standalone/file
Deploy a new compose stack from a file
StackCreateDockerStandaloneFile 1 param body → 200400500
POST
/stacks/create/standalone/repository
Deploy a new compose stack from repository
StackCreateDockerStandaloneRepository 1 param body → 200400409500
POST
/stacks/create/standalone/string
Deploy a new compose stack from a text
StackCreateDockerStandaloneString 1 param body → 200400500
POST
/stacks/create/swarm/file
Deploy a new swarm stack from a file
StackCreateDockerSwarmFile 1 param body → 200400500
POST
/stacks/create/swarm/repository
Deploy a new swarm stack from a git repository
StackCreateDockerSwarmRepository 1 param body → 200400409500
POST
/stacks/create/swarm/string
Deploy a new swarm stack from a text
StackCreateDockerSwarmString 1 param body → 200400500
DELETE
/stacks/name/{name}
Remove Kubernetes stacks by name
StackDeleteKubernetesByName 3 params → 204400403404500
POST
/stacks/webhooks/{webhookID}
Webhook for triggering stack updates from git
WebhookInvoke 1 param → 200400409500

Schemas 26

The contract defines 26 schemas that model the data the API accepts and returns. The most detailed are portainer.Stack (20 properties), stacks.swarmStackFromGitRepositoryPayload (13 properties), stacks.kubernetesGitDeploymentPayload (12 properties), stacks.composeStackFromGitRepositoryPayload (12 properties). Each schema is shown below with its type and property counts.

portainer.UserResourceAccess
object
2 properties
stacks.composeStackFromFileContentPayload
object
4 properties 2 required
portainer.Pair
object
2 properties
portainer.StackType
integer
stacks.stackGitUpdatePayload
object
9 properties
portainer.ResourceControlType
integer
stacks.updateSwarmStackPayload
object
5 properties
portainer.AutoUpdateSettings
object
5 properties
portainer.ResourceAccessLevel
integer
stacks.swarmStackFromGitRepositoryPayload
object
13 properties 3 required
stacks.stackMigratePayload
object
3 properties 1 required
stacks.stackGitRedployPayload
object
10 properties
portainer.StackOption
object
2 properties
stacks.kubernetesManifestURLDeploymentPayload
object
4 properties
portainer.ResourceControl
object
11 properties
portainer.Stack
object
20 properties
stacks.kubernetesStringDeploymentPayload
object
5 properties
gittypes.GitAuthentication
object
4 properties
gittypes.RepoConfig
object
6 properties
stacks.composeStackFromGitRepositoryPayload
object
12 properties 2 required
portainer.StackStatus
integer
stacks.stackFileResponse
object
1 property
stacks.kubernetesGitDeploymentPayload
object
12 properties
portainer.TeamResourceAccess
object
2 properties
stacks.swarmStackFromFileContentPayload
object
5 properties 3 required
gittypes.GitCredentialAuthType
integer

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

portainer-stacks-api-openapi.yml Raw ↑

Other APIs Portainer publishes across the network.

Portainer auth API
Portainer backup API
Portainer custom_templates API
Portainer docker API
Portainer edge API
Portainer edge_groups API
Portainer edge_jobs API
Portainer edge_stacks API
Portainer endpoint_groups API
Portainer endpoints API
Portainer gitops API
Portainer helm API
Where this information came from

This is an independent, third-party profile of Portainer stacks API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.