> ## Documentation Index
> Fetch the complete documentation index at: https://gcore.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Update template

> Modify an existing template's configuration.
Updates affect future applications created from this template; existing apps are not changed.



## OpenAPI

````yaml /api-reference/services_documented/fastedge_api.yaml put /fastedge/v1/template/{template_id}
openapi: 3.1.0
info:
  title: Gcore OpenAPI – FastEdge API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: '2026-05-07T20:33:46.548242+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - description: Application templates
    name: FastEdge Templates
    x-displayName: Templates
  - description: Client-level settings and limits
    name: FastEdge Clients
    x-displayName: Clients
  - description: >-
      Apps are descriptions of edge apps, that reference the binary and may
      contain app-specific settings, such as environment variables.
    name: Apps
    x-displayName: Apps
  - description: >-
      Binaries are WebAssembly executables that are actually executed when app
      is ran.
    name: Binaries
    x-displayName: Binaries
  - description: Statistics of edge app use
    name: Stats
    x-displayName: Stats
  - description: Secret values that can be used in apps
    name: FastEdge Secrets
    x-displayName: Secrets
  - description: Key-value edge storage for apps
    name: Edge Storage
    x-displayName: Edge Storage
paths:
  /fastedge/v1/template/{template_id}:
    put:
      tags:
        - FastEdge Templates
      summary: Update template
      description: >-
        Modify an existing template's configuration.

        Updates affect future applications created from this template; existing
        apps are not changed.
      operationId: updateTemplate
      parameters:
        - description: Unique identifier of the template to update
          in: path
          name: template_id
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/template'
        description: Complete template configuration (replaces existing)
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/template_short'
          description: Template updated successfully, returns updated metadata
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Bad request
        '404':
          description: Template not found
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error'
          description: Service temporarily unavailable
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            template_short = client.fastedge.templates.replace(
                template_id=0,
                binary_id=12345,
                name="api-gateway-template",
                owned=True,
                params=[{
                    "data_type": "string",
                    "mandatory": True,
                    "name": "api_key",
                }],
            )
            print(template_short.id)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/fastedge\"\n\t\"github.com/G-Core/gcore-go/option\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\ttemplateShort, err := client.Fastedge.Templates.Replace(\n\t\tcontext.TODO(),\n\t\t0,\n\t\tfastedge.TemplateReplaceParams{\n\t\t\tTemplate: fastedge.TemplateParam{\n\t\t\t\tBinaryID: 12345,\n\t\t\t\tName:     \"api-gateway-template\",\n\t\t\t\tOwned:    true,\n\t\t\t\tParams: []fastedge.TemplateParameter{{\n\t\t\t\t\tDataType:  fastedge.TemplateParameterDataTypeString,\n\t\t\t\t\tMandatory: true,\n\t\t\t\t\tName:      \"api_key\",\n\t\t\t\t}},\n\t\t\t},\n\t\t},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", templateShort.ID)\n}\n"
components:
  schemas:
    template:
      type: object
      required:
        - binary_id
        - name
        - params
        - api_type
        - owned
      properties:
        binary_id:
          type: integer
          format: int64
          description: ID of the WebAssembly binary to use for this template
          example: 12345
        name:
          type: string
          description: Unique name for the template (used for identification and searching)
          minLength: 1
          maxLength: 128
          pattern: ^[a-zA-Z0-9_ -]*$
          example: api-gateway-template
        short_descr:
          type: string
          description: Brief one-line description displayed in template listings
          maxLength: 255
          example: HTTP API gateway with authentication
        long_descr:
          type: string
          description: Detailed markdown description explaining template features and usage
          maxLength: 4096
          example: >-
            Complete API gateway solution with JWT authentication, rate
            limiting, and request transformation capabilities.
        api_type:
          readOnly: true
          type: string
          description: Wasm API type
        owned:
          type: boolean
          description: Is the template owned by user?
        params:
          type: array
          description: Parameters
          items:
            $ref: '#/components/schemas/template_param'
    template_short:
      type: object
      required:
        - id
        - name
        - api_type
        - owned
      properties:
        id:
          type: integer
          format: int64
          description: Template ID
        name:
          type: string
          description: Name of the template
        short_descr:
          type: string
          description: Short description of the template
        long_descr:
          type: string
          description: Long description of the template
        api_type:
          type: string
          description: Wasm API type
        owned:
          type: boolean
          description: Is the template owned by user?
    error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
          description: Error message
    template_param:
      type: object
      required:
        - name
        - data_type
        - mandatory
      properties:
        name:
          type: string
          description: >-
            Parameter name used as a placeholder in template (e.g., `API_KEY`,
            `DATABASE_URL`)
          minLength: 1
          maxLength: 64
          example: api_key
        data_type:
          type: string
          description: >-
            Parameter type determines validation and UI rendering:  

            string - text input  

            number - numeric input  

            date - date picker  

            time - time picker  

            secret - references a secret  

            store - references an edge store  

            bool - boolean toggle  

            json - JSON editor or multiline text area with JSON validation  

            enum - dropdown/select with allowed values defined via parameter
            metadata
          enum:
            - string
            - number
            - date
            - time
            - secret
            - store
            - bool
            - json
            - enum
          example: string
        mandatory:
          type: boolean
          description: >-
            If true, this parameter must be provided when instantiating the
            template
          default: false
          example: true
        descr:
          type: string
          description: Human-readable explanation of what this parameter controls
          example: API key for external service authentication
        metadata:
          type: string
          description: >-
            Optional JSON-encoded string for additional parameter metadata, such
            as allowed values for enum types
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````