v13

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

Update a template

Update a template. Access policy: authenticated

put/custom_templates/{id}

Path parameters

idinteger required

Template identifier

Request body

ComposeFilePathInRepositorystring

Path to the Stack file inside the Git repository

Descriptionstring required

Description of the template

EdgeTemplateboolean

EdgeTemplate indicates if this template purpose for Edge Stack

FileContentstring required

Content of stack file

IsComposeFormatboolean

IsComposeFormat indicates if the Kubernetes template is created from a Docker Compose file

Logostring

URL of the template's logo

Notestring

A note that will be displayed in the UI. Supports HTML content

Platform0 | 1 | 2
RepositoryAuthenticationboolean

Deprecated: use SourceID instead. Use authentication to clone the Git repository.

RepositoryPasswordstring

Deprecated: use SourceID instead. Password used in basic authentication or token used in token authentication. Required when RepositoryAuthentication is true.

RepositoryReferenceNamestring

Reference name of a Git repository hosting the Stack file

RepositoryURLstring

Deprecated: use SourceID instead. URL of a Git repository hosting the Stack file.

RepositoryUsernamestring

Deprecated: use SourceID instead. Username used in basic authentication. Required when RepositoryAuthentication is true.

SourceIDinteger

SourceID references an existing Source for git credentials/URL. When set, the inline URL and authentication fields are ignored.

TLSSkipVerifyboolean

Deprecated: use SourceID instead. TLSSkipVerify skips SSL verification when cloning the Git repository.

Titlestring required

Title of the template

Type0 | 1 | 2 | 3 required

Example request

{
  "ComposeFilePathInRepository": "docker-compose.yml",
  "Description": "High performance web server",
  "Logo": "https://portainer.io/img/logo.svg",
  "Note": "This is my <b>custom</b> template",
  "RepositoryAuthentication": true,
  "RepositoryPassword": "myGitPassword",
  "RepositoryReferenceName": "refs/heads/master",
  "RepositoryURL": "https://github.com/openfaas/faas",
  "RepositoryUsername": "myGitUsername",
  "SourceID": 1,
  "Title": "Nginx",
  "Variables": [
    {
      "defaultValue": "default value",
      "description": "Description",
      "label": "My Variable",
      "name": "MY_VAR"
    }
  ]
}

Response

Success

CreatedByUserIdinteger

User identifier who created this template

Descriptionstring

Description of the template

EdgeTemplateboolean

EdgeTemplate indicates if this template purpose for Edge Stack

EntryPointstring

Path to the Stack file

Idinteger

CustomTemplate Identifier

IsComposeFormatboolean

IsComposeFormat indicates if the Kubernetes template is created from a Docker Compose file

Logostring

URL of the template's logo

Notestring

A note that will be displayed in the UI. Supports HTML content

Platform0 | 1 | 2
ProjectPathstring

Path on disk to the repository hosting the Stack file

Titlestring

Title of the template

Type0 | 1 | 2 | 3

Example response

{
  "CreatedByUserId": 3,
  "Description": "High performance web server",
  "EntryPoint": "docker-compose.yml",
  "GitConfig": {
    "ConfigFilePath": "docker-compose.yml",
    "ConfigHash": "bc4c183d756879ea4d173315338110b31004b8e0",
    "ReferenceName": "refs/heads/branch_name",
    "URL": "https://github.com/portainer/portainer.git"
  },
  "Id": 1,
  "Logo": "https://portainer.io/img/logo.svg",
  "Note": "This is my <b>custom</b> template",
  "ProjectPath": "/data/custom_template/3",
  "ResourceControl": {
    "AdministratorsOnly": true,
    "Id": 1,
    "Public": true,
    "ResourceId": "617c5f22bb9b023d6daab7cba43a57576f83492867bc767d1c59416b065e5f08",
    "SubResourceIds": [
      "617c5f22bb9b023d6daab7cba43a57576f83492867bc767d1c59416b065e5f08"
    ]
  },
  "Title": "Nginx",
  "Variables": [
    {
      "defaultValue": "default value",
      "description": "Description",
      "label": "My Variable",
      "name": "MY_VAR"
    }
  ],
  "artifact": {
    "files": [
      {
        "hash": "abc123",
        "path": "portainer.yaml",
        "ref": "refs/heads/main"
      }
    ]
  }
}