Skip to main content
Templates

Update a template

Update a Forward Template by ID.

Request headers

HeaderRequiredDescription
AuthorizationYesBearer <PAT>
Content-TypeYesapplication/json
Idempotency-KeyNoOptional idempotency key for unsafe requests.

Path parameters

ParameterTypeRequiredDescription
template_idstringYesForward Template ID.

Request body

Parameter

Type

Required

Description

name

string

No

New Template name.

description

string

No

New Template description.

model

string

No

New model identifier.

system

string

No

New System Prompt.

tools

array

No

Replaces the tool configuration list.

mcp_servers

array

No

Replaces the MCP Server list.

skills

array

No

Replaces the Skill binding list.

multiagent

object

No

Replaces the Managed Agents configuration.

environment_id

string|null

No

Replaces the default Environment ID. null or empty string clears it.

vault_ids

array|null

No

Replaces the default Vault list. null clears the list.

files

object|null

No

Replaces default file resources. null clears the map.

environment_variables

object|string|null

No

Replaces default environment variables. null clears them.

metadata

object

No

Merges updates into custom metadata.

Nested configuration objects

tools, mcp_servers, and skills are array fields; when provided in an update request, they entirely replace the original array.

File resources

files is a map keyed by File ID. Do not write file_id, id, or resource_id inside the configuration item. Forward automatically injects mount_path when creating a Session.
FieldTypeRequiredDescription
enabledbooleanNoOmitted is treated as true. In an Identity Config, set to false to disable an inherited file.

tools[] items

Each tools[] item selects its structure through type.
FieldTypeApplies toDescription
typestringAllRequired. One of agent_toolset_20260401, mcp_toolset, or custom.
enabled_toolsarrayagent_toolset_20260401Convenience allowlist; a non-empty array enables only the listed built-in tools.
disallowed_toolsarrayagent_toolset_20260401Convenience denylist; compiled into disabled tool configs.
configsarrayagent_toolset_20260401, mcp_toolsetPer-tool enablement and permission policy.
mcp_server_namestringmcp_toolsetRequired. Must match a mcp_servers[].name.
namestringcustomRequired. Custom tool name; must not collide with a built-in tool.
descriptionstringcustomRequired. Description of the custom tool.
input_schemaobjectcustomRequired JSON Schema. input_schema.type must be object.
Built-in tool names include Bash, Read, Write, Edit, Glob, Grep, WebFetch, WebSearch, and DeliverArtifacts.

Tool config

Each entry in tools[].configs[] uses the following shape.
FieldTypeRequiredDescription
namestringYesTool name; use the built-in tool name for built-ins and the MCP tool name for MCP toolsets.
enabledbooleanNofalse hides and rejects the tool; true enables it explicitly.
permission_policyobjectNoRuntime permission behavior.

Permission policy

FieldTypeRequiredDescription
typestringYesOne of always_allow, always_ask, or always_deny.

MCP servers

FieldTypeRequiredDescription
typestringNoOnly http is currently supported. When omitted, the Effective Config treats the entry as an HTTP MCP server.
namestringYesMCP server name that is unique within the Template and referenced by tools[].mcp_server_name.
urlstringYesStreamable HTTP MCP endpoint URL.

skills[] items

FieldTypeRequiredDescription
typestringYesEither custom or qoder.
skill_idstringYesSkill ID.
versionstringNoSkill version. Omit to use the latest version.
enabledbooleanNoOmitted is treated as true. false excludes the skill from the compiled Agent config.

Example request

curl -s -X POST 'https://api.qoder.com.cn/api/v1/forward/templates/tmpl_support' \
  -H "Authorization: Bearer $QODER_PAT" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Support assistant v2",
  "environment_id": "env_support_v2",
  "vault_ids": [
    "vault_crm",
    "vault_billing"
  ],
  "environment_variables": {
    "BASE_MODE": "support_v2"
  }
}'

Example response

HTTP 200 OK
{
  "type": "template",
  "id": "tmpl_support",
  "name": "Support assistant v2",
  "description": "Handles customer support requests",
  "status": "active",
  "model": "ultimate",
  "system": "You are a helpful support assistant.",
  "tools": [],
  "mcp_servers": [],
  "skills": [],
  "environment_id": "env_support_v2",
  "vault_ids": [
    "vault_crm",
    "vault_billing"
  ],
  "files": {},
  "environment_variables": {
    "BASE_MODE": "support_v2"
  },
  "metadata": {},
  "created_at": "2026-06-18T10:00:00Z",
  "updated_at": "2026-06-18T10:30:00Z"
}

Response fields

FieldTypeDescription
Return valueobjectFull Template object after update.

Errors

HTTPTypeCodeTrigger
400invalid_request_error-Invalid request body or unsupported field value.
404not_found_error-Template or referenced resource does not exist.
409conflict_error-Template name already exists or the status conflicts.
401authentication_errorTOKEN_INVALIDPAT invalid or expired.

Notes

  • Archived Templates cannot be updated.
  • Updating Session default configuration does not change existing Sessions.
Guides
Tutorials
API Reference