v13

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

Deploy a new compose stack from a file

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

post/stacks/create/standalone/file

Query parameters

endpointIdinteger required

Identifier of the environment that will be used to deploy the stack

Response

OK

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"
}